“Minimal” Install - Xubuntu 10.04 LTS - Openbox

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)

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

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

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?

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

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

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

Fix Windows 7 when stuck at “Starting Windows”

June 8th, 2010

OK, I dual boot W7 Home Premium and Xubuntu 10.04. I also like to try out various live cds, boot cds and so on.

Every now and then, when I boot to W7, it gets stuck at the “Starting Windows” splash screen, pretty glowing colours but thats it. If I start up in safe mode it gets as far as classpnp.sys and then just hangs.

So I boot back into Xubuntu and open up Gparted; to find that the W7 partition has become hidden (this is probably my fault for fiddling about :))

To fix, unmount W7 partition, and then Manage Flags and untick the “hidden” flag, then reboot into W7.

If you are not dual booting, you can use any Ubuntu Live CD or Parted-Magic Live CD, or there are paid for Live CDs that will do a similar thing.

There is another method if this doesn’t work (or “hidden”) isn’t the problem.

1. Boot windows but press F8 to get up the recovery menu, and choose “Repair Windows

2. Login in as an Administrator (your own account will do if that type of account)

3. You eventually get some menu choices, pick Command Prompt

4. Type dism /online/get-packages
(If that doesn’t work try dism image:c: /get-packages)

5. You should get a list of the updates installed. Find the most recent one and write down the full filename

Filenames look something like this:
WUClient-SelfUpdate-Core-opLevel~31bf3856ad35~x86~~7.4.7600.226

6. Then run: dism /online/remove-package /PackageName:nameof package
(Again, if that doesn’t work, try dism /image:c:/remove-package /PackageName:name of package

7. Reboot PC

8. If you still have a problem, perform this procedure again, removing the latest package, until you find the one that causes the problem

Another Useful Copy Command

May 8th, 2010

I last came up with this subject a while ago, whilst working on my own backup. Been needing something slightly different, which allows pulling out files of the same type. This one uses find rather than a straight cp function.

 find /pathtoinputdir/ -name “*.*” -type f -exec cp -urvp ‘{}’ /pathtooutputdir \;

I’ll break it down again:

 find /pathtoinputdir/ (pretty obvious, you could use just / to search your whole drive)

 -name “*.*”  (what to search for, replace *.* with anything you want to search for, but say you wanted to find all your jpg files, change it to *.jpg)

-type -f   (brings back files as opposed to directories)

-exec   (allows a function to run based upon what is found by find)

cp -urvp ‘{}’  (the copy with arguments and some magic (the brackets) which allows files and directories with spaces, newlines etc. See my other post to get descriptions of the cp arguments. You could replace cp with mv if you wanted to move and not copy)

/pathtooutputdir  (straight forward again, I create it first)

\;    (more magic to go with the brackets)

Word of warning, if you have lots of files with the same name but different contents, you will overwrite the older ones with the latest one, regardless of content

Disconnecting the Battery from a Range Rover L322 (2002 ->) Uk specification RHD

March 12th, 2010

In the old days, you just untightened and removed the two terminals from the battery, and that was that, but now its got over-complicated! I hadn’t used the Rangie for a week or so, and got a flat battery, couldn’t jump it from the little Mazda Eunos, so needed to try a charge up before it was off to Halfords for a new battery. Read through the Rave CD which required reading of four different sections, just to disconnect the battery, so here it is in all its glory:

DISCONNECTION:

  1. Turn off the ignition, and remove the key. (Keep the key close by you though, as the alarm may go off and you need to disable it)
  2. Ensure the alarm is disabled.
  3. Wait at least 2 minutes ( I gave it 5) for car systems to shut down such as the SatNav and Fuel Guage
  4. Yes, now you can lift the bonnet and disconnect the Earth terminal (brown lead)
  5. Now wait 10 minutes ( I gave it 20) for the SRS system to shut down. This is important because of what is to follow!
  6. You have a positive lead running to a fitting on the bulkhead in front of the battery, this fitting is used for connecting jump leads. Undo the nut (13mm) at the back, and release the cable, placing out of the way.
  7. Now unclip the cover for the battery terminal nut and undo the nut until loose.
  8. Now unclip and take apart the multiplug which runs to the positive connector.
  9. Now unclip the cover and undo and remove the nut for the battery disconnect system. Lift off the cable and set aside. (This is why item 5 is important, as this thing is designed to explode and break the battery connection in the event of a crash, so it works alongside the SRS)
  10. OK, now you can wiggle and remove the positive connector from the battery terminal.
  11. Battery disconnected!

Range Rover Battery Schematic


RECONNECTION:

  1. Refit the battery disconnect lead to the positive connector unit and tighten nut.
  2. Refit the positive connector to the battery terminal and tighten nut.
  3. Reconnect the “jump lead” cable to the bulkhead and tighten the nut.
  4. Reconnect the multiplug.
  5. Reconnect the negative terminal and tighten nut.
  6. Start the engine, and allow systems to fire up and do their thing.
  7. Finally, with the engine running, turn the steering wheel from full LH lock to full RH lock. This resets the DSC so it knows about the steering wheel position.
  8. Hopefully, everything back to normal. :)

NB: I left the battery in-situ to charge it, even though handbook and workshop manual recommend removal (Removal is for another blog post, which might mean gaining greater access under the bonnet, and pulley and levers to lift the flaming thing out!)