Archive for December, 2010

Fix the Noisy Fan on an Acer Aspire One

Friday, December 31st, 2010

There are two ways of doing this, depending upon the bios and kernel you are using

1. For older bios’ <3309 or for setups with an older kernel (say pre Ubuntu 10.04)

This is an oldie but goodie, thanks to netbook tech for guidance on this

#Download as follows:
wget http://electronpusher.org/~rachel/acerfand
wget http://aceracpi.googlecode.com/svn/trunk/acer_ec/acer_ec.pl

#Copy both files to /usr/local/bin
sudo cp acerfand /usr/local/bin/
sudo cp acer_ec.pl /usr/local/bin/

#Make acerfand executable
sudo chmod 755 /usr/local/bin/acerfand

#Add acerfand to your rc.local so that it fires up on boot
sudo nano /etc/rc.local
place /usr/local/bin/acerfand at the bottom of the file, before the exit 0

#Restart

#Configure
edit acerfand at your peril :)
or create an /etc/acerfand.conf with the following content:

INTERVAL=5
FANOFF=60
FANAUTO=70

These are the default values, temps are in celcius

This makes my setup with 10.04 LTs and bios 3310 shutdown after @ 30 seconds, so…

2. for newer bios > 3309 of newer kernels > Ubuntu 10.04+

This method can be u tried on older setups if 1. doesn’t work. From 2.6.31 this is included in the mainline kernel

Download this file:

wget http://www.piie.net/files/acerhdf_kmod-0.5.25.tar.gz

tar zxvf acerhdf_kmod-0.5.25.tar.gz
cd acerhdf_kmod
make
sudo make install

You might need to install you linux headers for your kernel to make/make install

Add acerhdf to /etc/modules so that it runs on boot

Run this command as root:

sudo -i

echo -n “enabled” > /sys/class/thermal/thermal_zone0/mode

Now test by running

sudo modprobe acerhdf

“Minimal” Install - Xubuntu 10.04 LTS - Openbox

Thursday, December 30th, 2010

As per a previous post, here is a breakdown of the installation carried out on a Dell Dimension 4100 with an PIII 833mhz processor and 256mb ram:

#XUBUNTU 10.04 LTS ALT CD
#On Install screen press F4 and select Command Line Install
#then Install Xubuntu

#UPDATE - RUN THIS AGAIN AFTER CONFIGRATION
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

#APPS
sudo apt-get install openbox openbox-themes tango-icon-theme-extras xorg obmenu obconf thunar firefox xfce4-terminal –no-install-recommends

sudo apt-get install arandr build-essential feh gdebi hicolor-icon-theme htop libxmu-dev libpng-dev libjpeg-dev g++ libxft-dev mousepad openssh-server portmap nfs-common mplayer-nogui mencoder audacious devilspie zenity htop ffmpeg rar cups-pdf python-software-properties synaptic tango-icon-theme thunar-volman thunar-archive-plugin unrar update-manager vlc wbar xubuntu-restricted-extras wicd gksudo

#APP ALTERNATIVES
#Music players: potamus, moc, cmus, alsaplayer
#File Managers: pcmanfm, mc
#Browsers: chromium, midori, elinks
#Useful tools: winff (video/audio conversion), clicompanion, xfburn, aria2 (downloader), fireftp/filezilla (ftp), geany (development), mirage/gthumb (image mgt), remmina (vnc client), I could go on, but this IS meant to be a minimal install!

#SCREEN RESOLUTION CHANGER
arandr

#PANEL
sudo add-apt repository ppa:killeroid/ppa && sudo aptitude update && sudo aptitude install tint2
#follow this guide and example conf file for tint2
nano ~/.config/tint2/tint2rc

#DOCK
wget http://www.ihku.biz/wbarconf/wbarconf_0.7.2-1_i386.deb
#this following command may refuse, in need of dependencies
sudo dpkg -i ~/wbarconf_0.7.2-1_i386.deb
#so run this
sudo apt-get install -f
#then the install command again
sudo dpkg -i ~/wbarconf_0.7.2-1_i386.deb
#run wbarconf and add your preferred apps to the dock
wbarconf
#to prevent windows from crashing the dock, set the top margin of the screen to @ 40 pixels

