ieatpenguin

February 27, 2010

Mounting a network drive in Linux (Ubuntu)

Filed under: Linux,Software — Russell @ 12:54 pm

This is a very simple thing to do, it isn’t however as simple as one might think if you are coming from a Windows background, and are used to mapping a network drive from the Tools menu. As a note this is a guide for Ubuntu, although I have it working fine on both Ubuntu and Fedora, use the appropriate package manager/command line for Fed and the rest is the same.

First, we need to make sure that samba is installed:

sudo apt-get install smbfs

Next, we need to make a directory to mount the drive too. As an example, I’ve just reinstalled my Ubuntu (and Fedora) distribution, and so want to map the music drive on my server. I chose /media/ as the logical place to stick my network drives:

sudo mkdir /media/music

Next we need to tell the file system table where the drives are, and where to mount them. We also need to include our login credentials (will cover this later).

gksudo gedit /etc/fstab

Scroll to the bottom of the file and add the following:

#Mounting Network Drives
//SERVER/SHARE-NAME /MOUNT-POINT smbfs credentials=/credentials-file-location

To make the above make a bit more sense, here is my configuration:

//192.168.1.50/Music /media/music smbfs credentials=/home/russell/credentials.smbcredentials
//192.168.1.50/Videos /media/videos smbfs credentials=/home/russell/credentials.smbcredentials
//192.168.1.50/Software /media/software smbfs credentials=/home/russell/credentials.smbcredentials

What this will do is to check within the credentials file (more on this at the bottom) your username and password for your server (I am running a Windows Home Server as an example).

Next, we need to make the filesystem mount the drive, which we do simply with:

sudo mount -a

Finally, we need to make that credentials file. Simply navigate to your chosen directory (I stuck it in my /home/russell directory for ease), create a new file with the following information:

username=username
password=password

And save it with the same filename you gave the /fstab/. Thats it.

February 25, 2010

Denis Avey

Filed under: Random — Russell @ 10:18 am

This man is a hero in every sense of the word. Worth 5 minutes of your time.

February 24, 2010

EU Probes Google Antitrust Case

Filed under: Uncategorized — Russell @ 12:27 pm

This is long, long, LONG overdue.

I was going to write a few things, but this comment on the Times Website succinctly summed it up, so thanks to “I.M. Jolly”.

The difference between “do no Evil..” Google and Microsoft is, MS are a damn sight less hypocritical about their monopoly postion. And abuse thereof.

If the simple fact that “Google is rapidly increasing how much it spends on lobbying in the United States..” doesnt tell you anything, I dont know what else will – ok Google fanboys, you can now go back to your Google searches for everything, Your GMail with targeted ads based on the content of your mails and put your head back under the pillow. For the rest of us, I am sure we can agree that some scrutiny of a company which has basically won control of the internet, while gaining a very, very large amount of personal users data and their surfing habits, is entirely overdue.

Or, maybe, as the Google CEO (Eric Schmidt) himself says, “”If you have something that you don’t want anyone to know, maybe you shouldn’t be doing it in the first place..” – unless of course, that knowledge is personal details of his, obtained by CNET Journalists only via Google searches. Google blacklisted CNET for about a year over this, then again, they really do have to the power to be both evil and hypocritical, whenever it suits. The public have somewhat less choice in blacklisting which Information Google collects from them.

However, Google only use the info they have collected on YOU to sell ads, dont they? No problem there, then.

February 12, 2010

Rsync and Bash

Filed under: Linux,Software — Russell @ 10:02 am

Have had an interesting morning delving into Bash, on MSN with Jasper, which is not something I get to do often enough.

The upshot was a nice and fairly sophisticated rsync script to backup some files, which I won’t paste here as it’s Jaspers baby.

However, I did think up a [much] simpler script to enable a quick and dirty backup of any particular folder to any particular media.

#!/bin/bash
sudo rsync -av –progress –delete –log-file=/dir/$(date +%Y%m%d)_rsync.log /dir /media/dirBackup

You can of course exclude certain files from the backup with:

–exclude “/dir/.jpg”

Naturally, no one wants to type it out everytime and so lets make it into an executable script:

sudo chmod +x /path/rsync-backup.sh

So you now have an executable script you can call whenever you want, or you can of course create a cron job and have it run automatically.


Here’s a slightly more sophisticated backup script that revolves on a weekly basis, and then clears out any backups that are older then this.

#!/bin/sh
# directory to backup
BDIR=/home/$USER

# excludes file
EXCLUDES=$HOME/cron/excludes

# name of the backup machine
BSERVER=server

# password on the backup server
export RSYNC_PASSWORD=

# lets get down to it
BACKUPDIR=`date +%A`
OPTS=”–force –ignore-errors –delete-excluded –exclude-from=$EXCLUDES
–delete –backup –backup-dir=/$BACKUPDIR -a”

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin

# the following line clears the last weeks incremental directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
rsync –delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/
rmdir $HOME/emptydir

# now the actual transfer
rsync $OPTS $BDIR $BSERVER::$USER/current

February 2, 2010

Brandy & Thomas Tallis

Filed under: Random — Russell @ 9:49 am

I would like to have the right to die on my lawn with a glass of brandy and Thomas Tallis on my ipod.

Sir Terry Pratchett on the news this morning, regarding his desire for a tribunal to be set up to review “right to die” cases. Such a beautiful little sentiment that it brought a tear to my eye.

Powered by WordPress