Friday, 18 December 2009

Howto: Split pane Nautilus


This is now not necessary as Ubuntu 10.04 has dual pane built-in, just hit F3



Found this on OMGBuntu and have been using it, its pretty useful so far and has been stable.

sudo add-apt-repository ppa:berndth/ppa

Then I opened up Synaptic and clicked "Reload" to reload all repository data, and "Mark all Upgrades" and apply it. Alternatively you can do:

sudo apt-get update &&;sudo apt-get dist-upgrade

You will need to either logout and back in, or hit ALT+F2 and "killall nautilus" and then ALT+F2 again and "nautilus" to restart it with the new changes. Note that if you have added extra buttons to the Nautilus toolbar you will have to readd those as the update will have over written them. Add the changes to the NEW file, don't just copy over the old if you had a backup. The new file contains menu items for the split pane which you won't want to lose.

Now you can use F3 to pop open or close the extra pane.


Tuesday, 17 November 2009

Howto: Stop Ubuntu 9.10 Karmic Mounting USB Devices With UUID Instead of a Name

Ubuntu 9.10 Karmic Koala changed the way USB devices get mounted a little bit. Instead of being mounted as /media/disk and then each other device becoming /media/disk-1, disk-2 and so forth, now the device is mounted with its UUID, a seemingly random string.

I never minded the disk-1, disk2 thing, though it was slightly annoying to not know which device was which sometimes it was seldom a problem as I had frequently just plugged it in and watched it mount. So the new change was a bt more of an annoyance as its harder to see which random string just appeared sometimes.

The solution as ever is pretty darned simple however, just label the device you lazy bum ;)

Pop along to the following page and read how to label different partition types, most likely fat16/32 or NTFS for your average thumbdrive of phone/mp3 player mounted as a mass storage.

https://help.ubuntu.com/community/RenameUSBDrive

Personally I use the Gparted method as mtools has an issue which means you have to add the device to a config file first (its detailed on the page) and while its not hard, its just an extra step I don't need.

So if you don't have Gparted installed already do the following or use Synaptic:

sudo apt-get install gparted

Start Gparted from the System/Administration menu, then select your device from the drop down list in the top right then unmount it by right clicking it in the lower frame and choose unmount. This is so you can make changes to it. Choose to "label" it from the same right click menu or from the Partition menu, finally you have to apply the changes by clicking the right most icon on the toolbar to "Apply all changes". It is done instantly and no longer will that device be known as /media/4169-87bb.

Sunday, 15 November 2009

Howto: Disable the 60 second delay in Logout/Restart/Shutdown

This new setting became a pet hate of mine within minutes of installing Ubuntu 9.10 Karmic Koala, there is a 60 second delay and confirmation dialog when logging out, restarting or shutting down. This default can be over-ridden to act instantly rather than waiting for 60 seconds or clicking a confirmation by setting the apps/indicator-session/suppress_logout_restart_shutdown boolean to true as follows:

gconftool-2 -s '/apps/indicator-session /suppress_logout_restart_shutdown' --type bool true


You can of course use gconf-editor if you want to use a GUI based tool, just navigate to /apps/indicator-session in the left tree and change the value of suppress_logout_restart_shutdown to enabled/ticked/true.



Wednesday, 4 November 2009

Howto: Adjust updatedb.mlocat to a sensible time.


All credit for this goes to This Blog Entry where I found this helpful information.

If you are an early riser like myself (well, occasionally at least) then you may notice your PC grinding away on its harddrives like a mad thing. I have around 3TB of storage so the problem is exacerbated somewhat. The process to blame is updatedb.mlocat which runs between 6am and 7am, I want a quiet morning with my coffee so I am going to show you how to move it to between 3am and 4am

The job parameters are listed in /etc/cron.daily/mlocate. We don't edit anything here, its just for reference.

#! /bin/sh

set -e

[ -x /usr/bin/updatedb.mlocate ] || exit 0

# See ionice(1)
if [ -x /usr/bin/ionice ]; then
IONICE=”/usr/bin/ionice -c3″
fi

$IONICE /usr/bin/updatedb.m

