2011-11-14

What hardware is in there?

You are helping out friends with a linux installation? You just forgot what hardware you used to build your server out of spare parts?
I found the lshw command to be a quick help: sudo lshw -html > ~/hw.html
Now, opening the created file to be located in your home directory will show all kind of hardware details, like how much memory was installed, what disks, what processor and motherboard... So no need to get the screwdriver.

2011-09-02

Loud fans...again

Configuring fan speed using pwmconfig and fancontrol is not a big deal, normally. However, some problem can arise (see: "Loud fans...WHAT?"). Now it was running smoothly on my machine, but was not always working after a reboot.

Running sudo fancontrol brings up no noise reduction, but following message:

Not starting fancontrol, outdated configuration file; please re-run pwmconfig.
Running and restarting fancontrol helps, but it will eventually fail later, after some reboot.
A closer look to the /etc/fancontrol config file shows following (on my system):
INTERVAL=10
DEVPATH=hwmon0=devices/platform/w83627ehf.656
DEVNAME=hwmon0=w83627dhg
FCTEMPS=hwmon0/device/pwm2=hwmon0/device/temp2_input
FCFANS=hwmon0/device/pwm2=hwmon0/device/fan2_input
MINTEMP=hwmon0/device/pwm2=35
MAXTEMP=hwmon0/device/pwm2=65
MINSTART=hwmon0/device/pwm2=135
MINSTOP=hwmon0/device/pwm2=90
MINPWM=hwmon0/device/pwm2=90
MAXPWM=hwmon0/device/pwm2=255
When I run again pwmconfig, what I missed first was the number behind hwmon. This number changed, being sometime 0, sometime 1 after rebooting. Searching for this kind of problem brought up this interesting page with the solution.
This seems to happen quite often in relation with the k8temp module. Anyway, removing this module from /etc/modules and black-listing it in the file /etc/modprobe.d/blacklist.conf adding blacklist k8temp did the trick, and I can listen to music without vacuum cleaner noise in background.

2011-05-11

Simpler removing of meta packages

In a previous post, I explained how to remove kubuntu-desktop meta-package. This required a huge command line with all the packet that were installed through this meta-package. Now, I learned a simpler solution: apt-get does not provide a remove function for meta-packages, bug aptitude does!

This makes installing and removing meta-packages like kubuntu-desktop much simpler:
aptitude install kubuntu-desktop

and:
sudo aptitude remove kubuntu-desktop

I found this information on ubuntuforums.org. It worked for me to uninstall the Xubuntu desktop before upgrading to Ubuntu 11.04, as the upgrade procedure complained about third party packaged before cancelling the upgrade procedure.

2011-04-03

Subsonic refusing to play some OGG files

I stumbled upon some tracks refusing to be played in subsonic when using the web-player (no problem in jukebox mode). The web-player mode is doing some transcoding with ffmpeg, the jukebox mode does not requires it. OGG files were not affected by this problem.

Some errors from the log file around the problematic file:
DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) [NULL @ 0x9b45bc0]Format detected only with low score of 24, misdetection possible!
DEBUG InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) [mp3 @ 0x9b46df0]Header missing

Looking closer to the problematic files showed an ID3v2 header at begin of the file, followed by the expected Ogg header. After removing the ID3v2 header (using the great 'tag'), the problem was gone.

This just showed that ffmpeg is a bit sensible to the tags in the audio files. Of course, these tags should not have been there. However, VLC and foobar had no problem with these (buggy) files.

Non-root subsonic installation

I choose already for some time subsonic as music streaming and jukebox system. This was working well with the basic installation information provided from the website:

sudo apt-get install openjdk-6-jre
sudo dpkg -i subsonic-x.x.deb
sudo apt-get install lame flac faad vorbis-tools ffmpeg

First problem: no sound in jukebox mode. The solution is to install the java from sun, and use this one instead of the openjdk provided by default.

sudo apt-get install sun-java6-jre sun-java6-plugin

Installing is only half of the job. Selecting what java to use is done with following command:

update-java-alternatives -s java-6-sun

Second problem: subsonic is now running as root. This is not a big deal when the server is intended to be use behind your firewall, but becomes a bit scary when allowing access from internet. The solution is described in the official subsonic forum. I preferred the second post of the thread explaining how to do the changes to run as a specific user still using the simple package based installation. The first post requires to configure your own web-server, a bit more complex for similar result.

