Tag Archives: Hack

My opinion of Tasker in one sentence: “This is the first app that you should install on every android phone“.

A few months ago I needed an “automation” app. I was going to default to Locale which I had used when it was still free (this was before there was an official app store for Android), but the $10 cost made me look at my options — I figured if I was going to pay that amount, I might as well get the best app to do this. My problem with Locale is that it’s simply not that powerful, it doesn’t have tons of features, and all the good pluggins, instead of being built in, are additional paid add-ons. I am really glad I looked else where because I stumbled upon Tasker (http://tasker.dinglisch.net/). The official description for Tasker states that “Tasker is an application for Android which performs Tasks (sets of Actions) based on Contexts (application, time, date, location, event, gesture) in user-defined Profiles, or in clickable or timer home screen widgets.” I am not sure that I can describe it any better, so let’s leave it at that. If you want to learn more about Tasker, start here: http://tasker.dinglisch.net/tour.html

One thing that immediately popped about Tasker was the insane amount of built-in contexts, settings, options, detections, notifications, and actions. One thing led to another, and I started using Tasker for everything. I realized it had so much potential that I went back to stock 2.3.4 and just used Tasker to gain all the cyanogenmod functionality (that I needed at least).

The reason I decided to even write this post is in order to share two “programs” that I wrote, which I think are extremely helpful. The first one is called “Keyguard”. The second one is “Blackberry Sound Profiles”. I am putting these two in their own posts so that they can easily be indexed and searched url wise. I know personally that the most sought after thing on Android is the blackberry sound profile functionality. Well, it’s finally here! See my next two posts for all the information.

Since it seems like people are really interested in this information (especially those out side of the US where updates are not pushed out), I will continue with the updates regarding the Nexus S. Here’s the next (no pun) operating system update: 2.3.4:

a14a2dd09749.signed-soju-GRJ22-from-GRI40.a14a2dd0.zip (md5: 92b0f0a0b57a7cf10d2d70610c8bb9fb)

Again, this is directly from google (it is even linked to google), and you should follow the 7 steps from the http://blog.vpetkov.net/2011/03/11/google-nexus-s-update-manually-to-2-3-1-2-3-2-and-2-3-3/ article.

Please note that the update WILL work if you are running “GRI40” (build number in Settings -> About Phone)
The biggest update when it comes to new features seems to be that Google Talk has voice chat! There are a lot of bug fixes.
For the bug fixes, check out: http://www.google.com/support/forum/p/Google+Mobile/thread?tid=3812c1acf93b482f

 

IF YOU GET AN ERROR:

Please just grab the FULL 2.3.3 (f182cf141e6a.signed-soju-ota-102588.f182cf14.zip) system, install it and then try again. It will work!

 

IF YOU JUST WANT THE RADIO UPDATE:

XXKD1-GRJ22-radio-nexuss-unsigned.zip (md5: 57659f04148ebfa849ef523544f2a3dd)

Note: I personally couldn’t update just the radio update from 2.3.3 (with GRI40) – kept getting the status 7 signature verification, so I used the 2.3.4 update to get the radio patches. I’ve seen people who have been able to apply the radio update to 2.3.3 without any problems.

 

NOTE: Look at the new post above if your phone is *at* 2.3.3 and you want to go up to 2.3.4

If you just want the LATEST update: grab the FULL 2.3.3 image (f182cf141e6a.signed-soju-ota-102588.f182cf14.zip)

I decided to contribute back, mention a few vital steps, and provide a few important files now that I solved this — in order for someone to go from 2.3(.0) to 2.3.3
This assumes that you have not rooted your phone. If you have, you need to un-root it and go back to either 2.3.0, 2.3.1, or 2.3.2,

First of all, if you use the built-in “update” method, the updates need to be consecutive. For this, they are very small.

Let’s assume you just bought your Google Nexus S. It came with 2.3 (or 2.3.0 in reality). The first step is to apply the 2.3.1 update. I’ve called this:

update1.zip (md5: a35798d84104c7cb1d26d7946ce843fc)

The general instructions are:

0.) Put the file into the /sdcard directory.
1.) Turn off your phone
2.) Hold Power and Volume-Up until you see the recovery menu (lots of colors and 4 options).
3.) Use the Volume-Down key to scroll down and  select “Recovery” by pushing the Power key.
4.) Wait for the triangle with the exclamation point. Push the Power key and while holding it, tap the Volume-Up key.
5.) Now you can use the  the Volume keys to go to “apply update from /sdcard” and then the Power key to select it.
6.) Select the appropriate ZIP file, and then use the Power key to apply it.
7.) When everything is done, go to the Reboot option with the Volume keys and then use the Power Key to select it.

Now, that said, after you apply the first update, you go from 2.3.0 to 2.3.1. Now, apply the 2.3.2 update. I’ve called this:

update2.zip (md5: 714e1e1126f1a222c10ffce6c83dc6ad)

