Sysadmin’s Day

Reposted! Originally posted on 29th of July 2009.


Happy sysadmin day!
:)

Credits: pic and clip (click the pic to hear the clip).

Hacking a Samsung Galaxy S (GT-I9000)

Ok, so I have a friend that calls me today. He owns a Galaxy S, and his phone is totally locked, because he was using a visible pattern lock and some noob was trying to guess that pattern until the phone locked away.

The problem would not be a problem if he was using Google’s service for backing up the data, but he was not using it. So he calls me and asks if I can help him recover his phone, ideally preserving the data on it.

Challenge accepted!

First I rooted the device, that can be done easy by downloading SuperOneClick (search for exploit folder, where you will find the binary to be uploaded and executed). Later I installed su and busybox, to get some tools available.

Samsung guys are smart, if you boot into recovery, you will only have access to the system file-system, and not anything else. What I was looking for, was the place where Android stores the settings values, later, I found that what I was looking is an sqlite database, but we are getting there soon.

On a standard Android, the settings database we are interested in, should be available in your /data/data/com.android.providers.settings, but that’s not the case with Galaxy S, the Samsung engineers, created a dedicated partition for settings/contacts/etc databases, so all you are going to find using the standard path is a dummy place-holder. To get access to the real database, you will need to find the name of the device that has to be mounted.

The OS init.rc and recovery.rc files are the files that are “poked” when booting into normal and recovery modes. Knowing that recovery mode doesn’t help me much, I consulted init.rc. The device name was /dev/block/stl10. If you mount it, inside databases folder, you will find the real settings provider database.

Download that file (settings.db), and change the value of key lockscreen.lockedoutpermanently from 1 to 0 using sqlite3 tool. Once done, upload the file back to the phone. Replace the old file, chmod it to 0666 and chown it to the same uid and gid as it’s parent directory.

Reboot the phone! Done!

In the end, I can say that it took me some hours, and saved a complete Android reinstall, with a big probability of loosing all the data. Anyway, it was nice playing with the device.

:)

Publish git repository to svn easily

I’m using git a lot, and lately I started to publish my WordPress stuff on github.

Some of that code are plugins, and as you may know WordPress.org are using SVN a lot. I’ve googled a lot of solutions on how to publish code from git to svn, untill I discovered the steps below.

First you will need to know the revision of your initial repo (you can also call it repository creation commit). You can find it by searching trac or any other web interface that handles the SVN log. Let’s say in my example I had to search for some-maps plugin creation commit. Go to this link, by replacing KEYWORD with your repo name:
http://plugins.trac.wordpress.org/search?q=KEYWORD


The revision number you need is the one in squared brackets.

Now it’s easy. Open your .git/config file, and append/modify the svn-remote part:

[svn-remote "svn"]
        url = https://plugins.svn.wordpress.org
        fetch = KEYWORD/trunk:refs/remotes/trunk
        branches = KEYWORD/branches/*:refs/remotes/*
        tags = KEYWORD/tags/*:refs/remotes/tags/*

Once you’re finished, use the git svn fetch command, like this:
git svn fetch -r REVISION_NUMBER

Now all you need is to switch to svn branch, I suggest you creating a new banch that will be synced with svn trunk:
git checkout trunk -b svn

Now you can merge master to svn, commit and tag:

git checkout svn
git merge master
git svn dcommit
git svn tag TAG_NAME

Happy forking!

Thin Lizzy

Cum se devine liber…

Mai nou, prin repetarea muncii altora.
Nicu acum 2 zile a scrisCeata lansează o nouă pagină web despre cum e să „fii liber”, pe facebook primesc invitație să plac inițiativa deși nu îi văd rostul. Să mă explic…

Încearcă

Încearcă

Acum imediat 2 ani (ZOMG!!!), Alex anunță primul proiect gen Deb-a-Day în .ro care are menirea:

„Încearcă software liber!” este pagina pe care găsești prezentări ale programelor libere, descrise de către cei care le folosesc și le iubesc. Scopul acestei pagini este de a promova software-ul liber într-o manieră prietenoasă și practică. Chiar dacă majoritatea programelor libere rulează pe sisteme GNU/Linux sau *BSD, aici vor fi prezentate aplicații indiferent de platforma pe care rulează.

În 2 ani proiectul:

  • a schimbat 3 redactori,
  • a avut câteva contribuții de la colegii din comunitate,
  • are cam 70 de articole,
  • are peste 25 mii de unici,
  • are aprox. 60 mii de vizualizări,
  • are aprox. 50 (+ ~30 de pe planet) de abonați la flux constant (neoficial de la google) și 65 pe twitter.

Toate acestea nu ar fi posibile dacă nu erau 2 Alex (1 și 2) și o comunitate care a susținut și consideră proiectul o resursă inedită pentru informare. Acum să nu fiu luat drept nașpa, explicați-mi și mie cineva de ce este nevoie o copie a proiectului „Încearcă”?

Să revin la întrebarea lui Nicu, „We’ve been free since 2008, good morning darling…”.

Stellify

Ian Brown is a godlike genius aka King Monkey who influenced bands like Arctic Monkeys, Kasabian, Babyshambles (Yep, Pete Doherty). On Arctic Monkeys I had a crush in late 2007 and Kasabian is most of the music I listen for the last year. You never know the roots of your infamy pleasures.