Search This Blog

Monday, April 9, 2012

HowTo: Ubuntu unknown user in statoverride

Tip : syntax error: unknown user ‘munin’ in statoverride file « OpenWebTech.fr

I installed virt-goodies on Ubuntu 10.04, and then nothing else would install. Even after uninstalling...A user called munin...

While the fix is easy...I could only find it in France, so here we go:

grep 'munin' /var/lib/dpkg/statoverride
#You should have the following lines:
#grep 'munin' / var / lib / dpkg / statoverride
#difference difference 755 / var / lib / difference
#difference difference 755 / var / www / difference
#difference difference 775 / var / lib / difference / plugin-state
#root munin 750 /etc/munin/plugin-conf.d
#munin munin 755 / var / cache / munin / www
#munin adm 750 / var / log / munin
#To solve the problem simply remove them with a little sed:
sed -i '/munin/d' /var/lib/dpkg/statoverride

Tuesday, March 6, 2012

HowTo: Fix Vi Backspace and delete problems

Backspace and delete problems - Vim Tips Wiki

Coming into a Suse system, vi didn't do colors, and the backspace key wasn't working...Here are three obscure things found when logging into lots of different systems.

Add these lines to your ~/.vimrc file.
NOTE: Use the real backspace key for ^?

syntax on
imap ^?


You may also need to fix the backspace key in the terminal. Put something like this in your .profile, .bashrc, whichever works.

stty erase '^H'

Some systems don't add a .profile to your user account. No problem until you log in remotely (i.e. ssh), then you get a warning, can't find your profile, screen doesn't look right...

ln -s ~/.bashrc ~/.profile # In case you don't have a .profile, get one this way.

Friday, March 2, 2012

HowTo: search for files excluding binary files on Linux

search for files excluding binary files - The UNIX and Linux Forums

An old problem with CVS is that you need to identify the binary files as you add them in (cvs add -kb). Otherwise, the next version will do an ASCII merge, trash the previous version, and you won't know until you try to restore an old version. Mostly happens when moving between Linux and Windows. Thanks to zazzybob, this will find ASCII files really well, and save me a bunch of work.

find . -type f -print | xargs file | grep "ASCII\|HTML\|text\|XML" | cut -d: -f1

Finds all binary files (almost) but very close...With the CVS problem, 'cvs add' the known good ASCII files, and any that are missed won't be re-added...

find . -type f -print | xargs file | grep -v "ASCII\|HTML\|text\|XML" | cut -d: -f1

Wednesday, February 22, 2012

HowTo: check if a file exists in a makefile (using makefile conditionals)

How to check if a file exists in a makefile - Stack Overflow

There are so many examples with redundant uses of wildcard
$(findstring ., $(wildcard *.))

Use the "wildcard" function:

$(wildcard *.h) 
EDIT: in order to match a specific list, do
$(wildcard $(HEADER_FILES)) 
There is no need to use $(filter ...), the wildcard function automatically filters files which don't exist.

ifeq ($(wildcard $(HEADER_FILES)), )
# This will stop the make trying to resolve HEADER_FILES for echo :)
echo "ERROR: $(HEADER_FILES)"
else
# File exists, continue or do something else...
endif

Tuesday, January 31, 2012

HowTo: Free IPA on Fedora

InstallAndDeploy - Free IPA

FreeIPA
The above link is mostly correct, but a few changes for Fedora 16 and above.

systemctl disable NetworkManager.service
chkconfig network on
systemctl start network.service

install-ipa-service
# IPA isn't enabled by default (yet)
systemctl enable ipa.service
systemctl restart sshd.service
systemctl start ipa.service
# Set up your local browser with the IPA cert.
firefox http://localhost

# Define this machine as a client to the new server.
ipa-client-install

ipa-ldap-updater --test

Problem: system-config-authentication doesn't work with IPA yet.
Solution: ipa-client-install (Thank you sgallagh)
Watch for this bug 731094 to be resolved as well.
On the root server, ipa-client-install is done as part of ipa-server-install.


Problem: IPA and Dirsrv not started.
/var/log/messages: startup - The default password storage scheme SSHA could not be read or was not found in the file /etc/dirsrv/slapd-PKI-IPA/dse.ldif. It is mandatory.

