Monday 31 December 2007

Fair play & iPod syncing

So in my last blog, I left issues 3 & 4 for a future time.

Well, that time is now, along with trying to sync files to my iPod as a USB-MSD, some tinkering with my desktop and a quick review of Flock.



That thing I mentioned, was so simple to use. Check it out.

So back into Ubuntu, now I've imported all my music into Rhythmbox, and re-subscribed to the Podcasts I like. It's such a simple interface, just click and drag. No need to sync, which I think is brilliant.

Another really cool thing about Rhythmbox is that you can listen to the songs that are on your iPod without transferring them over to your computer.

Also, it just pops up when you plug your iPod in, which is nice. I know iTunes can do that too, but Rhythmbox doesn't consume all the RAM you can throw at it.



Then I wanted to know if there was a way of copying over files to my iPod (as a HDD) quite quickly, as I like to have some start-ups and other t/s programmes on there in case I'm asked to look at something at someone else's place and there's no inet connection.

So I've got a 10GB partition on my computer purely for the use of stashing files I'll want on my iPod. This also includes photos I take to work for screen savers and such...with plenty of room spare.

So essentially all I want to do is back up my folder on the computer:

to the folder on my iPod:

/media/SID'S IPOD/Non Ipod Stuff

But I don't want to spend ages doing it, and really all I'll ever want to do is update what's on the iPod.

So I did some digging around, and found this place, and although I couldn't get the terminal line version to work for me, I assume because I'm not too sure how to cope with spaces in directory names, I d/l the GUI one through Synaptic, just search "grsync" and its the only thing to show up. It's really easy to use, and in a matter of minutes, the files were copied over. Also, it saves the session, so next time all I've got to do is click "Execute". Why it shows up under "Applications - Internet" I'm not sure, but hey, it does what I want it to.

Now I just need to figure out how to write a script that sets it up so the files sync on iPod connection. I'm sure it's possible, but that's for another night.



I've done a bit of appearance tweaking with my desktop:



The icons on the bottom are just links to (from left to right)

Music partition, My Rubbish (photos, videos, documents) partition, Spare partition (for whatever fills up first), My iPod files partition, My Windows partition, the Terminal and a "Drawer" (the mouse icon), that had links to Flock and Firefox in it. Next to those is my active windows bar, and then that the Recycle bin on the far right, with the Desktop switcher in the corner, I just re-configured it to show in two rows on the preferences.

A quick thing about the drawers, you can add drawers onto drawers...which leaves you with a kind-of windows situation.

Here's what it looks like with the drawer open (single click):



I moved the "Show Desktop" button to the top left corner, and got rid of the default buttons that are normally the other side of "System".

The great thing is, I didn't even need to d/l anything to get it looking like that. I just edited the preferences that come with GNOME.

I'm totally impressed with the ease of which the Panels go transparent, and I might mess around even more with the top panel. The one thing I am disappointed about is the fact that the windows don't overlap the panels, in that I can always see the panel. In my travels I'll have a mess with them, and might even d/l something else, but with my rig, not a lot will run, as I'm limited to "No Effects" under the standard graphic effects options.

Oh, all the icons came from the sub-directories of:

/usr/share/icons/gnome/scalable/


Now what is cool, as with these being scalable, if I make the panel bigger, the icons automatically stretch.

Yeah, I'm like a little kid with a new toy, but who cares?! I'm geeking out supreme, and loving it.

Oh the background photo is one I took with a friends camera shortly after he got it. We went out one night, and I had a few goes with it. I like it.



Flock has turned out to be quite a nice browser. It's based on Mozilla, the browser Firefox is a descendent of, and to be honest, apart from one or two plug-in issues I've had (that I couldn't be bothered to fix with the mix of Ubuntu OS and Flock Browser), it's completely replaced Firefox. On install it gives you all the options of copying over your favourites, and passwords from you current browser, and it has some pretty cool features.

It's helped write this blog. It's got an inbuilt clipboard that shows up on the left pane, and you can drag anything to it, photos, videos and words, and then just drop them in your blog. It's got a built in feed-reader, and a thing that keeps me up-to-date with facebook, YouTube, Flickr and Twitter at a quick glance. My only gripe is the lack of Myspace monitoring, but maybe with time it'll be added? It's cool. Check it out.



So yeah, I leave myself with two things I'm going to attempt to change in Ubuntu now.

1) Trying to write a script to update my iPod Files (that separate partition) every time I plug it in.

2) See if there is a way to make the windows sit above the panels.

Also, I might install Linux on my iPod as well.

This is my kinda DIY... :)





Sid.

Ubuntu 7.10...

So recently I've been playing around with Ubuntu 7.10, a Linux distro (and what I'm referring to when I say "Linux" for the matter of this blog) which comes with native support for read and writing to NTFS partitions. That is, a Windows partition, essentially.

