Christian Biggins Design, Technology, SEO, General Ramblings. Something for everybody.

7Dec/094

Upgrading jailbroken iPhone – the no bullshit edition.

Why do the guys behind jailbreaking iPhones need to make their information so difficult to understand? More people would jail break if they knew how easy it was to do.

For the record, a jail broken iPhone (or iPod Touch) is one that can install software from sources other than iTunes. This has many advantages that I will not go into now.

I jail broke my iPhone initially with firmware 3.0.1 when I was convinced to do so after seeing a mate at work do it so easily and what it enabled him to do on the iPhone, I was still dubious about it but after I had done it, I never looked back.

Apple has released several updates to their firmware since then and they keep trying to stop people from jail breaking, which means that there is a lot of conflicting information on the net about what can and cannot be jail broken. For that reason, I left my iPhone on version 3.0.1. That was until today. Today I spoke to a guy at work (new work, new guy) about jail breaking as I didn't want to lose all my stuff if I upgraded my firmware. He told me about 'aptbackup' which backs up all the info on your jail broken apps installed through Cydia to a directory that is backed up by iTunes so you can easily restore your app's once you re jail break.

My concerns were;

  1. Loss of music
  2. Loss of pics
  3. Loss of apps
  4. Loss of jail broken apps

Here is the no bullshit way to upgrade to 3.1.2 and jail break;

  1. Install aptbackup from Cydia
  2. Open aptbackup and backup the iPhone (only takes a second)
  3. Backup your phone using iTunes (right click your iPhone on the left and select 'backup')
  4. Copy all your pictures over (I sync'ed them using iPhoto, but you can copy them over using windows explorer too)
  5. Open iTunes and upgrade to 3.1.2 (If a later version is available then do not proceeed!! Odds are, Apple has closed the hole in any later version, I cannot guarantee that these instructions will work on a later version!!!)
  6. Download blackra1n and run it - it will jail break your phone in about 15 seconds.
  7. Open the blackra1n app on the iPhone and choose to install Cydia
  8. Once installed, run any updates available
  9. Install aptbackup
  10. Open aptbackup and hit 'Restore' - this might take a few mins depending on how many apps you had

All done!

As a side note, I had 'categories' installed on my iPhone and this caused a lot of problems when aptbackup restored it. My app's were there but unusable, after hours and hours of attempted recovery, I had to delete the apps through ssh and then re-install them. My recommendation is to remove categories before using aptbackup and then install it afterwards.

Hopefully this helps, please ask any q's you might have.

22Dec/086

What happened to all my hard drive space?

Recently I was trying to upgrade using Yum on my Fedora 9 machine and I got an awful message that I did not have enough space to complete the upgrade. What the hell? My / partition has a huge 10GB, how can this be so?

[root@Garth Download]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             9.5G  8.7G  312M  97% /
tmpfs                 722M   80K  722M   1% /dev/shm
/dev/sda4              17G   12G  4.2G  75% /home
/dev/sda1              28G   25G  3.1G  90% /mnt/Winxp

As you can see, my laptop has a 60GB hdd, so I am consistently having this argument with it.

The problem with most command line utilities is that it is difficult to see what you have installed and how much space each has. Then I remembered a little script that I used a few years back that told me what RPM's I had installed and how big each was. Eureka! Just what I need.

So, I had a little fun, did a little search and found the beloved rpmhogs script.

Check this out;

[root@Garth Download]# perl rpmhogs.pl
  246,007,784  java-1.5.0-gcj-javadoc-1.5.0.0-21.fc9.x86_64
  246,902,300  java-1.6.0-openjdk-javadoc-1.6.0.0-0.13.b09.fc9.x86_64
  231,068,455  openoffice.org-core-2.4.1-17.4.fc9.x86_64
  114,684,216  texlive-texmf-fonts-2007-22.fc9.noarch
   91,189,935  glibc-common-2.8-3.x86_64
   87,927,623  compat-gcc-34-c++-3.4.6-9.x86_64
   84,367,402  git-1.5.5.1-1.fc9.x86_64
<snip>

How good is that? I love it. Now I need to uninstall a crap load of stuff I dont use.

And, yes, my Laptop's name is Garth. My media PC is named Cassandra and my wifes laptop is named Wayne. Who can guess my theme?

24Nov/084

The common grep –exclude problem

grep is a file content searching tool for Linux. It is loved by programmers for its ease of use and swift search results (with customisable output). For example, if you forgot where you left your debug code, you can quickly display a list of the files that contain the code like so;

grep -ril 'var_dump' *

But, the problem with grep is that it is not possible to limit the subdirectories it searches within based on a pattern. A lot of people misunderstand the "-exclude" option, thinking that they can stop grep from returning results from SVN directories using it like so;

grep -ril --exclude=".svn/*" 'var_dump' *

Little do they realise that exclude is for file names only and grep has no functionality for restricting search based on directory names. grep can invert the found rows and only show the non-matching lines using the '-v' parameter and can remove the .svn directories but it is very slow;

grep -ril "'var_dump' * | grep -v svn

So, in comes ack. ack is much faster than grep (it uses perl regular expressions) and searches recursively and ignores revision control subdirectories (.svn) by default. Also, it displays the found code in a much easier to read format (if you opt to display the lines as opposed to just the file names);

ack To make things easier, ack is available in a lot of repo's for different Linux distributions.  I was able to get ack this easily;

sudo apt-get install ack

Done. Its also available as a perl script incase you cannot install it due to dictator sys admins (you know the type.).

If you code and use grep for your line-level searching, do yourself a favour and get ack.

21Nov/080

ER Diagrams from SQL files

A lot of people these days use graphical clients for creating their database schema's and therefor start with the Entity Relationship diagram and then have it generate the SQL for them. I prefer to write SQL directly as I seem to have an ongoing misunderstanding with most graphical clients but then I would need to somehow create an ER diagram for the SQL I wrote and this meant I'd double up on work a little bit. Today while searching for another application to do just what I want (and not cost me a cent) I found a post about something that will be extremely handy.

SQL Fairy SQL Fairy is an ER Diagram creator for Mysql and other databases but uses the raw SQL files and includes relationships (like foreign keys etc).

Sample Schema Its not perfect by any means, but its easy and gives a great representation of the database relationships. The lines representing relationships actually go over the tables which is a bugger and as it outputs directly to an image, you cant edit it. But, for a quick and easy ER, its bloody good.

As noted in the post I found this little gem at, its super simple to install and use, particularly if you are using Linux. I am on Kubuntu (for the record, my distro of choice is Fedora) and installed it as easy as this;

sudo apt-get install sqlfairy

Then, to generate the diagram was as easy as this;

sqlt-diagram -d=MySQL -o=sample_schema.png schema.sql --color

Unfortunately, it did fall over when my schema contained a SOURCE within the SQL, but apart from that it was quick and simple enough for me.

Now, if I can find an app that does the same thing but allows me to edit my ER first and give me multiple saving options (XML, SQL, etc) then I'd be extremely happy.

sqlt Man page
sqlt-diagram Man page

EDIT: About a year ago, MySQL released an application named 'Workbench' for this very purpose. An ER diagram program with reverse engineering capabilities from .sql files. The application was used by me on Windows for a while before a Linux friendly version was released. But, when Sun bought MySQL earlier this year, they made most of the MySQL applications commercial and were charging for licenses. Thats why Workbench was not mentioned above.

I am pleased to announce that it appears Workbench is free for download again. More information on Workbench can be obtained at its website.

This is the same schema as the above diagram done in Workbench using reverse engineering from an SQL file.

workbench MySQL Workbench

20Nov/082

‘The Bird’ cursor

About a year ago I came up with a funny idea to replace the finger cursor on links to a slightly modified version that I like to call 'The Bird'.

I drafted my friend Lauren to do the work as I am not as useful behind a Photoshop enabled pc as she is.

Anyway as I am not using the cursor (I will put it as a mouse cursor on one of my sites at some stage), I feel it is wasting away. So, I present to you, my loyal readers, 'The Bird'.

The Bird

Its as beautiful today as the night it came to me in a dream after many-a-drink at the pub.

Tagged as: , , , 2 Comments
13Nov/081

Competition

I understand that this blog isn't exactly artsy and crafty and to be honest, while I appreciate nice home made stuff, I'm more inclined to build myself a mulcher and vege garden with rain water drip irrigation than I am to say, sew something. But, when its all said and done, I do dig nice DIY stuff.

Anyway, there is a point to this post. My sister is running a competition on her blog to win some home made birds for a Christmas tree. They are super nice and all you need to do is post a comment in this post. She has a fantastic blog that even the non artsy andn crafties like myself can appreciate it. At only 100 posts old, it already has a strong following of readers which is just awesome. Anyway. Thats it. So, get commenting!

Tagged as: 1 Comment
7Nov/080

Movember 2008

Day 7 and lookin' good.

While I have come to terms with the fact that I will never be able to grow a decent beard and my moustaches look a little like patchy vegemite, I have still entered Movember every year since 2008. Sadly, I don't get much support doing it and most people just chuckle at me and my poor excuse of a Mo, I still personally support Movember and particularly Beyond Blue.

Its seven days in and I am yet to get a donation so I am asking any readers with a spare $2 to sponsor my mo.

My Mo Space page.

My 'Sponsor Me' thread on SAU.

My 'Movember' set on flickr (taken daily with my phone).

Tagged as: , No Comments
30Oct/080

Ciao Baci

Say hello to the new Biggins family member, Baci!

Baci

Baci (meaning 'Kisses' in Italian) is an 8 week old Golden Labrador. She is beautiful and highly destructive. We've already had to buy a new power cable for my wifes Dell Laptop.

 

20081030 001

I was able to get these rare shots when she was tuckered out after pouncing on Abbey, eating Bec's slippers and slipping over on the wet balcony tiles.

Anyway, welcome Baci.

11Oct/081

The final countdown on a Kazookeylele!

Pure Genius!

Tagged as: , 1 Comment
5Sep/080

Code merging. Its awful without good tools.

No developer likes to merge their code in with other code after finishing a big project. Its a royal pain in the ass. I find myself having to do it at work a lot (we have a largish team) and at home because at home, I somehow find that I have 84 copies of the same thing. So, I need to merge them together occasionally to keep things maintainable.

Merging is by far 10 times easier on Linux than windows. Linux is such a good development environment (apart for .net – but then, who uses .net anyway?). I would recommend getting VirtualBox, Fedora (or Ubuntu) and installing them on a windows machine. Even if you only use it for coding, profiling and merging / deploying. Its worth it and takes bugger all time to set up.

I am using Ubuntu on my VirtualBox. I prefer Fedora, but I found it hard to get higher resolutions with it. Anyway, I’m off topic.

Once you create your two directories or files that you need to merge or create a diff for. You can open one of the three programs;

My personal favourite is Meld. There are others out there. If you use something else, let me know about it.

Using one of these apps takes the hard work out of merging. In meld, you can match custom rules (for example, you can match all files in the ‘cache’ directory) and then ignore them.

Then, once your files / directories are merged, you can use something like KDESvn to commit them (if you are not savvy enough with the command line SVN client).

All done. Merged, Committed and time for a beer.

If you are unlucky to be on a Windows machine. No real biggy, but your choice of free clients becomes slim.

TortoiseSVN is the app of choice for interacting with an SVN repo.

Once you have the directories, you can merge them with WinMerge. I do find this app a little lacking. It doesn’t display the files in a heirarchical view, so diffing 10,000 files (which I did yesterday) just lists them all one by one and not within their directories.

I have heard a lot of good things about Beyond Compare but it is not free.

Let me know what you use for comparing, diffing and merging files.