Posts tagged TechTips

Zimbra offers an awesome Open Source collaboration suite. EC2 is an awesome compute cloud service. The points I learned and did while deploying Zimbra on EC2.

  1. Zimbra on Ubuntu is supported on Hardy (8.04), but not newer. Install only if you want an adventure. I didn’t want an adventure, and I love Hardy.
  2. Hardy EBS backed image was not available on Amazon (by today) So, I did this, and got things ready. (If you want the AMI, let me know. I can share the same with you.)
  3. Download Zimbra Ubuntu package, unpack stuff and … wait.
  4. Zimbra uses LDAP for maintaining user registry, so, you need to know that Zimbra is going to install LDAP for you.
  5. But, LDAP has a weird habit of checking for host over DNS even if you install the LDAP server on same machine AND editing /etc/hosts file do not suffice.
  6. So, you need few entries in your DNS.
    1. MX Entry for your website. (MX entry tells which server will handle mails for that particular domain)
    2. A Entry for your MX server. (that particular mail server should be resolved to an IP)
  7. This should solve your problems if your servers are connected to internet, but most of time, they do not. They will be behind a firewall, and they will have LAN IPs which won’t be same as your public IPs, and your server might not even know that it has a public IP (server will just know natted IP). This is just the case with EC2.
  8. So, now you need to configure a DNS server on your LAN to do the work for you. Follow this tutorial on how to create zones. It will help you to create proper entries on your Bind server.
  9. Confirm that your Bind server is working by doing. Replace example.com and mail.example.com with appropriate domain names.
    • dig @localhost example.com MX  - to see your server’s MX record
    • dig @localhost mail.example.com A - to see your mail server’s A record
  10. Once, local DNS is configured. Add an entry to your /etc/resolv.conf and also add mail.example.com xxx.xxx.xxx.xxx to your /etc/hosts. Replace domain and IP appropriately.
  11. Now, you can continue with installation of Zimbra. Just start the installation. And follow the steps. Zimbra installation, by itself is a fairly simple process.
  12. During the installation process, Zimbra will think that mail.example.com is the domain for which you are installing, and try to check MX record for it. As, we do not want email for our mail server (we dont want mail@mail.example.com, rather we want mail@example.com), we didn’t not create any MX entries for for mail.example.com. So, Zimbra will fail to check for MX record of mail.example.com and ask whether you want to change it. Now, change it to example.com
  13. And, finish installation.
  14. Last and important, goto your AWS console, Security Groups, and enable SMTP, SMTPS (IMAP, IMAPS, POP3, POP3S ports if needed)

Now, as you are on EC2, there are some issues, you are going to face.

  1. EC2 doesn’t support reverse DNS, which means, your example.com will resolve to Amazon IP, but that amazon IP when nslookup’ed on, will return something like ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com rather than example.com. There is no way of changing this as of now. LittleScrewed.
  2. That means, some mail servers might not accept your mails, thinking that your spamming. Screwed.
  3. EC2 has very bad limit on sending outgoing emails from its SMTP ports. I got an email from EC2 abuse for sending 10 emails. Totally Screwed.

But, as light at end of the tunnel, there are few things you can do.

  • You can use an external SMTP service to send email. For that you have to configure your MTA ie., Postfix here, to relay emails using that external SMTP service. Of course, the a reliable external SMTP service will add some weight to your bill.
  • Configure a proper SPF on your DNS and pray that all mail servers accept your email.
  • Rather than going for external SMTP, you can configure SPF and request Amazon to increate your email limit and hope they approve.

But, because bad things always happen, few mail servers like my employers, throw you a 554 code when reverse DNS fail for your IP. Logically speaking, things should work when proper SPF is configured, but, this is practical world. Things are always beyond the control of standards. If you are an IE user, you would never know this.

Filed ↓ ZimbraEC2TechTips

After two years of my last migration from blogspot to wordpress, Here I am, after 3 years of blogging, migrated to third service. This time, moving out of self-hosted wordpress to a nice hosted solution Tumblr. You might haven’t seen many differences other than theme becoming extremely minimalistic.

Well, there are the changes.

  1. Now, the service is no longer wordpress, its Tumblr :D
  2. All posts are migrated
  3. All comments are migrated to Disqus, a very good global comment system
  4. URLs of all posts are changed, but any time you can you use the search
  5. All bookmarks, external links, google indexed pages till re-indexing are broken. Boo Hoo.

Migration went smooth, but there was a small problem for doing the same. There were no softwares available to do the same. “Migration from Wordpress to Tumblr”. If any existed, they will certainly miss migrating the comments or the attachments you’ve done in your previous wordpress blog. And, it of course is a tedious task to migrate everything if you do that manually.