Now on install it uses more RAM than XP does, but once installed, which isn't a very long process, it runs smoothly on my machine, which is a mish-mash of stuff I've scored for free, so I was, am, well impressed.

It does however need a few things doing to it before it's all plain sailing though.

1) The NTFS partitions you "mount", disappear on re-boot. This is fixable (see below.)

2) Media Codec's. This is fixable (see below.)

3) iPod functionality? I've not put my iPod into my machine while running Linux yet, but I shall shortly, and I'll report on what I needed to do, if anything, to get it to work. I have already downloaded (d/l) some programs for when I do eventually get round to remembering my iPod...

4) iTunes purchases that'll work outside of iTunes, as Apple won't release a Linux friendly version. (More below)



(1) Now I had been trying to sort this out over the past few days, so it might be quite this easy, as the /media/ directories were already there, and I just used them, but as they were the default /hda1 names, I assume Linux puts them there automatically? If not some research on how to create media directories is needed. I did a quick google search before writing this, to see if it was possible or if I was being silly, but it turned up no results. It was a quick search bare in mind. I was being a Muppet, after right clicking the folders in the "/Media/" area, I noticed only "Root" could create and delete things, so I just used a "sudo mkdir /media/test" command to create the desired folder, in this case it was called "test".

Right, so the tools you'll need:

A bit of preparation work is needed first.

It's handy if your drives have all got volume labels, something you can easily do in Windows, by right clicking a drive (aka a partition) and selecting "Properties" and then filling in the name.

Now boot into Linux, and we need to find your media section. Click on "Places" on the top bar, now click "Computer". There you get a summary of all the different partitions on your computer. At the top should either be a text box with "computer:///" in it, or a button that says "Computer". If it's the later, press the icon (pen & paper) to the left of it, so it shows the above. Now, select that and delete it, and type in "/Media/"
You'll see some folders, you should have "cdrom" and "floppy".

Now to create the folders your drives will be using to mount to.
Now you'll need to create the folders you'll want the partitions (or hard drives) to "mount" to. I'd just use easy to remember names, like the volume labels.

For examples sake, we've got 4 partitions that need mounting each time you boot, and you want to read and write to all of them. And we don't know what file systems are in use.

In Windows, they are C: "Windows", D: "Music", E: "Photos", and F: "Misc". The "word" is the volume label.

So now in the terminal, we're going to create the following folders in the /media/ directory, to reflect the volume label, to keep things simple.

So, we open a terminal (Applications -> Accessories -> Terminal) and type in the following different lines, each on they're own, not all together. I'm not sure if Linux can deal with batch commands, so we'll do it the way we're sure of...






sudo mkdir /media/windows

sudo mkdir /media/music

sudo mkdir /media/photos

sudo mkdir /media/misc

Now on the first go, you'll be prompted for an admin password (your login password), and it will remember it for that session, so just enter it, and then carry on.

