Xi6.org

Archive for July, 2009

Apple Iphone Shuffle not random

by on Jul.20, 2009, under Uncategorized

As the topic says it all… the shuffle or random mode in the iphone (or maybe even the ipods in general) are not random! You’ve noticed the same songs play in the same “random” order.. annoying I know.

I remember creating a random number generator back in school (in the C programming language), but to my surprise the rand function wasn’t actually random! Maybe the first time around it seemed random… but it was the same random every time you ran the program. You had to custom code the random to be truly random.

So I’m guessing there are just some lazy programmers working at apple that can’t write a proper shuffle program.

Though recently I’ve heard people say that it shuffles the entire play list when you start up (power on) or whatever… which may be the case… but that is also a very poor way to do it!

No one turns their phone off very often or at all if its not necessary. I leave my phone on until it starts to bug out and lock up.

I want my shuffle to be random for each song! wow that would be great! A shuffle program the way it’s expected to be? Whaatt? no way!

Most of my older mp3 players (and hell, even my portable CD player and car) have this button called “random”. When I press it, a random song plays. When I click “previous”, a random song plays, when i click “next” a totally new random song plays! It’s a surprise every time! I love it!

But unfortunately with the apple iphone I press back and it plays what I just listened to (ok not horrible)… but when i press next, i feel like i know what song is going to play next… and I do… and its sad.

I only have a modest library of around 1,000 songs on my iphone. But unfortunately every day I listen to the same hundred or so damn songs over and over and over. It’s annoying that I can’t get any variety in my ipod!

I’ve resorted to closing my eyes and picking songs from the song list with a few flicks up or down beforehand. It’s a better random than the iphone provides that’s for sure.

Update – Nexus One:

I’ve recently switched to Googles Nexus One phone and found the shuffle on this device works absolutely fantastic! I have the same songs, yet the listening experience is easily 2-3 times as good!

When listening to music, you can easily turn shuffle on or off from the currently playing song. (No need to go back a menu or two in, scroll up to the top of the list and select “shuffle”). Nexus One’s shuffle is right on the screen that’s displaying the current song; along with the option to repeat current song, or continuously loop your playlist.

Pressing the back button on the track, brings you to the last listened track (and pressing it again brings you to the track you listened before that one). Now at anytime you press “next”, even if you pressed the back button, it provides you with a RANDOM song! Imagine that! The people at google sure got this right.

It’s funny, while I have the same few hundred songs, I’m listening to ones I haven’t heard once on my iphone… wow :)

The nexus one media player also has the ability to drag a slider back and forth and skip to whichever section of the song  you wish! Very cool. The only thing it doesn’t do out of the box is display the currently playing song on the lock screen. (Not a huge deal, and I’m sure there’s a widget for that).

3 Comments :, , , , more...

Software RAID Ubuntu 9.04 Linux

by on Jul.16, 2009, under linux/ubuntu

Setting up software RAID is “fairly” easy. But first you must install the ALTERNATE installation CD for Ubuntu. (CentOS is pretty straight forward when you select “manual partitioning” in the GUI installer on the regular ISO).

Once you download and burn the alternate ubuntu ISO for your cpu architecture, boot it up on the machine you want to install. (Note: this will erase data on the drives, so make sure no external drives are connected, or any drives in the system you don’t want raided).

During the install, when you come to partitioning, select manual and delete the partitioning tables that currently exist on your drives so that each drive has “FREE SPACE” as the only option under the device.

I’m going to be setting up RAID5, which in my opinion is the best balance between performance and redundancy. (This box is going to be a media server / backup / desktop with three TB drives).

Now for my first device (HD) I’m setting up 3 partitions, (boot, root, and swap). I create the first primary partition of 100MB at the beginning of the drive and set the “use for RAID” where you might normally select ext3, boot, swap etc.  Also be sure to add the boot flag to this partition.

The second partition I setup as logical 6GB and “use for RAID” selected here as well. And the third I set the remainder as a primary partition and “use for RAID”.

I repeat these partitions on the remainder of the 2 drives so each of the 3 drives have identical partition tables.

Next we’re going to select “configure software RAID” that is at the top of the menu, and create a new MD (Multi Disk) device.

Keep in mind we have 3 partitions per disk, totalling 9. So we will have to create 3 MD devices in order to raid each partition.

Creating the first MD device we select RAID1 (mirroring) for the boot partition. This will allow the system to boot properly. (This single raid 1 is very important to our system functioning).