Same as before. After you go through the steps and reboot, you will be at 2.3.2. Here is where things get interesting. It seems that you need another update. Its for people who get the “Status 7” error.
This is mostly due to a firmware (those who have: GRH78C or GRH78). Here you will need to apply the LAST UPDATE, the same way you applied update1 and update2:

For GRH78C (md5: 3923f98754f756a83b3ecc44e42a2902)

or

Only for GRH78 (md5: 919d7f2c9e06bb03a2ff74081028bf0a)

At last, reboot, and you are on 2.3.3

Please note that *ALL* of these files have been taken from google and are official. For that exact reason, I have provided the md5 checksums, so that you can verify them before you use them.
Hope this helps.

 

ADDITIONAL INFORMATION AND FILES (If above did not work — very rare):

Some people (very very rare) might still get an error. This is if you have a different radio version. Check: “Settings -> About Phone -> Baseband Version”. You should have either something that ends in “XXKB1” or something that ends in “XXKB3”. Here are the two radios. Apply this the same way as the items above. You might need this BEFORE the GRH78C (or  GRH78) updates.

XXKB1-GRI40-radio-nexuss-unsigned.zip (md5: 4805c255f10eef8b1bd54aa2d27bc30e)

or

XXKB3-GRI54-radio-nexuss-unsigned.zip (md5: 4e9c9cf4d6470be800e00f8508b9c175)

 

LAST RESORT (if nothing above worked — extremely rare):

If nothing worked, try the FULL 2.3.3 OS.

f182cf141e6a.signed-soju-ota-102588.f182cf14.zip (md5: 3e8908941043951da5a34bb2043dd1a0)

Let me preface this with the fact that, you just can’t do this unless your iphone is jailbroken. For the non-curious, stop reading here.

This one came about as I was recently forced at work to switch from using the Unix email system to the hosted Exchange solution, in order for our calendars to be centrally accessible by everyone. Details aside, after adding my exchange to my iPhone (since I am trying to keep my blackberry off BES), I realized that the color schemes absolutely suck. From somewhere, it decided that purple was the best color, and I couldn’t change it. After aimlessly searching through the Calendar.app on the iPhone for a color changing option, I came to the realization that there was no way to do it. Luckily, my iphone was jailbroken, and there are plenty of ways to do this with a little background work. I found this amazing article: http://chriscarey.com/wordpress/2009/02/10/how-to-modify-iphone-calendar-colors-with-sqlite3/

To summarize it, in case the article disappears:

Start by ssh-ing into your phone

One tip that I can give, if you don’t have sqlite3 on your iphone (which you wouldn’t by default), is to scp the file to your computer, apply the changes, and scp it back to the iPhone.

Here are the RGB Values for the Standard Colors:

Red = (181,0,13)

Orange = (229,98,0)

Green = (47,141,0)

Blue = (15,77,140)

Purple = (103,10,108)

So, with the line:

I was able to make my default calendar (the Exchange one) RED — which portrayes the “important” notion and it’s easily visible.

Hope this helps everyone who is trying to accomplish this. Don’t forget to close and re-start your Calendar.app. If you don’t have a jailbroken iPhone, you can change your non-exchange calendars by syncing them to the iCal app, and changing the color back, and syncing them.

[updated: Jan 2nd, 2013 | Updated ‘tiny.pl’ to skip “mailto:” references … it polluted emails with replies]
[updated: Nov 28th, 2012 | Updated ‘tiny.pl’ to be much more efficient which resulted in a crazy speedup]

Yesterday I received one too many emails with a long URL that I actually needed to click on. Why is this a problem you wonder? — I use Mutt. Yes, I’ve heard it all, and yes, I don’t think it’s the best email client, but when you spend all day in a terminal, it’s simply a pain launching the browser to send a single email. It’s a “ctrl+a, #, m, type…type, y…sent”, vs “open browser, go to url, log-in, compose, type…type, hit send”. Anyway, given that I am using the Apple Terminal.app which for some reason has not been upgraded in the last 8 years to include hot linking URLs everywhere (correction: It does, but it does not always handle right clicking multi-line links which contain “strange characters and symbols”), I have to suffer. I’ve been toying with the idea of parsing my mutt emails for a while now, and yesterday I finally decided to sit down and write something. My starting point was my .mailcap entry

My first thought was, why not hook a custom perl script to parse the text from the email, extract the urls, and shorten them? After a little bit of work, I realized that I care about the rest of the text too and not just the URLs. The final solution can be found here:

http://perl.vpetkov.net/tiny.pl [updated: Jan 2nd, 2013]

