Android Preparing SD Card issue.

This morning after plugging my Xperia X10 into my macbook and syncing my daily dose of tech podcasts ready for the commute to work I found that the phone was not mounting the SDCard and the phone kept crashing.

After a reboot there was a notification saying that the system was preparing the SDcard and was checking for errors.

I used ‘Android Terminal Emulator’ by Jack Palevich to connect to the terminal of my phone to find out waht it was doing to the phone to fix these errors. I found that the phone was trying to run an fsck on the SDCard.

My Xperia kept crashing so it would start again, so I removed the card from the phone and mounted it to my Linux PC and used fsck.msdos on my linux machine to fix the disk errors.

I did this by running the command bellow:

fsck.msdos -a

once this was completed I was able to remove it and place it straight back into my phone to have it work perfectly.

This solution allowed me to quickly repair the issue and not loose any data.

Rooting my Droid in one touch.

The Xperia X10 blog had a post about the new UniversalAndroot application and how easy it was to now root your Xeperia X10.

Here are the steps I took to root my phone:

1. Download the UniversalAndroot APK file from this link on my Mac.

2. Upload the APK file to the phone via the USB cable. I uploaded it to /sdcard/download

3. Install a file browser application. I installed ‘File Manager’ by Adao Team.

4. Find the APK file in File Browser and select it to install. If you cant install you will need to go into the phone settings and then go to Applications and make sure ‘Unknown sources’ is selected. This will allow you to install Andriod non market applications.

5. Once this is installed go and open the Universal Androot application then you will see the screen bellow.

Androot app screen

6. Select the right andriod version. In the case of my SE Xperia X10 it is version 1.5/1.6 and then press the Root button. I thought this would take a lot of time but it was completed in minutes. If it is successful you should see something like what is in the image bellow.

rooted success

This will deploy the exploit to gain ‘su’ on the server and deploys the Super Permissions app to manage what applications have Superuser permissions.

That is it, no stress and no drama…. well I had none and the app can Unroot the handset for you as well. If you choose this you are doing this at your own risk! Just because I had no issues dosent mean you wont. Also ensure you are aware of the effect this will have on you support from mobile/cell phone provider/carrier.

From here you can start to install things like Barnacle WiFi Tether and Orbot and BusyBox.

Tags: , , ,

I love the Droid.

Today is day 2 with my Xeperia X10 and it is an amazing phone, sng that there is so much that the phone does I am going to be playing all weekend with the phone.

The screen is amazing and full scree video is a joy to watch. Camera is good quality and the andrd market interface is so much easier than the iPhone .

The only bummer is that it is runnib Anxroid 1.6, but this is being udated in Q4. So not such big deal.

I will post up more as I play.

Tags:

Cool Tool: Preyproject

I was watching HAK5 on REV3 last week and they mentioned a tool called the preyroject.

What the prey does is runs a piece of software on your PC/MAC/Linux computer that communicates back to your account at www.preyproject.com so in the event you computer is stollen or lost you can connect to the website and tell your laptop it is lost.

When you set this setting the Prey software starts to send you back information regarding your missin laptop such as LAN and WAN IP addresses, running processes, logged in users, screen shots and a photo from the webcam if you have one.

The software will also try to geotag you location via GPS or wireless acces point. The software will also try to connect to the Internet via open AP’s if it is not already connected to the internet.

You can also have the software place a popup on screen and have a buzzer sound every report interval, but this may just infuriate whoever has stollen you computer and have it end up in the bin.

It installed on my macbook really easily and registers with just a quick submission of your preyproject.com credentials. I have yet to test installing it on Windows or Linux, but plan to when I get a chance.

The awesome bit about the software is that it is written in BASH so it is very portable. It was also announced that there is a version available now for the Aindroid platform, which I am excited about for when I get my new Smartphone in the next few months as it seems like a perfect place for this software on a mobile phone.

Make sure you check out HAK5 as well as it is always full of cool tools like this every week.

Tags: , , , ,

Installing google chrome on Fedora 12

I have just installed google chrome via yum on my Fedora 12 Desktop.

This is done by adding a repo file in /etc/yum.repos.d called chromium.repo

This file should contain the following:


[chromium]
name=Chromium Test Packages
baseurl=http://spot.fedorapeople.org/chromium/F$releasever/
enabled=1
gpgcheck=0

Once this is installed run the command yum install chromium and yum will go off and fetch the RPMS and dependancies required to install chrome on you fedora 12 machine.