For number of active devices, we type in 3. And 0 spares. Selecting /dev/sda1, /dev/sdb1, and /dev/sdc1 in the device list.

We will repeat creating an MD for each “set” of partitions. (for a total of 3 times). But these subsequent partitions will be RAID5.

You will be presented with RAID MD devices showing up on the partition overview. This is when we will set these partitions to EXT3, SWAP etc…

The 100MB raid1 partition we will set up as EXT3 mounted at /boot. This raid1 will allow the system to boot and not throw a grub error 2 at us.

The 12GB raid partition will be set up as SWAP

And the 2TB partition will be set up as EXT3 mounted at root /

Once we have those set, we finish and write to partition table. It’ll format the drives, sync the arrays and install the OS.

After that’s all said and done it’ll want to reboot. And we’re finished!

5 Comments :, , , more...

GRUB Error 2 Ubuntu 9.04 RAID

by on Jul.16, 2009, under linux/ubuntu

After installing software RAID, or perhaps for some other reason – you’re presented with a system that cannot boot properly. In my case, I installed a RAID5 Array and was presented with a GRUB ERROR:2 on boot.

GRUB Error 2 is basically “Selected Disk does not exist“.

Which likely means that grub is pointing to a disk or device that is either not recognized or as stated, doesn’t exist. It may be pointing to (hd0 0,1)  instead of (hd0 0,0) or whichever missconfig. In my case with the newly installed RAID, it’s likely the issue of GRUB being non-existant on subsequent disks, or not mapped properly to the MD array.

To fix this error after a RAID install, I had to go back in with the alternate installation CD and modify my RAID on the /boot partion (100MB).

Instead of this being a RAID5, I changed it to be RAID1 (mirroring) instead. So instead of 1 drive having the pairity value, the 3 drives now have an exact copy of the static boot files. We’re now able to boot our system!

Otherwise you may have to manually edit GRUB and change the device it’s trying to boot. (Such as mentioned above where it may be trying to boot into hd0 0,1 instead of hd0 0,0)

1 Comment :, , , more...

Migrating Virtual Machine (VM) FROM esx to xen server

by on Jul.09, 2009, under linux/ubuntu

There seems to be a lot of posts and resources on how to migrate the other way around – but WHY?! Why would anyone want to migrate from Xen to ESX? I’ve had so many issues with ESX I’m spending thousands to create another server and migrate TO Xen!

At the time I needed a relatively quick deployment of a server which I could easily manage virtual machines etc. (Well ESXi seemed like the answer). With only about a week to get the hardware, install and send off, I managed to get it working (I can’t say installation was that easy considering the limited hardware support ESX offers).

Needless to say, after deployment I was noticing VERY poor disk performance. (Yes I installed vmware tools and all that garbage). I tweaked, re-tweaked, re-installed virtual machines, resource pools, etc etc… weeks and months go by trying to fix the piss poor performance. No one on the community forums could help – It seems everyone is running windows guests and suggesting a bunch of stuff that would never make a difference anyways. If i’m getting crappy performance with freshly installed Linux guests, something is wrong with the hypervisor (ESXi).

In any case, I can’t take it anymore – ESX has to go! Reluctant to spend another $3,000 in order to mirror the server (extended downtime to rebuild is not an option). Plus the fact that on ESX I had to install a VM specific to being the firewall for the machine. Why ESX doesn’t have iptables or any firewall/routing built in is beyond me. It’s very insecure without adding additional overhead with another virtual machine appliance.

So while I build a new server and install Xen, It’s so much better! WOOWWW! Not only does it have better features, the performance is about 4x better! I love being able to “template” a VM of a base install, then deploying it quickly and easily as a new machine. The performance is near native (I can’t tell the difference opposed to if it was a single server installed on bare hardware). Where as with ESX, I could notice the sluggishness.

Now onto the main point of this article: Converting a VM from esx to Xen!

This portion coming soon – please leave a comment if you’d like it sooner than later.

1 Comment :, , , , , , , , more...

Subversion client is too old to work with working copy ubuntu linux

by on Jul.05, 2009, under linux/ubuntu

Likely you have tried to do an an svn command on your working copy and it’s giving you the following error:

svn: This client is too old to work with working copy ‘.'; please get a newer Subversion client

Initially I had thought it was a version miss-match with how the repo was checked in, or the server client the repo was hosted with. But it just so happened that I had checked it out with a newer version initially, and then moved it to another box that had a lower subversion client.

In any case, doing a fresh checkout (svn co) on my working copy solved this issue for me. But you may also update your subversion client.

Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...