Quickly explaining the syntax, or what you just typed in (or if you're really clever copied (Ctrl+C) and pasted (Shift + Insert)), the "sudo" means "Super User DO", or if you like, the System Admin says it's ok to do the following, which is why it prompts for a password. The next bit, mkdir, is simply telling Linux to MaKe a DIRectory, or a folder, at the location ("/media/misc") you specify.

Right so now we have the folders for the mount points, now we need to know a bit more about the machine setup, and we'll be altering a file.

Now we'll need another terminal open, so that's two at the same time if you've already closed that one we just used. In the second terminal we're going to have a look at the partition layout, to find out what Linux is calling your drives. Also, we'll use the other one to show what volume labels tie to what Linux is calling them.

So in one of the terminals, type in:



sudo fdisk -l

(that's a lowercase "L" btw)

This will now have a list of your partitions. Looking something like this:



Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1ea41ea3

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3296 26475088+ 7 HPFS/NTFS
/dev/hda2 3297 4793 12024652+ 83 Linux
/dev/hda3 4794 4865 578340 5 Extended
/dev/hda5 4794 4865 578308+ 82 Linux swap / Solaris

Disk /dev/hdb: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0917942c

Device Boot Start End Blocks Id System
/dev/hdb1 1 2550 20482843+ 7 HPFS/NTFS
/dev/hdb2 2551 3825 10241437+ 7 HPFS/NTFS
/dev/hdb3 3826 4997 9414090 7 HPFS/NTFS

Disk /dev/hdd: 8455 MB, 8455200768 bytes
255 heads, 63 sectors/track, 1027 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x167e79e1

Device Boot Start End Blocks Id System
/dev/hdd1 1 1027 8249346 7 HPFS/NTFS


Now this tells us what Linux is calling all the partitions. You see, the above is a snapshot of my machine, and it tells you I've got 3 hard drives, the sizes of them all, the number of heads, sectors, etc etc, and then it lists the partitions on each one below it, under the "Device Boot Start End Blocks Id System" line.

So you see I have 5 NTFS partitions, 1 Linux partition, 1 Extended partition and a Swap partition. For our earlier example, the screen would look more like this:




Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1ea41ea3

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3296 26475088+ 7 HPFS/NTFS
/dev/hda2 3297 4793 12024652+ 83 Linux
/dev/hda3 4794 4865 578340 5 Extended
/dev/hda5 4794 4865 578308+ 82 Linux swap / Solaris

Disk /dev/hdb: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0917942c

Device Boot Start End Blocks Id System
/dev/hdb1 1 2550 20482843+ 7 HPFS/NTFS
/dev/hdb2 2551 3825 10241437+ 7 HPFS/NTFS
/dev/hdb3 3826 4997 9414090 7 FAT3


Now in the other terminal window we need to type:



ls /dev/disk/by-label -lah

Again, lowercase "L"'s, just copy (CTRL + C) and paste (Shift + Insert)

Which now lists the devices, with the volume labels highlighted. Example below:



total 0
drwxr-xr-x 2 root root 140 2007-12-27 21:12 .
drwxr-xr-x 6 root root 120 2007-12-27 21:11 ..
lrwxrwxrwx 1 root root 10 2007-12-27 21:12 Photos -> ../../hdb2
lrwxrwxrwx 1 root root 10 2007-12-27 21:12 Music -> ../../hdb1
lrwxrwxrwx 1 root root 10 2007-12-27 21:12 Misc -> ../../hdb3
llrwxrwxrwx 1 root root 10 2007-12-27 21:12 Windows -> ../../hda1


Now we can match the four volumes with the info we'll be needing shortly to edit the file Linux uses to mount drives on boot with.

So with those two screens we can work out that:

Windows = an NTFS partition = /dev/hda1
Music = an NTFS partition = /dev/hdb1
Photos = an NTFS partition = /dev/hdb2
Misc = a FAT32 partition = /dev/hdb3

So now armed with that info we're ready to start configuring files like pros. So back in a terminal window (it doesn't matter which), we type:



sudo gedit /etc/fstab


Which will open the file "fstab" in the "etc" folder with the application Gedit (a text editor like Notebook in Windows).

Now it is very important not to mess with any settings here, and you might want to save this current version as a back up, through the "Save as" function under the "File" menu. That'd be clever, just in case.

So, we've backed up, and re-opened the file through the terminal with:



sudo gedit /etc/fstab


Now we need to add our four drives to the mount on boot order.

To do that we enter the following four lines:



/dev/hda1 /media/windows ntfs defaults 0 0
/dev/hdb1 /media/music ntfs defaults 0 0
/dev/hdb2 /media/photos ntfs defaults 0 0
/dev/hdb3 /media/misc vfat defaults 0 0


Now it's important to get the spacings correct, so they line up with the information already there. To do that in the file, just press tab, and it lines the next column up automatically, so you might need to retype the above. For more info on Fstab click here.

Now click save.

Now, back in the terminal window, type in:



sudo mount -a


This refreshes the fstab file with Linux, and now your four "Drives" should appear on your desktop, just move them where you'd like them and your sorted. Now close all your open windows and carry on.



(2) The prompt to download appropriate codecs comes up when you open files needing them. Just follow the on screen instructions and you're soon away watching your files.



(4)There are two ways, I believe, of doing this. One is to use a Linux program, called Wine, that simulates a Windows environment, and then an early iTunes version can run on top of that.

To be honest though, that just sounds like it's going to munch the small amount of RAM I've got, so this second method is the one I'll be trying, when I can be bothered to re-enter Windows at home.

The second method compromises of a program that copies the unencrypted data on its travels to the sound card, and re-encodes it into an MP4, I believe. There is a program for d/l here and once I test it I'll let you know what I think.
Or not, cus that's naughty...apparently.



Sources:

Ubuntu 7.10 "Gutsy Gibon" Wiki
Wine Review
QTFairUse Wiki (Hymn Project)
Hymn Project
Linux commands
Mkdir command listing
Unbuntu Forums. There is a script about, but it didn't seem to work for me. With hindsight, I could've just edited the fstab file...
Ubuntu page, where said script is located.
The first suggestion in this thread led me to editing Fstab to achieve this outcome, along with the Fstab wiki
Better understanding of Fstab here...




I realise I went into quite simplistic mode, but I feel this is what the Linux community needs if it's ever to grow to a credible size and stature in the modern world.

The truth is, it's a better O/S than either of the two main ones people know, Windows and Mac, but with a bigger audience it has the potential to be even better, seeing as how openly customisable it is. It could be as much as you want, or as little as you want, and the easier we make things for the "average person" the further ahead the community will leap.

Anyway, I feel I've accomplished something!! woot!!2





Sid