I used slightly different commands:
sudo su
service subsonic stop
adduser --system --no-create-home subsonic
adduser subsonic audio
chown -R subsonic:nogroup /tmp/subsonic 
chown -R subsonic:nogroup /var/subsonic 
chown -R root:root /var/subsonic/transcode 
chown -R root:root /var/subsonic/jetty/*/webapp

Now we need to edit /usr/share/subsonic/subsonic.sh to use sudo -u subsonic before the call to java. The line looks like that with the change applied:

sudo -u subsonic ${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \

Now subsonic can be started, and we can verify it uses the correct assigned user instead of root. Start subsonic: service subsonic start.

ps -Af | grep subsonic shows what user runs subsonic.

To finish, enjoy some music :)

2011-02-28

Playing with desktop managers

After checking KDE for my needs, playing with all the nice features, looking around in the settings, setting up Amarok after being used to Rythmbox, I got quickly bored of KDE. It is looking nice, has quite some features, but nothing I would miss if it is not there. Also, my computer is not the newest generation, and KDE feels a bit sluggish compared to Gnome.

So I decided to try somthing else: XFCE, installed using the command:
sudo apt-get install xubuntu-desktop

Once logged out, I could log in using the new desktop. Wow! What a fast start after using KDE! Also, everything looks simple and clear, easy to get familiar with this interface. Of course, it does not look so modern like KDE or even Gnome itself, but fashion is not a top requirement to me.

But now, how to I remove KDE? Installing was easy, but removing looks a bit more complex, even after some google searches. I found my solution there: "Getting Back to a Pure Gnome on Ubuntu".

Since I did not wanted to get Gnome back as my default environment, but prefered XFCE, the proposed command line needed only a small change at the end, replacing ubuntu-desktop with xubuntu-desktop

Here is the complete modified command (just one character changed!):
sudo apt-get remove a2ps abiword abiword-common abiword-plugin-grammar abiword-plugin-mathview aumix aumix-common browser-plugin-parole catfish elementary-icon-theme exaile exo-utils fortune-mod fortunes-min gdebi gdebi-core gigolo gimp gimp-data gnumeric gnumeric-common gnumeric-doc gtk2-engines-xfce gvfs-bin hal hal-info imagemagick libabiword-2.8 libaiksaurus-1.2-0c2a libaiksaurus-1.2-data libaiksaurusgtk-1.2-0c2a libbabl-0.0-0 libcdt4 libexo-0.3-0 libexo-common libgdome2-0 libgdome2-cpp-smart0c2a libgegl-0.0-0 libgimp2.0 libgoffice-0.8-8 libgoffice-0.8-8-common libgraph4 libgsf-1-114 libgsf-1-common libgtkmathview0c2a libgvc5 libhal-storage1 libhal1 libilmbase6 libjpeg-progs libjpeg8 liblink-grammar4 libloudmouth1-0 libmagickcore3-extra libmng1 libnetpbm10 libopenexr6 libotr2 libots0 libpathplan4 libpsiconv6 librecode0 libsexy2 libtagc0 libthunar-vfs-1-2 libwv-1.2-3 libxcb-keysyms1 libxdot4 libxfce4menu-0.1-0 libxfce4util-bin libxfce4util-common libxfce4util4 libxfcegui4-4 libxfconf-0-2 link-grammar-dictionaries-en mousepad murrine-themes netpbm orage oss-compat parole pidgin pidgin-data pidgin-libnotify pidgin-otr plymouth-theme-xubuntu-logo psutils python-cddb python-mmkeys python-mutagen ristretto smartdimmer tango-icon-theme tango-icon-theme-common thunar thunar-archive-plugin thunar-data thunar-media-tags-plugin thunar-thumbnailers thunar-volman thunderbird ttf-lyx wdiff xchat xchat-common xfburn xfce-keyboard-shortcuts xfce4-appfinder xfce4-clipman xfce4-clipman-plugin xfce4-cpugraph-plugin xfce4-dict xfce4-fsguard-plugin xfce4-mailwatch-plugin xfce4-mixer xfce4-mount-plugin xfce4-netload-plugin xfce4-notes xfce4-notes-plugin xfce4-panel xfce4-places-plugin xfce4-power-manager xfce4-power-manager-data xfce4-quicklauncher-plugin xfce4-screenshooter xfce4-session xfce4-settings xfce4-smartbookmark-plugin xfce4-systemload-plugin xfce4-taskmanager xfce4-terminal xfce4-utils xfce4-verve-plugin xfce4-volumed xfce4-weather-plugin xfce4-xkb-plugin xfconf xfdesktop4 xfdesktop4-data xfprint4 xfswitch-plugin xfwm4 xfwm4-themes xscreensaver xubuntu-artwork xubuntu-default-settings xubuntu-desktop xubuntu-docs xubuntu-gdm-theme xubuntu-icon-theme xubuntu-wallpapers && sudo apt-get install xubuntu-desktop

2011-02-26

Missing default

After a change from Gnome to KDE, simply using the command sudo apt-get ubuntu-desktop, answering bravely to use kdm as default, I came to the login screen. This one looked already promising, KDE-style. Once I logged in, there was only a terminal window, unmovable, on a part of the screen, the rest using the background of the login-screen (or default KDE background).

So why did I had no full KDE desktop session? Just because I missed the option-arrow on the login screen, where one can select which desktop to use. There was no default selection (all radio-buttons unselected). Selecting here KDE on next login, I could get the KDE desktop.

Small hint: when on this terminal-only session, I got back to the login screen using sudo /etc/init.d/kdm restart.

2011-02-03

Loud fans... WHAT?


Before becoming deaf, I thought it would be a nice idea to check what can be done to slow down the fans. The good keywords are 'fancontrol' and 'pwmconfig'. With these, plenty of setup descriptions can be found.


To resume quickly:
  1. check what sensors you can use: sudo sensors-detect
  2. copy the drivers like indicated. A manual copy is better to avoid duplicate entries in your /etc/modules
  3. (optional) Some sudo modprobe work can be necessary if the drivers are not loaded
  4. now, a call to sudo pwmconfig will configure the fan speeds. Follow the proposed steps, it is well explained
  5. now the /etc/fancontrol file was created
  6. running sudo fancontrol & activates the fan speed regulation based on the settings made with pwmconfig

Unfortunately, executing the command sudo fancontrol & got me an error in /usr/sbin/fancontrol at line 402... Looking there, I was middle in a UpdateFanSpeed function, and one the the variables got invalid value. Since this section looks like it reads the settings made in the /etc/fancontrol file, I looked there. The problem could be solved easily using information from pwmconfig about what temperature sensor name to use, since this was missing.

The fan control worked once I corrected the /etc/fancontrol from
FCTEMPS= hwmon0/device/pwm2=
to
FCTEMPS= hwmon0/device/pwm2=hwmon0/device/temp1_input

Note that hwmon0/device/temp1_input was my preferred sensor, chosen based on the measured temperatures shown during pwnconfig set-up. This is probably only valid for my box.

2011-02-02

remote desktop and the 'd' key

Accessing my ubuntu box from windows over remote desktop connection worked without problem. However, after some update (again?), I figured out the 'd' key was not doing what expected: it would reduce all the windows of the gnome desktop instead of just inserting a simple 'd'... not really friendly when you want to play with 'sudo' command.

After some searching, the solution is quite simple: going to 'system > preferences > shortcuts' and looking for assigned shortcuts, 'd' was one of them, responsible for reducing all windows. Removing the shortcut (or replacing it with something useful) is enough to get 'd' back alive.

2011-02-01

ubuntu killer update

Some ubuntu 10.10 update broke it! I'm still having some problems, but I already learned about groups and the importance of the first created user.

This first user belongs (normally) to the admin group, and is allowed to use the 'sudo' command. It seems my '/etc/group' file got corrupted at some point, leaving my first user with almost no rights. Specially, I was not even allowed to use 'sudo' to get it fixed.

Thanks to this page, I got at least the required access rights back, editing the '/etc/group' file in recovery mode, adding my first user to the admin group. 'nano' is already configured to be used as alternative to 'vidudo' (often recommanded to edit '/etc/sudoers'), and much simpler to use for normal people. Also worth reading about 'sudo', in order to understand what it is all about: this ubuntu help page.

After I got my user back into the admin group, I had to edit again the '/etc/group' file to add my user also to various other groups, since every settings were gone.

Here is the list of groups I used (found on serverfault.com): 
  • adm
  • dialout
  • cdrom
  • floppy
  • fuse
  • audio
  • dip
  • video
  • plugdev
  • sambashare
  • lpadmin
  • admin

Note: having a backup is always the best solution. If you are lazy and lucky, you can find a valid 'group' file at one of these locations:
  • /etc/group_backup
  • /var/backups/group.bak