2012-01-22

Install ssh server

Remote access is often very useful, and should be part of the first things to set up after a new installation. This is specially nice to still be able to modify graphic settings when nothing can be seen due to bad X11 config.

sudo apt-get install openssh-server is enough to do the job. The computer can then be accessed using a ssh client (putty is a classic one for Windows computers). However, the default port is 22, and is commonly scanned. This is a good idea to change this to something else, if you want to access your computer also from outside your local network.

The port change is done editing the sshd_config file:

sudo gedit /ect/ssh/sshd_config

The default value "Port 22" should be changed to another number, preferably something with 4 digits or more. Once done, save the file and reload the configuration for the ssh server with following command:

sudo reload ssh

2012-01-17

Mint trial

After lots of playing around with my Ubuntu box, I eventually managed to get some strange effects I could not solve with my poor knowledge of the system. Since I've heard it is not difficult to reinstall the system and keep my settings, I decided to give it a try.

It's almost enough to keep one's home directory as backup, all settings for various applications are safe this way and do not need to be reconfigured after the reinstallation is done.

But since I got quite some problems at first with Unity, then could use it but was not pleased with it, I decided to try something different. Linux Mint seemed to be quite popular too. This is what I choose to replace my standard Ubuntu (using XFCE instead of Unity).

After two weeks of Mint, I am ready to remove it and go back to plain Ubuntu (well, still avoiding Unity, of course). The reason? even if the desktop looks nice, this is not much more than a front and not much behind other than an Ubuntu with less accessible configuration over the GUI.
Also, using this box also as a jukebox, it makes no sense when Banshee and Rhythmbox were both instable, and sometime the system seemed to have slow down to the point I had to reboot.

So, next install? next try with Linux? I'll try again Ubuntu, this time with XBMC, let see what happens :)

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 :)