So, on my way here, I wrote a small script for doing the same - Wordpress to Tumblr migration. I called it Wp2Tumblr.Py

Well, it does the following things -

  1. Takes your wordpress extended rss archive and parses it
  2. Post all your wordpress posts to Tumblr
  3. While doing above step, it posts all your image uploads to Tumblr as Private post, extract the url of the image from Tumblr post, change the same in  your wordpress post.
  4. Migrate all the comments of the post to your disqus account and link them to your post

Well, as I promised, I’m going to release all my personal code as opensource under WTFPL. So, if you’ve a similar requirement, you can clone the repo from http://github.com/karteek/wp2tumblr.py

By the way, I didn’t tell you whats better in Tumblr than Wordpress yet. These are few I found as new

  • Totally customizable themes. Of course, you can do same on self-hosted versions of wordpress. Paid feature on wordpress.com, I guess.
  • Multiple of types of posts. Unnecessary in my opinion, but what the hell.
  • Custom domain support. Self hosted wordpress, obvious. wordpress.com, its a paid feature.

Above all, the main reason, I wanted to move to a hosted service. Blogger is too messy. Comment system sucks there. Wordpress is nice, but I couldn’t get username ‘karteek’ and custom domains are not part of standard feature set and I was feeling all excited for an adventure :p

I still think that Wordpress is the best blogging software available, but updating the codebase, payment to the hosting provider etc etc are few things you really are not supposed to be worrying about when you blog for fun. Tumblr made life easy, without losing my identity - karteek.selfdabba.com. All I had to do is point my subdomain’s A record to Tumblr’s server.

I’ve been working on and about Android from last couple of months. I ended up learning few nice things about android from XDA developers and web sites of few other android hackers/developers. Starting with few bad things - No android phone is released in India yet - Google/HTC - WTF ? Ofcourse, Google is selling its ADP1 (Android Developer Phone 1, in other words completely SIM unlocked HTC Dream a.k.a TMobile G1) for Indian crowd, but the phone+shipping can become unnecessarily expensive. But,  anyway few lucky folks with friends coming from US, who went to US or whose company is good enough to provide them with an Android phone (Yay !!) are lucky enough to get their hands on HTC Dream. But, anyway not-so lucky guys can always get the awesome emulator from Android site. Coming to the interesting things that you can do with your phone, well, these are NOT for guys who are scared of command line, who do not understand terms like root, or people who are just too scared of spoiling their phones and ESPECIALLY NOT for people who doesnt RTFM. If you are wondering what the hell is RTFM, you might want to buy an iPhone ;) Kidding anyway. Android is awesome platform out of the box, but it can be done more awesome by doing some nicer stuff to it. Now, you should know few things/terms here.

  1. ADP1 - Android Developer Phone 1 (Google branded, Black one with fancy design on it) - images
  2. G1 - T Mobile G1 (Black/White TMobile branded phone with Google logo on the back) - images
  3. G2/Magic/Sapphire (Vodafone branded HTC Magic phone, G2 - is just made up by people. Sapphire is probably HTC code name) - images
  4. Google Ion - HTC Magic phone given by Google the attendees of 2009 Google I/O conference