The files in /etc/cron.daily are kicked off by /etc/crontab, not by root’s crontab. For some reason, Ubuntu’s default install runs this process around 6am. Changing this file allowed me to make the job run at 3am. Here we change the hour time to 3 instead of 6, so you will need a sudo gedit or something to adjust this... carefully.. sudo gedit /etc/crontab

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don’t have to run the `crontab’
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
17 * * * * root cd / && run-parts –report /etc/cron.hourly
25 3 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.daily )
47 3 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.weekly )
52 3 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.monthly )
#


updatedb can be configured to ignore certain paths - since my machine has a number of drives used for backups, I wanted to exclude those from the updatedb job. I accomplished this by editing /etc/updatedb.conf and adding to the PRUNEPATHS listing. Adding paths to the PRUNEPATHS option instructs updatedb to exclude those paths from indexing.

PRUNE_BIND_MOUNTS=”yes”
PRUNEPATHS=”/tmp /var/spool /media /mnt/backup”
PRUNEFS=”NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf rpc_pipefs”

Tuesday, 3 November 2009

Howto: Revert Update-notifier behaviour to old style

The new method of alerting users to updates seems ever so slightly hair brained to me, but what do I know. Well I do know I prefer the old method where I was alerted each day, not the new method of waiting 7 days to make the alert. And only being alerted then if 7days had passed since the last activity in apt!

Ok, here is the fast fix:

gconftool -s --type bool /apps/update-notifier/auto_launch false

Thats it, job done.

Sunday, 18 October 2009

Howto: Sync Bash History Between Terminals

Do you want to be able to use the history from another terminal quickly and simply in a new terminal, or to be able to use any one of the terminals on your desktops to continue working with a current history?

Me too :]

This is a very easy tweak and makes a lot of sense to most people. So we need to edit the file ~/.bashrc

gedit ~/.bashrc

At the bottom paste in the following:

shopt -s histappend
PROMPT_COMMAND="history -n; history -a"
unset HISTFILESIZE
HISTSIZE=2000


Unsetting HISTFILESIZE just gets rid of the filesize limitation, and we rely on HISTSIZE which allows 2000 lines in the file, both normally default to 500.

PROMPT_COMMAND tells bash to reload history and append to history each time it draws the prompt in the terminal.

The only thing to note is if you jump from one terminal to another and wish to recall the last history line from the former terminal, press enter once with a blank line, this causes bash to draw the prompt and sync, if you only just opened the second terminal then you don't have to. The sync only occurs when the prompt is drawn, nothing else to note.

Friday, 2 October 2009

Howto: Apwal, A Lightwieght Pop-Up Launcher


I've been Apwal for a while now and have been surprised how few people have even heard of it let alone tried it. It gives you a bunch of launcher items that can pop up at you cursor location, its quick and simple and very useful.

First open a terminal and enter the following line to install it, or use synaptic if you prefer a GUI.

sudo apt-get install apwal

Now its loaded we should add some launchers to it so there is something for it to display, and ultimately launch. So now, open up that terminal if you thought you would get away with not using it before and enter the following:

apwal --edit

The config window will show and it will start to index available icons on your system for it to use as the launcher buttons. The only single downside to apwal I have, is that it does this ever single time you go to edit it, and if you have installed a lot of icons this can take a couple of minutes, so if it takes a while showing the load icons progress bar display, bear with it.

Ok, now its a fairly simple case of adding the command to the application you want, and an icon to show for it, use the filter box on the icon display, if searching for an icon to mplayer for instance, filter *player* as an example to show any icons with player in their filename.

Ok, assuming you have now setup several application launchers you will want to have a means of making it pop-up, I will describe how I did it on my system and if anyone chooses an alternative method could they describe it in the comments for others to benefit from, thanks.

I use Compiz and I wanted to have Apwal display when I pressed right click on the desktop with control held down (control+right click then). Assuming that sounds ok to you, open up the compiz settings manager from your Preferences menu. Now go to the Commands section (normally at the very top of the config pane).

In the first empty slot on the Commands tab (probably Command line 0, and enter "apwal" without the quotes, then click on the Button Bindings tab and for Run command 0 define the binding to <control>Button 3 I am not going to describe that, if you can't manage it, put your PC back into the box and take it back to the store ;)

Ok, now you should have a binding set that when you hold down the Control key and right click the mouse, your launcher will popup darned near instantly, its very fast. This will normally work on top of other windows such as nautilus and just about anything else in my experience.

I hope you enjoy it, its certianly my prefered application launcher method.

Thursday, 24 September 2009

Howto: A simple encrypted folder using Cryptkeeper.

I required a simple solution to easily secure some data, a single folder that could be encrypted and require a password to decipher being the ideal solution. A quick google soon pointed me to a couple fo options, Truecrypt and Cryptkeeper. Truecrypt seemed far more than I required but Cryptkeeper was perfect for my use.

To get it installed and any extra dependencies issue the following from a terminal or Synaptic if you prefer.


sudo apt-get install cryptkeeper

You can then start Cryptkeeper from the
menu >> Applications >> System Tools >> Cryptkeeper It will launch to your System Tray, click the icon and choose "New encrypted folder". Give it a name in the top entry on the dialogue, and a location on your hard disks to have the encrypted folder in the lower part. Click "Forward" then enter your password, its pretty darned important not to lose this password as it will not be recoverable if you ever lose it, and that means the data won't be either.

Once that is done nautilus will open your new encrypted folder which is currently empty.
You can now move the data you want making secure into this folder, when you are done, click on the Cryptkeeper System Tray icon again and "untick" the folder that you had just created. Once unmounted the data cannot be read and the folder will become hidden from view. When hidden the folder is simply renamed with a dot preceding it, so if you do get curious and navigate into it you will find your file names and the content they hold is encrypted and unreadable.

To access the data again just click the icon and "tick" the box next to the entry to remount it and make the data accessible, the files in the folder can be read as normal by any applications and resaved again directly in place. Its incredibly simple, usable and ample security for the data I want to keep private, little more than personal letters in my case and I think that is the case with most home users.

Sunday, 6 September 2009

Howto: Automatically reboot on Kernel Panic.

While on holiday I was unable to SSH into my home PC one morning, worrying slightly about what might have happened as the machine is normally rock solid stable I called home to my parents who live very close and asked my mother when she went around to reboot the machine (assuming the house was ok and hadn't burnt down or been burgled)

She called me back up, the lights on the keyboard were flashing and she wasn't sure what to do as there was nothing on the screen when she turned it on, I explained how to hard reset the box (I wasn't going into Raising Skinny Elephants Is Utterly Boring with her), the machine rebooted ok.

After thanking her I logged in and did the tasks I needed to do and then spoke with a friend about it, he made a suggestion I had not known about. The computer could be configured to automatically reboot next time it Kernel paniced. No need to ask my mother to go and reboot it :]

Simply add the following line to /etc/sysctl.conf

kernel.panic = 60

After 60 seconds the computer will automatically reboot itself. Then you need to find out why it paniced and fix it.

Howto: Reclaim hard disk space from the system.


Before I went on holiday last week I had an internal drive start to fail, so a quick look at Ebuyer and a new Samsung Ecodrive F2 1.5TB monster was delivered. I swapped out the drives and went on holiday. While I was away I realised that I had left the default setting on the drive for system reserved space. Almost 80GB was reserved by the system for logs and such which I feel is a tad excessive myself ;)

This works on ext2/3 partitions and from what I can tell and been advised this is fairly safe to do, I'm using "fairly safe" deliberately here, as I best understand it the reserved space is mainly for system logs, helps to prevent fragmentation and helps when a drive becomes 100% full.

Note: This is safe to do on drives containing data, no need to backup everything to perform it, no data should be lost, based on advice I received and my own results of course, I will not be held liable for your data or lack of backups in general.

I have set my storage drives to 0% reserved space, left my root drive at 5% space and my /home drive at 2% space (which should be around 3GB which is excessive I think but better safe than sorry). Change /dev/sda1 to match the drive you want to change!

sudo tune2fs -l /dev/sda1

Lists the drives settings (note that "-l" is a lower case L, in case of font issues), you can then see how many blocks are being reserved by the system, you can then adjust the default 5% that the system uses to something nicer), If you have a Nautilus open before issuing the command, notice how much free space is available (lower left corner of the window) then issue the command and refresh the Nautilus window, the result is instant extra space available to see and use.

sudo tune2fs -m 0 /dev/sda1

This will set it to 0%, adjust that "0" to a more suitable number if needed, I prefered to leave some space reserved on root and /home, drive space is cheap but I don't like the though of wasting too much, making adjustments on various drives and partitions recovers me a good chunk over 100GB!



Tuesday, 25 August 2009

Make Pasword file Immutable - A Security tip

You can add a extra layer of protection to your machine, or in my case help to prevent wannabe haxx0r brothers at the parents house from changing to extremely short passwords with a little trick that not many are aware of.

What happened to me was my brother managed to shoulder surf the admin account on my parents PC, I normally update their PC by SSH from home, but I was around there visiting and mum had described a problem so I was fixing it while we chatted, my brother was lurking around and managed to shoulder read my 12 digit alpha numeric password (have to give the guy a bit of credit there, sadly)

Anyway I became aware that files on the admin account had incorrect accessed times afterwards and then looked deeper and found that someone had been in on the account and had changed my brothers password on his account from a sensible 10 digit alphanumeric (which was dead simple to bang in with two fingers as the digits were paired on the keyboard) into a rather less safe two letter password. He claimed that a friend had helped him break into my account as "you aren't the only one that knows linux", as if I ever imagined that I was some guru, I'm a self confessed learner still! As we "discussed" this further he came clean that he had simply watched me enter the password rather than "hacked" in.

Anyway lets get onto the crux of this, after setting your passwords open a terminal and enter:
chattr +i /etc/shadow

This will make the file immutable, which means that it cannot be deleted or renamed, no symlink can be made to this file and no data can be written to the file. The immutable flag must be cleared before passwords can be changed, if you try to do so without clearing it then it will appear to change the password, but in fact it would not write to the file, without error. Meaning the new password would never be written and the old password would continue being the active one.

If a fairly knowledgeable user tries to dig into why it won't write and they try:
$ ls -l /etc/shadow
-rw-r----- 1 root shadow 1027 2009-08-25 14:37 shadow


There is nothing obviously wrong with writing to the file, to check properly you would use:
$ sudo lsattr shadow
----i------------- shadow


Here we can see the +i flag set for immutable. If we clear that with:
chattr -i /etc/shadow
The password can now be changed as normal, using sudo passwd username
and then it can be set +i again to protect it.

A little bit sneaky and just a little bit safer.

Monday, 24 August 2009

A script to copy clipboard to a file.

While mucking about with some scripts I got a little bored of copying them into files and chmod +x and copying them into the path, so I just knocked up this little scriptlet. It will optionally set the execute flag on the file if it is a script you are pasting, or leave it as a normal txt file for just saving some text.


First install the package xclip with either Synaptic or:
sudo apt-get install xclip

This isn't a great script, there is very little error checking and it won't even go out of its way to tell you if the syntax is wrong, luckily its easy enough and does what I wanted simply.

Syntax is :
clip2file -x filename
Copies the clipboard into a file and sets it to execute with chmod +x then movies it into ~/bin
clip2file -a filename
Copies the clipboard into a file and nothing more.

You should have already made a bin/ folder in your home (~/bin/) this I believe is already defined as in the $PATH on Ubuntu install.

make a new file in that bin folder called "clip2file" and open it in your favourite text editor such as nano, vim or gedit and past the following script into it.

#!/bin/bash
#
# Copy the contents of the X clipboard into
# the specified file.
#
# This makes it crap loads easier to make new commands from scripts.
#
# Perhaps make it automagically +x if the first script line is
# #/bin/*
#
#

hflag=
aflag=
xflag=

while getopts 'ha:x:' OPTION
do
case $OPTION in
h) hflag=1 ;;

a) aflag=1
aval="$OPTARG" ;;

x) xflag=1
xval="$OPTARG" ;;

?) printf "Usage: %s: [-x filename] [-a filename] or use -h to recieve help\n"
exit 1 ;;
esac
done

shift $(($OPTIND - 1))

if [ "$hflag" ]
then
printf "Clip2file provides an easy method to create a file from the X clipboard\n"
printf "as either a text file, or make the file executable as a bash script.\n\n"
printf "-x filename ......... Create the file, then set the execute bit.\n"
printf "-a filename ......... Create the file but do not set execute.\n\n"
exit 1
fi

if [ "$xflag" ]
then
xclip -selection clipboard -o > "$xval"
chmod +x "$xval"
mv "$xval" $HOME/bin/
fi

if [ "$aflag" ]
then
xclip -selection clipboard -o > "$aval"
fi

exit 0

Set the file to allow executing, with with chmod +x clipt2file or by right clicking it in nautilus and choosing Proerties then going to the Permissions tab and setting it to allow executing.

Now if you want to add a new script off a website, simply copy the text into the clipboard and in a terminal or run dialog (alt+F2) enter:

clip2file -x filename

Filename of course being the name to save the file too, you can then run your new script right away.

Please remeber this script isn't perfect but its good enough for what it does, if someone would like to expand on it then I would happily post the improved version with credit.

Sunday, 23 August 2009

Howto: SSH Public Key Authorisation Login (AKA Passwordless)

To be clear, this is how to login using SSH to another machine without having to enter your password. It is not an all encompassing solution but a "good enough" set up. I have to administer a couple of machines and a shell which I have use of, my own machine is kept up to date and I feel is secure enough with only myself as sole user.

Firstly we should make a key pair if you haven't already done so, these are deposited into into ~/.ssh

ssh-keygen -t rsa

Next we need to get the contents of ~/.ssh/id_rsa.pub onto our remote machine and into ~/.ssh/authorized_keys this can be done a couple ways, I found it as easy to just ssh into the remote machine and paste the contents directly into the file just note that if you paste it in you may have to correct the formatting so it is all on one line, I noticed a couple of line breaks sneak in. You could use something like the following however:

scp -P 20060 ~/.ssh/id_rsa.pub remoteaccount@remotesserver.com

Then you can just append it automatically with the following (we will touch the file in case it doesn't already exist on your machine:

touch ~/.ssh/authorized_keys
cat id_rsa.pub >> ~/.ssh/authorized_keys


We should at this point make the .ssh folder only readable by the owner:

chmod 700 ~/.ssh

You can optionally delete the id_rsa.pub key file if it was in your home folder, its the public key part so its not really necessary in my opinion but it is nice to tidy up after yourself ;)

rm id_rsa.pub

If you try and login now to the remote machine with SSH you should with any luck find you do not have to enter your password at all and can just get right on with your work.

Saturday, 15 August 2009

Howto: Make Rhythmbox Put Album Covers on the Desktop (Desktop Art)

Ever wondered how people get the album covers on the desktop of the tracks they are listening too?

From Ubuntu Linux Tips and Tutorials


I'm happy to say its very simple, though it will depend on your albums having the cover art available in the mp3 folders.
Open up a terminal and simply paste these commands in one at a time:

If you do not have subversion installed then issue the following command, if you are not sure then enter it anyway, at worst it will just tell you it is already installed and do nothing.

sudo apt-get install subversion

And then these:

mkdir -p $HOME/.gnome2/rhythmbox/plugins/
cd $HOME/.gnome2/rhythmbox/plugins/
svn co http://nedrebo.org/svn/rhythmbox/desktop-art

Fire up Rhythmbox and go to the Edit/Plugins in the menu bar and find Desktop Art in the lefthand list and simply enable it. You can now configure it using the configure button on the right hand pane, don't worry about using the X,Y positioning coordinates as you can simply alt+leftclick drag the desktop art frame when you exit the configuration. So just adjust the colours if you want, and chane the text position relative to the album cover art.




Wednesday, 12 August 2009

Enable Composite Manager in Metacity

Not every computer has the resources to run Compiz, but if you pine after some nice effects like window shadows then there is a good chance your computer is capable of running simpler effects. i use this on my Acer Aspire One, sure it can manage Compiz, but it is a little overkill on the baby netbook.

Well rejoice now as Metacity has a composite manager built in which can give you nice drop shadows as well as a window preview on alt+tab and that  pesky inactive window title-bar transparency (which I detailed how to disable last post).

Enable the composite manager in gconf-editor and navigate to the branch in apps/metacity/general

Tick the box next to the setting composite_manager and you are now hopefully enjoying drop shadows... Yay!

A quick alternative is to paste this into a terminal

gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool true

and if you need to disable it again use:

gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool false




Adjust Titlebar Transparency in Metacity

I might be in the minority with this sentiment but I really dislike the transparency Gnome has gained on its inactive window titles when using the GTK window decorator. So here is how to make inactive windows have a solid title-bar or if you are are fan of it, make it even more transparent.

Press alt+F2 and in the run dialog enter:

gconf-editor

Navigate in the left hand tree to the branch /apps/gwd/

The two values we are interested in are :

metacity_theme_opacity which affects inactive window titlebars
metacity_theme_active_opacity which affects active windows

A setting of 1 will make the title-bars solid while 0.75 is the default at three quarters opacity.

Friday, 7 August 2009

How to use OTF fonts in Ubuntu

It isn't possible to use OTF fonts directly in Ubuntu without converting them into TTF's.

If we spend just a few minutes and install FontForge and make a very small script it becomes almost trivial to do.

sudo apt-get install fontforge

Now we should make the scripts, well it is two actually but one is a small config script for FontForge and the other is just a script to convert many OTF files in one go, rather than individually. First the FontForge settings file.

cd ~/bin
touch otf2ttf.conf

Then open otf2ttf.conf in your favourite text editor and paste the following into it.

#!/usr/local/bin/fontforge
# Quick and dirty hack: converts a font to truetype (.ttf)
Print("Opening "+$1);
Open($1);
Print("Saving "+$1:r+".ttf");
Generate($1:r+".ttf");
Quit(0);

Save the file, and now lets make the script to convert many fonts in one swoop.

cd ~/bin
touch otf2ttf
chmod +x otf2ttf

Again, open this file with your prefered text editor and paste the following in.

#!/bin/bash
#
# had to enable extglob
shopt -s extglob

# this uses globbing to match fiels ending in otf/OTF
for i in +(*.otf|*.OTF)

do fontforge -script /home/subbass/bin/otf2ttf.conf $i

done

To use this now (provided that your ~/bin folder is in your path) just open a terminal where your OTF files are, and issue the command otf2ttf. It will convert 20 files in just a couple of seconds to give you an idea of speed, you can then move all the resulting TTF files into ~/.fonts


Credit to http://www.stuermer.ch/blog/convert-otf-to-ttf-font-on-ubuntu.html where I found the script before re-typing the instructions. I put it here so I don't lose it next time I need it.

Wednesday, 5 August 2009

Howto Create Split RAR Files

Lets learn how to create split Rar files

If you have a large amount of data to backup or especially to transfer it can be very prudent to use an archive that can be split into smaller parts, if one section becomes corrupted during transfer, it is far better to transfer a single 15mb file again, than an entire 10GB file, right?

Lets grab the rar program:

sudo apt-get install rar

Ok lets compress our directory of files:

To compress file(s) to split rar archive know which directory you want to compress, I'll use a fictional DVD Image folder in the home folder.

rar a -m5 -v5M -R myarchive /home/yourname/dvdimage

Let me break the above command down

rar – starts the program
a – tells program to add files to the archive
-m5 – determine the compression level (0-store (fast)…3-default…5-maximum(slow))
-v15M – determine the size of each file in split archive, in this example you get files with size 15MB (if you wanted files of 512kB size you would write -v512k)
myarchive – name of the archive you are creating
/home/yourname/dvdimage – is folder of the files you wish to add to the archive

You can also add -p to the command after a and it will prompt you for a password.

You can read the manual for more options with man rar (Press q to exit and arrows to scroll up/down)

To uncompress the archive type:

rar x myarchive.part01.rar

Or right click on file myarchive.part01.rar in Nautilus and choose Extract Here.




Tuesday, 4 August 2009

Howto make autohide panels smaller and hidden more in Gnome

Autohide panels in Gnome default to a 6 pixel strip remaining showing. I suspect this is done to "reduce confusion" which is a popular phrase from the Gnome guys, regardless its a little annoying to autohide a panel and still have it show around 20% of itself, so lets fix that.

The easiest way to do this is pop open a terminal and enter:

gconf-editor

This is quite a daunting program if you are fairly new to dabbling in the guts of OS's, and I must warn you to be a little careful in here, certainly don't go just changing stuff around to "see what happens"... Ok, no-one is that dumb... right?

Anyway, down the left hand side is a nice tree menu, navigate to:

/apps/panel/toplevels/

You should then see your panels on the left in the toplevels branch, possibly named bottom_panel_screen0, top_panel_screen0 or simply panel_0, panel_1 etc. Click on each of the panel entries and you will see the right pane populate with some "keys", locate the one auto_hide_size which is very likely set to 6 at the moment, change the 6 to a 1 by clicking on it.

The change is nearly instant and you will hopefully see the relevant autohidden panel sneak a little further offscreen, setting the value to 0 (zero) will not have the desired effect incidently so stick to 1 please.


Monday, 3 August 2009

Delay applications running with sleep from autostart

This is how to cause some programs to wait until they run from the autostart, I will cover both Gnome and Openbox.

First, how to do this in Gnome. Fire up the Session manager either from preferences or via:

gnome-session-properties

Now when you either edit an existing entry, or add a new one the command should be in the following format:

bash -c "sleep 30; gnome-do"

This will make Gnome Do wait 30 seconds before running, obviously you can adjust the 30 and the command to run as your needs dictate. Any changes will be affected when you next login of course.

For Openbox we need to edit ~/.config/openbox/autostart.sh (where ~/ relates to your own home folder, the system will translate it). The file is a simple text format with one command per line, almost all applications in here will want a & (ampersand) after them. The ampersand tells the system to run the command and not wait for it to finish before going to the next, without it Openbox would likely run the first command then stall loading, waiting for it to end before it would even finish loading the desktop.

Ok, the magic to cause the delay....

(sleep 30s && ubuntuone-client-applet) &

Please note the parenthesis, its apparently very important to ensure the command is bracketed like this. Again you may adjust the delay time, and the command (in this case ubuntuone-client-applet)



How to create Debian menu for Openbox

This may also work for other WM like Fluxbox and TWM.

The Debian menu builds a menu from all the installed applications on your system and nicely organises them. I believe it also keeps it updated when you install new software so you do not have to manually add items to your Openbox menu.

To install it use:

sudo aptitude install menu

After it is installed run:

sudo update-menus

To enable the menu in Gnome go to the desktop panel menu:

System / Preferences / Main Menu and enable the Debian menu under Applications.


Friday, 24 July 2009

Bulk rotate images using EXIF data

Using a simple command line command it is very simple to rotate any number of images using the exif data (hopefully) contained in the image. Most cameras will save the exif data and include the camera rotation when the photograph was taken.

sudo apt-get install jhead

then when we run the following command in the folder it will losslessly rotate the photographs that need it.

jhead -autorot *

Job done :]

Tuesday, 14 July 2009

Set up rxvt terminal with unicode and clickable URL's

Rxvt is a super fast unicode terminal which I have recently switched to away from Eterm for my transparent desktop terminal.

sudo apt-get install rxvt-unicode-ml

Next is to create a configuration file for it in your home folder.

touch .Xdefaults

Now paste this lot in...

URxvt*termName: rxvt

## borderless and no scrollbar
URxvt*scrollBar_right: false
URxvt*scrollBar: false
URxvt*borderLess: false

## teh transparency stuff
URxvt*inheritPixmap: true
URxvt*tintColor: white
URxvt*shading: 100

##
## These 3 lines make links clickable
##
URxvt.urlLauncher: firefox
URxvt.matcher.button: 1
URxvt.perl-ext-common: matcher,readline

## geometry and font
URxvt*geometry: 80×15
URxvt*font: xft:Terminus:pixelsize=12

## change default colors
URxvt*background: #000000
URxvt*foreground: #A8A8A8
URxvt*color0: #000000
URxvt*color1: #A80000

## URxvt*color2: #00A800
URxvt*color2: #ED254F

URxvt*color3: #A85400
## main bars in irssi
URxvt*color4: #020202
URxvt*color5: #A800A8
URxvt*color6: #00A8A8
URxvt*color7: #A8A8A8
URxvt*color8: #545054
URxvt*color9: #F85450

## Time in Irssi
URxvt*color10: #ED254F
## URxvt*color10: #50FC50

## URxvt*color11: #F2FC50
URxvt*color11: #ED254F

URxvt*color12: #5054F8

URxvt*color13: #ED254F
## URxvt*color13: #F854F8

URxvt*color14: #50FCF8
URxvt*color15: #F8FCF8

Note that some of the colours have been changed to coordinate with my current desktop theme, the original colours are commented out so you can easily revert. Also the line defining the window geometry seems to have no effect, I shall look into that and correct it when I get some time and inclination. At the moment I don't mind because the default window size is fine, and the launcher I use to start the transparent terminal I use on the desktop mainly for my screen with irssi, hellanzb and mediatomb in has the geometry set on it. the launcher command is:


rxvt -g 80x15

Last job is to tell compiz to not decorate this window, this will get rid of the title bar, borders and shadow etc.

Hopefully you have installed the advanced compiz settings (ccsm), so just open that up and go to the section for window decorations
in Effects, Window Decorations.

Add the rxvt window to be excluded from shadows and decorations, and that should see you done.



Monday, 13 July 2009

Howto: Ubuntu 9.04 notification of available updates revert behaviour

Revert the change in notifications of available updates to original behaviour.

Open a terminal and issue the command:

gconftool -s --type bool /apps/update-notifier/auto_launch false

This will do away with the Update manager automatically opening and revert to showing the update icon instead effectively reverting to original behaviour. The new method seems like a massive regression to me. I don't want to wait 7 days to have the computer randomly open the update manager, and even worse that 7days is reset if you used Synaptic, apt-get or add/remove!

I completely fail to understand why none critical updates should wait 7days before Ubuntu decides that you should install them, and reset the clock if you opened Synaptic in between.

Thursday, 9 July 2009

Synaptic not showing search results

Synaptic fails to show search results for packages that you know are present.

This was an annoying little problem I had on 8.10 and bless my soul if it didn't occur on my fresh clean install of 9.04, so I thought I should throw the solution up here in case I need it again, or anyone else does.

Open a terminal and issue the following command

sudo update-apt-xapian-index

It will just take a couple of minutes to rebuild the apt database, then Synaptic should work fine again.



Wednesday, 8 July 2009

Logitech G9 on Ubuntu 9.04 Jaunty

Logitech G9 on Ubuntu 9.04 Jaunty


Info taken from : http://ubuntuforums.org/showthread.php?t=1092352

Firstly we need to install a couple of extra programs so open up a terminal and copy/paste the following line:

sudo apt-get install xvkbd xbindkeys
Next up we need to make a ~/.xbindkeysrc and put the next few lines into it:
"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[left]""
b:6
"/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[right]""
b:7
"/usr/X11R6/bin/xvkbd -xsendevent -text "\[Control_L]\[Page_Up]""
m:0x0 + b:11
"/usr/X11R6/bin/xvkbd -xsendevent -text "\[Control_L]\[Page_Down]""
m:0x0 + b:12
Then make another file called ~/.Xmodmap which contains the single line:

pointer = 1 2 3 4 5 8 9 6 7
Then give it a quick test by starting xbindkeys up in a terminal, the buttons should all work correctly. It could be tested in nautilus by seeing if the back button will move back a folder.

Control+Alt+Backspace shortcut does not restart the X server

Control+Alt+Backspace shortcut does not restart the X server

Edit: I believe this was removed because the kernal already contained another combo that does the same job, Alt+SysReq+k will terminate and restart X if it should become unresponsive.

If you would prefer the old key combination then issue the following two commands in a terminal. I would advise against this though, but as always, the choice is entirely yours.

sudo apt-get install dontzap
then do:
sudo dontzap –disable



Monday, 22 June 2009

Install Samba Server on Ubuntu

Install Samba Server on Ubuntu


If you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.


To install, first open a terminal window and enter the following command:


sudo apt-get install samba smbfs


We’ve got samba installed, but now we’ll need to configure it to make it accessible. Run the following command to open the configuration file, substituting your editor of choice:


sudo gedit /etc/samba/smb.conf


Find this section in the file:


####### Authentication #######

# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
; security = user


Uncomment the security line, and add another line to make it look like this:


security = user
username map = /etc/samba/smbusers


This will set Samba to use the smbusers file for looking up the user list.

Create a Samba User

There are two steps to creating a user. First we’ll add that username to the smbusers file.

sudo gedit /etc/samba/smbusers


Add in the following line, substituting the username with the one you want to give access to. The format is ubuntu-usuername = “username”. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.

joe = “joe”


Next, we’ll run the smbpasswd utility to create a samba password for the user.


sudo smbpasswd -a


Now you can create samba shares by right clicking in Nautilus and defining the share in properties/sharing.


Tuesday, 16 June 2009

How to install Filezilla3

Very simple, download Filezilla from http://filezilla-project.org/download.php?type=client

Then run these commands in a terminal where you downloaded the file to:

sudo tar jxvf FileZilla_3.2.5_i586-linux-gnu.tar.bz2 -C /opt/
sudo chown -R root:root /opt/FileZilla3/
sudo chmod -R 755 /opt/FileZilla3/

You may need to edit the first line to correct for version/name changes to the file you have downloaded, FileZilla works a treat ;)

Create a menu item next:

sudo gedit /usr/share/applications/filezilla.desktop

And add the following lines:

[Desktop Entry]
Encoding=UTF-8
Name=FileZilla
Comment=FTP Client
Exec=/opt/FileZilla3/bin/filezilla
Icon=/opt/FileZilla3/share/pixmaps/filezilla.png
Terminal=false
Type=Application
Categories=Application;Network;
StartupNotify=true

FileZilla can then be started from Applications → Internet → FileZilla.

Monday, 15 June 2009


How to read 20 magazines for free.


You will need Firefox and an addon called User agent Switcher and configure it with an iPhone setting :

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A102 Safari/419 (United States)

You can then visit http://zinio.com/iphone/ and read 20 magazines each month for free.

It gets better though, it is very simple to download these pages onto your computer using Linux, aren't you glad you dumped windows ;)

We now need the URL to the image so "copy image location" from the right click menu then using this command:

curl -O -A "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3" INSERTURL

Replace INSERTURL with the copied link you got to page 1, then delete back to the underscore and append [1-300].jpg this is a range option to grab pages 1 to 300 and can be adjusted, so the final command will look like this:

curl -O -A "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3" http://imgs.zinio.com/iphone/issues/416078746/[1-300].jpg

The files will need to be renamed, as sadly they won't sort correctly if you are going to do the next step of combining them into a single pdf. We need the jpgs numbering from 001.jpg so they order correctly. this can be achieved in a variety of ways, using Thunar rename to insert the necessary 0's in two stages is one simple way, insert 00 at position 10 for number 1-9, and insert 0 into postion 10 for pages 10-99. it can also be scripted in a couple of steps with :

for i in `seq 1 9`; do mv *_$i.jpg 00$i.jpg ;done

for i in `seq 10 99`; do mv *_$i.jpg 0$i.jpg ;done

This could of course be scripted into one single command using a bash script.

Then we can simply issue the command:

convert *.jpg magazine.pdf

Thats it, you now have a local copy of the magazine in a handy PDF format relatively simply, it lokos more complex than it really is once you get your head around it.

Thursday, 11 June 2009

Acer Aspire One update broke Wifi


Just updated my Acer Aspire One (Intreprid 8.10) and the wifi broke. A quick poke around and installed:

linux-backports-modules-generic

After a reboot the wifi sprang back into life.

Friday, 29 May 2009

Is your Nautilus slow to open directories?

Fix Naultilus slow loading some directories.

If nautilus is taking an age to load some directories on your computer then you may have Assistive Technologies enabled.

Simply go to the System menu on your desktop and then in Preferences. Click on Assistive Technologies.
Untick the box marked "Enable Assistive Technologies" and choose "Close and Log Out" at the bottom of the window.

When you log back in Nautilus should be opening directories instantly again. Apparently this became an issue in 8.10 when Assistive technologies was enabled by default, I only spent aoround 8 months suffering with this before getting off my backside and finding a fix, it is disappointing that there has not been a direct update to sort this out, there must be a lot of people stuck with this problem.

Wednesday, 11 February 2009

Disable IPV6 on Ubuntu 8.10

Disable IPV6 on Ubuntu.

Some people feel loading IPV6 can improve the network performance and if your ISP doesn't support IPV6 yet (which most do not) then it will do no harm to disable it.

sudo nano /etc/modprobe.d/blacklistappend the following line:blacklist ipv6

Save the file and restart your machine!
You can verify that ipv6 is actually disabled using the following command:

ip a | grep inet6


If you see no ouput then IPV6 is now disabled.

Tuesday, 10 February 2009

XFCE4 Automatic desktop wallpaper changer.


I recently started using XFCE on my Aspire One. I've always liked XFCE and alternated it with Gnome just for variety. Anyway using XFCE full time made me wish for a method to change the wallpaper every X number of minutes so after some hunting and poking this was the solution for automatic wallpaper changing.

First step is to define a list of wallpapers to use in the normal Desktop settings configuration, I'm notgoing to explain in detail how to do it, its fairly straight forward so go explore.

With that configured then XFCE will load a random wallpaper on each login, very nice but not quite what we want is it.

Well it turns out the solution is simply to reload the desktop on a timed interval. Cron takes care of the timed interval part, and the comand to call is:

export DISPLAY=:0; /usr/bin/xfdesktop -reload

You can try it in a terminal before putting it into a cron job. In case you aren[t familiar with cron it is just a case of doing:

crontab -e

If it is the first time you called it then it may ask you what editor to use, just use nano if available as its the easiest to use imho.

Enter this line into the editor:

0,15,30,45 * * * * export DISPLAY=:0; /usr/bin/xfdesktop -reload



Thank you to Ninjanoh who suggested in the comments that this will work in 11.10 by changing -reload into --reload




Ctrl + o to save the file, then Ctrl + x to exit nano.

The wallpaper should now change on the hour and at 15 minutes, 30 minutes and 45 minutes past the hour.