#LOGIN MANAGER
wget http://download.berlios.de/slim/slim-1.3.2.tar.gz
#follow instructions here:
#if you swap out the background image for slim with the same one for your desktop, you get a seamless flow from login to desktop

#ICON THEME
#the default icon theme is grey and bland so change it to Tango
nano ~/gtkrc-2.0
#add this to the file you have created to get the Tango icon theme:
gtk-icon-theme-name = “Tango”
#for the Tango icon theme

#GRUB
#adjust settings for grub menu such a countdown timer
sudo nano /etc/default/grub
sudo update-grub2

#DESKTOP BACKGROUND
#Find yourself a background
#open it with feh
#use the feh right click menu to set it as background
#do the startup routine to set background on startup
#see login manager about matching backgrounds

#STARTUP ROUTINE
nano ~/config/openbox/autostart.sh
#add the following
eval `cat $HOME/.fehbg` &
tint2 &
wicd &
sleep 6 &
wbar &

#RIGHT CLICK MENU
obmenu
#for apps that run in terminal use “xfce4-terminal -x nameofapp”
#to maximise app use “xfce4-terminal –maximize -x nameofapp”
for synaptic use “gksudo synaptic”

#WINDOW THEME
obconf

#CREATE NEW USER WITH SAME CONFIGURATION
#a new user created normally would have the basic configuration that you started with.
see here:

Recording with ALSA staring me in the face (and midi playback)

Tuesday, December 28th, 2010

Finding the right app to record stuff is a bit of a pain on linux, and playing back midi files can be a trial also. But everything you need is right there in your alsa-utils package. Open up a terminal and let’s get going!

Recording from a microphone:

 arecord -f cd -t wav -c 2 -D plughw:1,0 foobar.wav

This will record you microphone input from your chosen soundcard (in this case card 1, device 0) at 2 channel CD quality, outputting to a wav file for you to play with later. To playback your recording:

aplay foobar.wav

For more information and options, simply type:

man aplay

OK, to play back midi files, you may need to ensure you have timidity installed. Then find a midi file (*.mid) or a kar file (*.kar) and download it. Then it is simply:

 aplaymidi -l

to find an open port, in my case 128:0, then:

 aplaymidi mymidifile.mid

If you want to get the best out of kar files, then install pykaraoke, it will play back the midi and highlight the lyrics through the song :)

Linux - Listen to Microphone on remote PC

Sunday, December 26th, 2010

Due to the festive season there was a need to contact relatives in far flung places. Of course I hadn’t done any preparation, so things didn’t work as I wanted. I plugged a PS2 Eyetoy into my htpc, and installed Skype. Was pleased to see the video worked off the bat, but when contacting my first relly, I could see and hear them, they could see me, but could not hear me. The mic on the Eyetoy wasn’t configured correctly. Due to my work with special needs kids, I put my sign language (Makaton) skills (limited!) to good use, and we had a fun conversation as I taught my rellies sign language using sign language :)

Anyway set about reconfiguring my htpc to get the mic working later that evening. It’s a Ubuntu 10.10 setup, so I removed pulse audio, and got back to a basic alsa setup. (Note: my main PC is set up the same way) I did all the setup via ssh from my main desktop. Needed a way to test my microphone was working:

arecord -l

gave the the number of my device:

card 1: Namtai [EyeToy USB camera Namtai], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

I then tracked down via google a command that with some modification allowed me to listen to the microphone on the speakers on my main PC (in a another room). I put my smartphone next to the eyetoy, and set it to play an audiobook I had on it. Ran back to my study and ssh’d into the htpc. Once there I had to run the command, which included ssh’ing back to my main PC (bet that would confuse 2 windows PCs if you tried it!) Command all on one line:

 arecord -f dat -D plughw:1,0 | ssh -C bimma@10.10.10.10 aplay -f dat

and blow me, the sound of my audiobook being “listened to” by the microphone came through loud and clear on my main PC speakers

Key things: getting the device right, the arecord -l command gave the information of card 1 and device 0, which translates to plughw:1,0 (the -D option denotes the device for arecord to listen to), and -f dat indicates the format the sound will be recorded in and relayed to the remote PC. Have a good read of man aplay, for more info.

Now to try things out on a different relly tomorrow ;)

A Christmas Chune for You

