Twitter Updates

Tuesday, 31 March 2009

Apple Student Discount

For the best students discounts on Apple products visit http://apple.procureweb.ac.uk/ from in side you educational institutions network. If they are registered you will see the lowered prices.

Saturday, 28 March 2009

Ruby list directory contents

Ruby listing directory contents:
Dir.entries returns the array,
Dir.foreach itterates.
#!/usr/bin/env ruby 

mycontents = Dir.entries("/")
mycontents.each { |x|
puts x
}

Dir.foreach("/") { |x|
puts x
}

Friday, 27 March 2009

Sony BDP-S350 Resetting Screen Resolution

I bought a Sony BDP-S350 Blu-Ray player a while a go, but recently had to return my Samsung A686 Screen and used an older lower resolution monitor. When first switching back to the older screen I got the error message this screen does not support this resolution aargh!

Any way I found the manual online

And you wait 30 seconds with out doing anything, this means that all the menus will have defaulted back to a known state. Then press and hold stop on the player (not the remote) for 10 seconds, then the player defaults back to the lowest resolution and your ready to go again.

Thursday, 26 March 2009

Ubuntu adding/archiving on to new hard drive

So you just got a new bigger hard drive and want to use it to replace the main storage device on your Ubuntu Linux server, or just add the extra storage to it.

First powerdown (may not be necesariy with SATA) connect new drive and power up.
loggin and get to the terminal.

Find out the new device name, likely to be some thing along the lines of /dev/sdb
$ sudo fdisk -l
----
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sda1 1 121601 976760032 83 Linux

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe53eaeaf

Device Boot Start End Blocks Id System
/dev/sdb

Not Formatted
----

It is the unformatted drive that we had to look out for.
Next Creat a partition table, It is a storage device so only want the one partition.

$ sudo fdisk /dev/sdb
press n to create new partition choose primary, the defaults should be good for use the full disk.
press w to save changes to disk.

This has created partition /dev/sdb1, which requires formatting for ext3 do:
$ sudo mke2fs -j /dev/sdb1

Creat a point to mount it, I only want this to be temprorayt but if it is for permenent installation choose the names carfully.
$ sudo mkdir -p /mnt/insertHostName/tempdrive

Mount it (One off)
$ sudo mount -t ext3 /dev/sdb1 /mnt/insertHostName/tempdrive/

To mount the drive on sytem restarts do:
$ sudo vim /etc/fstab
added this line
/dev/sda1 /mnt/hostname/partitionname ext3 rw,auto,async,errors=remount-ro 0 1
then reload the fstab (mount the new drive)
$ sudo mount -a

Now start the Archiving process (Copying the files from old drive on to new).
The -a flag is very good for this it will Recursively copy maintaining permissions, Access dates and recreate links.
$ sudo cp -a /mnt/insertHostName/oldDrive/* /mnt/insertHostName/tempdrive/

once the copy is complete you can compare the space used available using:
$ df -h
>Filesystem Size Used Avail Use% Mounted on
>/dev/sda1 925G 866G 12G 99% /mnt/insertHostName/oldDrive
>/dev/sdb1 1.4T 866G 451G 66% /mnt/insertHostName/tempdrive

Wednesday, 25 March 2009

Get those pesky .DS_stores off my network

Mac OS X has a very annoying habit of creating a .DS_store file in every folder it visits.

This is very annoying in a mixed OS network. So to disable this behaviour for remote drives (Samba, ftp, webdav) you can just enter this at the command line:
$ defaults write com.apple.desktopservices DSDontWriteNetworkStores true

To get at the command line (Terminal) you find it in /Applications/Utilities/Terminal.app

Beware though that it is the .DS_store that finder uses to decide on file location when in grid view and stores the notes on files in there as well. So these features (Notes and rearranging the icons) will be reset every time you leave the folder.

Sources 1 2

Why put a laptop drive in a desktop pc?

This is a follow on from my Low Power Server recommendation

Why do I keep talking about laptop drives:
A laptop drive in a fully active Read/Write state uses only 3 watts and can idle at less than 1Watt and when it spins down is next to nothing at all, and has ten times the life span of a desktop drive in terms of spin up/down toggles, but they are a lot more expensive per GB than a standard 3.5" desktop drive.

So extending the life of your server drives, getting better value for money and saving power can be reached by combining the 2 types of drive.

The bulk of your storage should sit on a 3.5" desktop drive, cheap storage. The server should spin down this power hungry drive after it has not been used for some thing like 1 hour, this ensure it is not spinning up/down all day, but saves loads of power when inactive for periods of time (You go to work and sleep at night, don't you?).

The Operating System should live on a 2.5" laptop drive which will be on for most of the time (because of writing to log files) but could handle a really short spin down inactivity time if you wished. This greatly reduced the idle power of your PC, assuming that you used a low power mother board and cpu.

Power Dissipation of laptop drive from Western Digital
Read/Write 2.50 Watts
Idle 0.85 Watts
Standby 0.25 Watts
Sleep 0.10 Watts


Power Dissipation of desktop drive from Western Digital
Read/Write 6.00 Watts
Idle 3.7 Watts
Standby 0.80 Watts
Sleep 0.80 Watts

Tuesday, 24 March 2009

Low Power Server Recommendations

Every one needs a low power server, my current recommendations are:

Option [1]
If you only require a Network drive this is a really good (cheap/simple) option (it does include some basic server functionality)
Icy Box Dual Disk with Gigabit NAS £100 http://www.scan.co.uk/ WikiSupport

Option [2]
However if you require custom services (Squeeze box, etc) then building your own is a good option:
Some thing based on an atom in a mini-itx form factor like: Jetway JNC92 £105
As much DDR2 memory as allowed (mini-itx often limits to 2GB)
Note: DDR2 is much more power efficient than the original DDR standard.

2GB DDR2 533MHz for the Jetway JNC92 is about £25

A cheap case like this from ebuyer would look reasonable for £25

I also installed Ubuntu on to an 8Gb USB flash drive for about £20. For wear and tear next time I would just use a laptop drive (£35 for a 120 GB or £50 for 320Gb), which could host the always on server parts like websites, torrents, ftp etc. and let the main storage drives spin down. If you are planning on this with only 2 sata sockets available you may want to put the laptop boot drive on a usb interface (£8 ebuyer, cant find summvision device)

Note:
I spent about £100 on a Jetway C7 1.2GHz J7F2WE1G2E not realising it could not take the Jetway expansion cards. As they make a very nice 3Socket 1GBit LAN Card. Turning your machine into a low power Gigabit switch as well (if you configure the OS to bridge the interfaces).

Option [3]
A nice alternative to putting together your own itx machine is the BBS2 for around £380 with the 2G RAM upgrade and VAT. Although 1 Drive must be the Operating System and since it uses its own mounting system low power 2.5" laptop drive can not be used for this task. It can then be set up with hardware raid on the remaining 4 channels, but Software raid is pretty good on Linux and Windows Home Server (Apparently)

The only really advantage of this over building your own system is the 5 Drive bays and Shiny case, which comes at a real price. Not forgetting if you built your own itx system you can easily add external usb drive to it, or get it to mount and share additional NAS drives like [1] or put in a large case and get some thing like this 12 port sata controller £600 or a 4 port sata controller £75

Note: The case recommended in [2] only has room for 2 hard drives using Raid1 or adding extra capacity the bootable drive if separate from the storage would have to be external.

Again the drive could be external in [3] if you wanted to use a laptop drive in 3.

Follow Up Post
Why put a Laptop drive in a desktop?