iphone 4 ios 5.1 baseband 04.12.01

Iphone 4, IOS 5.1 Baseband 04.12.01 -- Bad luck.. your iphone is now just an ipod.. wait for dev team to come up with a solution.

If you have an iphone 4 which by mistake upgraded to IOS 5.1 through iTunes updates then you are unlucky. Check its baseband ( Settings > General > Modem Firmware ). If it is 04.12.01 there is no going back. No tools available can downgrade the baseband. You may downgrade the ios version but not the baseband. If you have saved the shsh blob files before updating to ios 5.1 then you may be lucky.

You can downgrade from 04.12.01 to older only if you have saved the shsh blob files.
If you have saved them then click here for the procedure.

Apple unsigned ios 5.0.1
so cannot downgrade from apple.

Unlock for basebands other then 04.12.01
http://jailbreakhow.net/unlock-iphone-4-3gs-on-ios-5.1-using-ultrasn0w-fixer/

And these are the tools usually used for to jailbreak ( use iphone for net, app store and itunes) and unlock (unlock from a sim like AT&T or Vodafone) iphone.

The team who works on iphone hacking is dev team. http://blog.iphone-dev.org/

Redsn0w
Ultrasn0w
sn0wbreeze

Notes:
You can't download a normal IPSW ( iphone software ) from any third party site and install it on iphone. 

Delete files to trash from terminal

In linux rm command cannot be used to delete files to Trash. rm will remove files which cannot be recovered easily. So I wrote a shell script to remove files to Trash. Create a file 'delete' and add the following script to it.
#!/bin/bash

if [ $# == 0 ]; then
        echo "no input files"
        exit;
fi

for item in "$@"
do
  mv $item ~/.local/share/Trash/files
done
Save the file and give executable permission to it chmod ugo+x delete . Then copy it into a folder which is there in the system path. I copied to /usr/local/bin (mv delete /usr/local/bin) It will work with multiple files also.

Try touch file1 file2 file3 and delete file1 file2 file3 . You can see the files in the Users' trash. If the user is root it will go to System trash.

User Trash : ~/.local/share/Trash/files
System Trash : /root/.local/share/Trash/files

function pointer in c

Function pointer in c - a simple code using struct. The same concept I saw in device driver development. So to get a clear concept I did this code.

#include <stdio.h>

struct file_ops {
        int number;
        int ( *open ) ( int );
};

int function_open ( int );

struct file_ops

fops = {
        open: function_open,
},

gops =  {
        open:function_open,
};

int main ( void )
{
        fops.number = 10;
        fops.open ( fops.number );

        gops.number = 20;
        gops.open ( gops.number );

        return 0;
}

int function_open ( int a ) {
        static int j = 0;
        printf ( "The number is : %d\n", a );
        j++;
        printf ( "The count is : %d\n", j );
        return a;
}

Read this post to know how to add source code snippet to blogger.

Add code to blogspot

How to add source code to the blogspot blog. Get your source code ready
  • Go to http://www.chami.com/colorizer/ , select your language and paste your code in the box. 
  • Click on colorize button which gives three options to download the source. Select the third option partial HTML block. It will open the source code in web. 
  • Save that page ( or right click and view page source and copy the complete source. It will be starting with a pre tag)
  • Take the blog post compose and select the HTML view. Paste the code where you want to see the code and preview it. If everything is correct go to compose mode continue the post.
A tutorial of the same is given below

First in the compose mode create two lines like this
  •  
Then go to HTML mode you can see some thing like this

Add the code (partial html block obtained from colorize ) in between. So it will look something similar to this
Okie that is it. Go back to compose mode and preview. It will gives some thing like the following.


code comes here
#include <stdio.h>

int main ( void )
{
    printf ("Hello World\n");
    return 0;
}
code ends here.
For the outer border and the background replace <pre> with the following.

<pre style="border:1px solid lightgrey; background:#fafafa; color:blue;">
Edit the code snippet ( the stuff between code comes here and code ends here ) only through HTML view.

O'reilly Linux device driver open book download script

The book Linux device drivers third edition is a free book from O'reilly. Pdfs are available for all the 18 chapters. The following script will download them all together.

Open a terminal and create a file download.sh. Add the following scripts to it.

#!/bin/bash
#comment the line which is not required to download
wget http://oreilly.com/catalog/linuxdrive3/book/TITLE.pdf
wget http://oreilly.com/catalog/linuxdrive3/book/COPYRIGHT.pdf
wget http://oreilly.com/catalog/linuxdrive3/book/ldr3TOC.fm.pdf
wget http://oreilly.com/catalog/linuxdrive3/book/AUTHOR.COLO.pdf
wget http://oreilly.com/catalog/linuxdrive3/book/biblio.pdf

# index
wget http://oreilly.com/catalog/linuxdrive3/book/ldr3IX.fm.pdf
# 18 chapters
c=0
while [ $c -le 9 ]
do
      wget http://oreilly.com/catalog/linuxdrive3/book/ch0$c.pdf
      ((c++))
done
c=10
while [ $c -le 18 ]
do

      wget http://oreilly.com/catalog/linuxdrive3/book/ch$c.pdf
      ((c++))
done
Now save it and add executable permission to the file (chmod +x download.sh)
Now ./download.sh
This will download all the chapters, index and other files in the book to the current folder.