On a hard shutdown, the dse.ldif files were empty.

[root@montechristo ~]# locate dse.ldif
/etc/dirsrv/slapd-PKI-IPA/dse.ldif
/etc/dirsrv/slapd-PKI-IPA/dse.ldif.bak
/etc/dirsrv/slapd-PKI-IPA/dse.ldif.startOK
/etc/dirsrv/slapd-SOLENGTECH-BIZ-TM/dse.ldif
/etc/dirsrv/slapd-SOLENGTECH-BIZ-TM/dse.ldif.bak
/etc/dirsrv/slapd-SOLENGTECH-BIZ-TM/dse.ldif.startOK
/usr/share/dirsrv/data/template-dse.ldif

Solution: Copy dse.ldif bak files, and restart services.

cp /etc/dirsrv/slapd-PKI-IPA/dse.ldif.bak /etc/dirsrv/slapd-PKI-IPA/dse.ldif
systemctl restart dirsrv@PKI-IPA.service
cp /etc/dirsrv/slapd-SOLENGTECH-BIZ-TM/dse.ldif.bak /etc/dirsrv/slapd-SOLENGTECH-BIZ-TM/dse.ldif
systemctl start dirsrv@SOLENGTECH-BIZ-TM.service
systemctl start ipa.service

Thursday, January 26, 2012

HowTo: Change default OS in Grub2 Fedora

Grub2 - FedoraProject

I'm having trouble with kmod-nvidia keeping up with the kernels. So I need to change the default OS more than I'd like on Fedora 16...

Note, the Grub2 rules for Ubuntu are different than Fedora, and conflict.

Whenever you change the drives or OS you need to generate a new configuration file.

grub2-mkconfig -o /boot/grub2/grub.cfg
  
It will display a list of OS files found, Windows and Linux.
Found linux image: /boot/vmlinuz-3.2.3-2.fc16.x86_64
Found initrd image: /boot/initramfs-3.2.3-2.fc16.x86_64.img
Found linux image: /boot/vmlinuz-3.1.9-1.fc16.x86_64
Found initrd image: /boot/initramfs-3.1.9-1.fc16.x86_64.img
Found Windows NT/2000/XP (loader) on /dev/sdc1
done


To list the found OS's:
grep menuentry /boot/grub2/grub.cfg