Wednesday, December 22nd, 2010

Heard this on the radio the other day, drives SWMBO mad

Spike Jones’ My Birthday Comes on Christmas

My Birthday Comes On Christmas

Top Ten Best Linux Distros?

Wednesday, December 22nd, 2010

KMandla’s been getting all hot under the collar about Tech Radar’s distro list, so I thought I would have a go:

  1. Xubuntu 10.04 LTS / 10.10
  2. Ubuntu ALT-CD Command Line Installation with Openbox Window Manager
  3. SLiTaZ 3.0
  4. PartedMagic 5.0
  5. Arch Linux
  6. Puppy Linux 5
  7. Crunchbang Linux
  8. XBMC Live
  9. Clonezilla
  10. Struggling here; a toss up between Mint, UNR and Windows 7 :)

No place for Tiny Core Linux, but there, it gets a mention.

I do have modern PC hardware ;)

Copy a User Profile/Settings for New User in Xubuntu 10.04 LTS

Wednesday, December 22nd, 2010

When setting up a PC with Linux, especially when building up from a command line installation, you may need to create new users for the final end user of the machine. The last thing you want is to have to go through all the setup again for each user.

This is what you can do to copy the main profile to other users:

1. Setup the PC as you want it with your primary user, the one you installed with (We’ll call this USER1)

2. Next, run these three commands:

 sudo rm -rf /etc/skel  (it should be empty anyway

sudo mkdir /etc/skel

rsync -av /home/USER1/ /etc/skel

3. Create a new user, let’s call it USER2. Login in as USER2. It should have all the settings from USER1 in place. If you get any popup messages about things belonging to USER1, cancel all the popups, then run the above set of commands again, but this time copying over the USER2 profile. This should prevent popups for any future new users.

 sudo rm -rf /etc/skel

sudo mkdir /etc/skel

rsync -av /home/USER2/ /etc/skel

4. If users will be using Thunderbird, or other private programs, you can exclude them from the copy:

rsync -av –exclude=’ .thunderbird’ /home/USER1/ /etc/skel

5. You may want to setup the groups for the new user (for example, they won’t be an admin )

groups USER1

should return something like this:

 USER1 : USER1 adm dialout cdrom plugdev lpadmin admin sambashare

You can then set the groups for new users like so (for example: USER2 you want to be an admin and have sudo privileges)

 sudo usermod -G USER2 : adm dialout cdrom plugdev lpadmin admin sambashare

6. If you get in a mess and need to delete a user, including their home directory (the “-r” switch):

 sudo userdel -r USER2

SLim Struggle ! SLiM Simple Login Manager on Minimal Xubuntu 10.04 LTS

Wednesday, December 22nd, 2010

A couple of ancient PCs came into my possession, so I thought I would have a go at setting them up for passing on to new PC users / first timers. The “better” of the two an Athlon XP 1500 with 768mb ram handled full Xubuntu 10.04 LTS just fine, but the Dell Dimension 4100, PIII 833mhz with 256mb ram needed a different approach. So out with the ALT-CD and a command line install ensued, followed by an openbox window manager setup. The majority of packages I installed were done with the no-install-recommends switch.

As this machine was for a new user, I had to make things simple, so thought they might benefit from a login manager, and as usual I turned to SLiM. After installing build-essential, I downloaded the source for SLiM and set about compiling it.

wget http://download.berlios.de/slim/slim-1.3.2.tar.gz

tar xzvf slim-1.3.2.tar.gz

cd slim-1.3.2

Blocker number 1:

needed some dev dependencies. Tracked them down, and then the compile completed.

sudo apt-get install libxmu-dev libpng-dev libjpeg-dev g++ libxft-dev

make (still in directory slim-1.3.2)

sudo make install

Blocker number 2:

rebooted to find that SLiM had not fired up (which it had with every install I have ever done.) So stuck /usr/bin/slim into rc.local (above exit 0), and rebooted again. Success SLiM popped up

Blocker number 3:

SLiM would not log me in. So I dived into /etc/slim.conf and edited the login_cmd section to point to an openbox session. Rebooted again and I was finally in. The command below is all on one line.

login_cmd           exec /bin/bash -login /etc/X11/Xsession openbox-session

I’ll put this down to the minimal install and the use of –no-install-recommends switch