Now, all the above phones + few more phones (chinese stuff like Lenovo Ophone etc.,) run Android. So, if you get your hands on any of the above phones, you can do few nice things with it.
  1. Root the Phone Rooting the phone - simply means that you get ‘root’ access on the phone. So, unless you possess root you cannot feel the true potential of your Android (linux) phone. But .. wait … what is root ? If that is your question, you wasted 5 minutes of your precious time by reading this useless post. You can simply return your useless linux phone and live with a Nokia phone happily ever after.Rooting is a fairly simple process if you RTFM. But, beware that it can brick(break) your phone if you are careless. So, if at all you decide to root your phone, DO read the instructions carefully on XDA or Android-Dls.com and the try it.
  2. Change the bootloader This is not a fancy thing that you can do with your phone, but more of an essential thing if you decide to play with your phone. Check this thread on XDA and install the Hard SPL. G1s will have the default G1 Original SPL, where as ADP1 will have Engineering SPL. I’m just not sure what SPL does Ion and Magic have (probably the newer one which is not listed on that page). HardSPL is the recommended one.There is a newer SPL (1.33.2005) which actually bricked many phones. This SPL is the most useful as it increases system and data partitions of your phone by 30 megs each. Which means, you can do more fancy stuff with your phone. If you decide to go with this SPL, - Do check your Board type … and research on which board you can install, Make sure that flashed your phone with latest Radio, And make sure that you will never go back to older radios on the phone.The essential part of modifying SPL is you can apply NBH update files (I hardly did this), and flash nand backups (I do this a LOT). Its simply means, you can take back up of your phone and save them on your computer, and whenever you manage to spoil your phone, *if you have Engg./HardSPL* you can simply flash that backup back on your phone.
  3. Install the ‘n’ awesome ‘custom’ android builds Simon Walker is maintaining a very good list with all the available Android Builds, features, requirements, dates etc., here. If you’ve time, try out all of them and stick to the one you like ‘teh best’. Each of them is great in its own way.
  4. Compile your own ‘Android’ distro If you are more into ‘my own’ things, you can always download the android source and build the images for your ‘dream’ (Only Dream is released ADP1, thats why Google has instructions only for building for HTC Dream. But, by the time you play a lot with those Custom builds And your own distro (#3 and #4 points here), you will understand how you can play with your ‘Magic’. And there is XDA all the time.
  5. Edit your boot splash screens and theme your distro Same as what it tells. There is no better way to show your love for customization than changing your Splash screen or making your own theme for your phone. Well, you can start that by reading stuff here
  6. Wifi/Bluetooth Tether It just means that you can share your phone’s internet (Edge/GPRS/3G) connection to your computer over wifi. The whole process is simplified a lot by few applications. I suggest Android Wifi Tether which is just an awesome opensource application. The whole process needs some  features enabled on your kernel, so, it works only on rooted phones with kernel with iptables and netfilter support
  7. And few more and just don’t forget to do some kickass things like using applications Shopsavvy, Locale, Wikitude, Twidroid, Barcode Scanner, Google latitude, Google Skymap. You can find all the list of applications available in Google Android Market over web at Cyrket (No, its not Cricket, its Cyrket)
  8. …. and try to be a Hero This is more related to #3. But, this is so awesome that it does need a separate point to talk about. Install HTC Hero with Rosie UI. This requires you to know fairly enough about Android builds. Anyway, you can see the Rosie demo for yourself on Youtube here
Out of the endless possibilities of ‘awesome’ things, these are few nice things that you can do with your Android phone. Anyway, as usual I take no responsibility for what ever you do with your phone. No, I’m not going to help you with rooting your phone or any other thing here. I gave links to the sources of information and you can learn easily from them.

Well. This Sucks. Sucks big time.

coconut-battery

Guess you understood what sucks. Battery life time of the my MBP sucks now. A small Google search resulted in few facts. There are so many people who have their Battery Load cycles more than 400 and even then their battery health better than 80%. And few with battery load cycles less than 200 and their battery health better than 80%. I’m in a awkward stage where I’ve lesser and more number of battery cycles than the both groups of people but battery life sucking badly at 45%

Well, there is a bright side of this story. This is NOT my personal laptop *Evil Grin*. This is my from my work. (Ofcourse, battery health and life sucks on my personal laptop too) Even then, its very much irritating when you laptop can live without adaptor only for 1 hour.

BTW, the screenshot is of the software named coconutBattery which does it work exactly as the screenshot next (System Profiler can also help)

Now, why the hell does my (your) MBP shows wrong information on the menu bar about the battery life ? I found some information on Apple’s site about calibrating battery so that it shows correct information in the menu bar. But, Apple help page’s summary tells that its same procedure for obtaining best performance. You can find those instructions at this Apple’s page. Will certainly update you guys if anything goes good after following the procedure.

Without any intro - crap that I usually write explaining why I had to write this post, I’m going for the subject. You(general junta or web developers or scared security guys) might see some eval packed javascript which phishing idiots ask you to copy paste on your URL bar and hit enter key. Unpacking JS is a PITA was an answer that my brain use to give whenever I think about it. Just now, I found a very easy method to convert it into readable Javascript without any extra tool (IE boys, run away) Its very simple in FF or Opera. FF guys, all you need to do is …

  1. Copy the eval packed JS. something like —— eval(function(p,a,c,k,e,d){e=function(c) …………………. }
  2. Open Error Console on your firefox
  3. Paste the packed JS in Code input tab
  4. Add eval = alert; at the beginning of the code
  5. Hit Evaluate
You will get the proper javascript for the packed javascript. Copy paste it into any code prettifier. It will become perfectly readable. Opera folks, follow this. Packed JS is a huge asset for Phishing as who would have expected that packed JS in this code will make you join around 26 communities and send some stupid message to all your friends without your knowledge as soon as you copy paste some JS code on your URL bar and hit enter. Edit: Or the simplest of all, as Rob Reid suggested, just head to the unpacker at Strictly Software. Thanks Rob.
Page 1 of 14