menuentry 'Fedora Linux, with Linux 3.2.3-2.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
menuentry 'Fedora Linux, with Linux 3.1.9-1.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
menuentry "Windows NT/2000/XP (loader) (on /dev/sdc1)" --class windows --class os {


To check, by name, the saved entry:
grub2-editenv list
saved_entry=Fedora Linux, with Linux 3.1.9-1.fc16.x86_64


If you have not changed disk drives or partitions, start here
To boot the previous OS (i.e. Linux 3.1.9-1):
grub2-set-default 1
 
To boot the usual OS: (once everything is working again)
grub2-set-default 0
T 
 
 
</pre> with the title of the newly installed Fedora's entry. From that point on you can change the default by calling <pre>grub2-set-default <title or number></pre> or view it by running <pre>grub2-editenv list</pre> <p>To do that, you'll need the list of possible menu entries, which you can find with </p> <pre>grep menuentry /boot/grub2/grub.cfg<br /><br /><br /></pre><br />

Wednesday, January 11, 2012

HowTo: Install GNOME 3 Shell Extensions

Five must have Gnome shell extensions for Fedora 15 « Justin Stories

Earlier, I've blogged on the difficult to install weather extension (Rick Foos HowTo Blog: Gnome Shell Weather Extension ~ Web ...).

So how do you install GNOME 3 Shell Extensions?

First, Remember - Must Reset Desktop when Changing Shell Extensions
Alt-[F2], r

...Ubuntu is mostly the same with apt-get instead of yum...After you install the extensions, exactly the same...

# Install GUI to manage shell extensions.
yum -y install gnome-tweak-tool

# What are the available shell extensions?
yum list gnome-shell-extension-*

A list follows with some possibilities...
Installed Packages
gnome-shell-extension-common.noarch 3.2.3-1.fc16 @updates
gnome-shell-extension-systemMonitor.noarch 3.2.3-1.fc16 @updates
Available Packages
gnome-shell-extension-alternate-tab.noarch 3.2.3-1.fc16 updates
gnome-shell-extension-alternative-status-menu.noarch
3.2.3-1.fc16 updates
gnome-shell-extension-apps-menu.noarch 3.2.3-1.fc16 updates
gnome-shell-extension-auto-move-windows.noarch 3.2.3-1.fc16 updates
gnome-shell-extension-cpu-temperature.noarch 0-0.3.git1f471c7.fc16 updates
gnome-shell-extension-dock.noarch 3.2.3-1.fc16 updates
gnome-shell-extension-drive-menu.noarch 3.2.3-1.fc16 updates
gnome-shell-extension-gpaste.noarch 2.1-1.fc16 updates
gnome-shell-extension-icon-manager.noarch 0-0.4.gitc34779c.fc16 updates
gnome-shell-extension-mediaplayers.noarch 0-0.1.git259f96e.fc16 fedora
gnome-shell-extension-native-window-placement.noarch
3.2.3-1.fc16 updates
gnome-shell-extension-noim.noarch 1.0-1.fc16 fedora
gnome-shell-extension-noripple.noarch 1.0-1.fc16 fedora
gnome-shell-extension-pidgin.x86_64 0-0.5.git80d4ea4b59.fc16
fedora
gnome-shell-extension-places-menu.noarch 3.2.3-1.fc16 updates
gnome-shell-extension-pomodoro.noarch 0-0.2.git13030cd.fc16 fedora
gnome-shell-extension-presentation-mode.noarch 0-0.3.gitbe7e0ae.fc16 updates
gnome-shell-extension-remove-accessibility-icon.noarch
20111008-1.fc16 updates
gnome-shell-extension-remove-bluetooth-icon.noarch
0.2-1.fc16 updates
gnome-shell-extension-remove-volume-icon.noarch 0.3-1.fc16 updates
gnome-shell-extension-righthotcorner.noarch 1.0-1.fc16 fedora
gnome-shell-extension-theme-selector.noarch 0.9-3.fc16 fedora
gnome-shell-extension-user-theme.noarch 3.2.3-1.fc16 updates
gnome-shell-extension-windowsNavigator.noarch 3.2.3-1.fc16 updates
gnome-shell-extension-workspace-indicator.noarch 3.2.3-1.fc16 updates
gnome-shell-extension-workspacesmenu.noarch 0-1.fc16 fedora
gnome-shell-extension-xrandr-indicator.noarch 3.2.3-1.fc16 updates
# If you're not one to mess around, install them all...You can always remove them later...
yum install gnome-shell-extension-*

# Enable/Disable Shell Extensions from a gui.
gnome-tweak-tool



While many of them may not do what you expect, some are good.

Some extensions will need settings to be customized.

# Find where the settings for a shell extension are located.
# NOTE: Extensions may or may not have 'extension' in their schema name.
gsettings list-schemas

# Find the current settings, for an extension.
# if you have a keyword to grep, you can use that or copy one of the schemas from the list.
gsettings list-recursively $(gsettings list-schemas | grep weather)

org.gnome.shell.extensions.weather city ''
org.gnome.shell.extensions.weather position-in-panel 'center'
org.gnome.shell.extensions.weather show-comment-in-panel true
org.gnome.shell.extensions.weather show-text-in-panel true
org.gnome.shell.extensions.weather translate-condition true
org.gnome.shell.extensions.weather unit 'fahrenheit'
org.gnome.shell.extensions.weather use-symbolic-icons false
org.gnome.shell.extensions.weather woeid 'USTX0058'

# Find out what the valid settings are...
# Most useful for enums, otherwise just reports the data type and none exactly say what will happen...
gsettings range org.gnome.shell.extensions.weather unit

enum
'celsius'
'fahrenheit'

# Change a setting
gsettings set org.gnome.shell.extensions.weather unit 'fahrenheit'

Now you are an unintended expert in GNOME 3 shell extensions...This is a step backward, there was a GUI to add shell extensions in GNOME 2...I had no intention of becoming a shell extension expert...So I'm an unintended expert...

- Rick