In order to use it, you need to put this some where (.mutt is a good place), and then modify your .mailcap:
The script starts by NOT reinventing the wheel, and utilizing lynx to parse out the HTML. Please note that this is done only for the ‘text/plain’ type. The way the same script is overloaded is by supplying a second argument for non-html based emails. As you will see, I actually use elinks to parse for html instead of lynx, and the reason for that is because lynx introduces a new character on long URLs for some reason, when used with –dump. This created problems with shortening the URLs. Then the script splits the resulting output into lines, and then it splits each line into “words”. Each “word” is checked for being an URL. If it is, and it’s less than the “trigger” number of characters, it’s shortened and printed, along with the original (nice to keep track). Otherwise, the word is just printed and the process repeats until the end.
While this is EXTREMELY simple concept wise, it is very useful. Is there a down side? — Yes — some potentially private URLs are now public. Solution? — Yes — sign up for bit.ly Pro (free) and use your own domain name. At last, I just want to tack on that while searching for an existing solution to this, I did find a program called “urlview”. I haven’t tried it, but it seems like a much better solution. Here’s some more information on it: http://linuxcommand.org/man_pages/urlview1.html
UPDATE: As it turns out, Terminal.app actually picks up some/most/(all?) long urls. I think it was ‘lynx’ that was wrapping the line at 65-72 characters, which ended up being the cause for the ‘+’ in front of long URLs and the break onto two lines. Anyway, so basically, this means that if you don’t use ‘lynx’ for the HTML parsing, you can potentially click on the links. Either way, I still prefer having tinyurls. Also, I did find a bug in the ‘t’ (non-html emails) version of the script, where in some cases, it will rip out the URL but now show it at all (original or shortened). I noticed this 2 times (out of 1000+ emails), but I just haven’t had time to look into it. I have a feeling that it’s not really my script. The email comes in not containing any html other than an html a href tag. I think that messes with the detection.

If you just want the good stuff (configs, how-to’s about this), check out:

http://blog.vpetkov.net/documentation/network-services/smtps-and-imaps/how-to-tunnel-smtp-postfix-server-to-google-gmailgoogle-apps/

If you want to read my full story behind why I even went this route, please continue bellow:

Recently I started looking at getting rid of as much physical infrastructure as possible. My reasons, among it being a pain to maintain, everything surrounding having your own infrastructure is a downfall. Let’s face it — you can’t afford what is really needed to have 99.99%-100% uptime. There are tricks that you can use to join multiple sites, but again, when you really get into it, it costs money and it takes time. Other than having an ESX server as a personal “lab”, I’ve realized that I spend just as much time dealing with physical infrastructure, as I do creating services, hosting stuff, automating things, and programming. This is just wrong! Also, hosting your own infrastructure means dealing with power, bandwidth, static IPs, etc… Anyway, so with that in mind, I started looking at getting rid of my biggest service which had the fewest users — Email.

I hosted a Zimbra server (which I absolutely love) for almost a year, and before that I hosted for 7+ years (and still do at different locations) mail servers running Postfix+Dovecot+SpamAssassin with Some webmail client (Squirrelmail or RoundCube). The problem with hosting your own email server (i’ll use Postfix synonymous with email server) is that everything is a hassle and a half. At the end of the day, if you have one Postfix server, this is fine. If you have 50+ Postfix servers, not so much. And yes, you can ease it by using puppet and common config management like svn+rsync, but it’s still a hassle. The other problem is that common needs like push email, exchange, blackberry BES, calendars, notes, and others simply do not exist as a “one in all” solution that attaches to Postfix. I realized that while being extremely efficient, and while procmail being simply priceless, it is not economical at the end of the day. Users want ease of use, convenience, pretty UIs, and no spam without any effort on their behalf.

This led me into looking at Google Apps (I’ll use Gmail synonymous). It seemed like the perfect solution — off site, fully managed, relatively cheap (or free), common UI which almost everyone is familiar with, and virtually no spam. It provided smtp(s), imap(s), pop(s), and other common services. The few problems that should be brought up front are: privacy, security, space, and limitations. With “GMail”, (free google app), you are limited to 7-7.5GB per user, 25 users, and “some” advanced SMTP features. You can always pay $50/year/account in order to 25GB with unlimited users and some more programmable/API features. The thing that really attracted me was the ability to get an “all-in-one” solution that was extremely easy to deploy for multiple users. The reality is that most users just want their own email at their own domain, with some storage, some web UI, and no spam or viruses. This was something that I was doing with my “Postfix setup”, and I had scripted quite well infact, but with Google Apps, it was a matter of 15 minutes per account.

Now, the main two problems were: how do my users who use mutt (myself being one of them) get to their email, and how to existing services AND “dumb services” (storage devices, vCenter, etc…) communicate to the “Gmail” servers. The first — mutt — turned out to be much easier than I thought. If you are already using mutt with any authenticated IMAP/SMTP server, you have probably already stumbled onto: msmtp. With a little more work, and you can get this piece of software to work perfectly with Gmail. If you need some help, check out: http://blog.vpetkov.net/documentation/network-services/smtps-and-imaps/mutt-with-google-gmailgoogle-apps-or-any-imap-server/ The second problem turned out to be relatively easy, after doing some research and a bit of trial and error. The main idea is that you create a simple “relay” server in a way. A lightweight Postfix installation which only auths and forwards/relays all the emails to Gmail/Google Apps/any IMAP server for that matter. I went the extra step and configured it to be able to use different SMTP servers with different auth based on different user/email accounts. You can get all the technically details at the top of this post. Good luck, and I hope this saves you some time.