I had a look at the repo and there are also packages there for Fedord 13 for the brave (there is only 15 days to go). So this should work for F13 as well.

I followed a tutorial for installing Fedora 11/12 which has some more detail. You can get to the article here.

Send specific messages from the sendmail mail queue.

Had to test specific messages from a sendmail mail queue at work today and had to try to work out what was holding up the mail queue.

Here are the commands I was using:

To send messages with a specific message id:
sendmail -v -qI

To send messages with a specific recipient:
sendmail -v -qS

To send messages with a specific sender:
sendmail -v -qR

The substrings can be partial of the information that you are searching for. For example if you are looking to have all email being sent to a specific domain sent from the queue you would execute:

sendmail -v -qRdomain.com

Make sure that you have NO space between the switches and you substring. If you do have a space I found that sendmail will try to send the entire queue rather that the messages that you are trying to release from the queue.

I found this in a freebsd mailing list thread here.

Quick Hack: delete bulk processes reported with ps/grep.

Having qmail running on multiple machines (I know there are better alternatives) we often have to go in and clean up after a crashed qmail service so it will behave again for a while.

Here is a quick and dirty hack to kill processes up that are there when you do a ps aux | grep <process name>

SEARCH='qmail' ; ps -eo pid,cmd | grep $SEARCH | awk '{ print $1 }' | xargs -I pid kill -15 pid

This uses ps and grep to find the processes and awk and xargs to create and execute the kill command for the PID of that process.

This command can easily be adapted to search for whatever process is required by changing the string in the SEARCH variable at the start of the command. The command above is designed as a follow up to using a ps aux | grep to find the search string that identifies the process.

Check out a quick howto on xargs here. I think it is one of the must for all hardcore Linux sys admins out there.

Tags: , , , , , , , ,

Mark all messages as Read in Gmail.

I have an issue where I get slack with my email and do not stay on top of things. Especially in accounts where I get a lot of mailing list traffic. I wanted to clean out a whole heap of this and found a really quick way to make use of the filters in Gmail to mark the messages.

It is really simple.

Goto ‘Create a filter’ which is next to the search bar.

In the ‘Has the words’ section add in is:unread

When you hit next you will be prompted with the dialogue box bellow.

Gmail filter dialog box

Click ‘Ok’ on the dialogue box and move on to the next screen.

Select the ‘Mark as read’ tick box as well as the ‘Also apply filter to’ tick box next to the ‘Create filter’ button.

And there you are done. Don’t forget to go through and delete the filter afterwards as if you don’t all mail will hit your inbox and be marked as read.

I found this on Lifehacker which is an awesome site and well worth following.

Tags: , ,

Upgarding rdiff-backup from source.

I recently had an issue where I was running rdiff-backup on a server that had a different earlier version of rdiff-backup to the one that we are running on our backup server. I was receiving a security violation error.

As the Ubuntu box that I was trying to backup did not have a newer package available for rdiff-backup. I had to update from source which consisted of 4 commands to download that source tarbal and install the newer version.

Before you start you need to install a package for librsync called librsync-dev this can be done with aptitude like this:
aptitude install librsync-dev

Once this is done you can upgrade rdiff-backup like so:

# wget http://savannah.nongnu.org/download/rdiff-backup/rdiff-backup-1.2.8.tar.gz
# tar -xzf rdiff-backup-1.2.8.tar.gz
# cd rdiff-backup-1.2.8.tar.gz
# python setup.py install

Passing a dictionary to a dynamicly generated XMLRPC function

Working on some python code for some automation around the house and had the need to be able to pass dictionary object to a function name that was dynamically generated by the input to the script.

Normally this is simple using the xmlrpclib module that you can install for python. All you need to do is pass in the dictionary object into the function and make sure that the function that you write on the XMLRPC server is looking for a dictionary object.

This is how you would pass in a dictionary object to a known XMLRPC function:

s = xmlrpclib.ServerProxy('http://localhost:8000')
dictionary = []
api_call = s.function(dictionary)
return api_call

When you don’t know the function name it is recommended that you use the getattr method as it is quicker, but you cannot pass in a dictionary object into it. So the only solution I found to do this is to use the eval method in the way I did bellow:

s = xmlrpclib.ServerProxy('http://localhost:8000')
dictionary = []
function = 'function name'
api_call = eval('s.%s(dictionary)' % function)
return api_call

I would love to hear any improvements to the way I am doing this if you have any. Please leave a comment.

Tags: ,