Wednesday, January 30, 2008

Git-ty up (Part 1)

2 days ago I was introduced to git, a distributed version control system (DVCS). A DVCS basically creates a copy of the repository on your local PC allowing you to work without access to the main server. You can do everything you need i.e. create new branches, tags, etc all locally. Especially useful to those working via laptops on the go. There have been opinions on VCS and DVCS even by Linus torvalds himself. In fact, in there was a guy in Drupal groups who did an evaluation on git. A few days prior to discovering git, i was reading up on Bazaar, another DVCS system sponsored by Canonical, the creators of Ubuntu. After trying out git and comparing it with SVN, here are my personal opinions on it :-

  • + Git is extremely fast. Syncing with the server was significantly faster than via SVN.
  • + Git uses SSH by default so no extra tunneling to secure your connection is required. This also means that user authentication is simplified whereby only uses who have their public key can even attempt to connect.
  • + Branching is supported natively.
  • + There is only 1 place where details of your files are stored, in .git, which, unlike SVN stores it in each folder. This also has the benefit of less space being used.
  • - Learning curve is slightly higher than SVN (took me longer to get a working copy with Git than SVN).
Don't get me wrong, but once you get your head wrapped around how and what Git does, it's actually pretty easy and fast to get things done. In my next post, I'll outline the steps I used to get Git working.

Tuesday, January 15, 2008

Look out Outlook

2 posts in a day. That's new. Heh. I've just finished setting up IMAP + Google calendar on my Thunderbird. I've kinda given up on managing everything purely using the web as I've got a few different mail accounts (not only from Gmail) and it gets pretty tiring to logout and login to different accounts. Also, my friend has been asking me if there is an alternative to Outlook for some time now so I decided to look around. Since I've never used Outlook before its hard for me to comment exclusively on its limitations or strengths.

So for my setup, I used Thunderbird + Lightning + IMAP for syncing my mail and calendars. And this method works for both Linux and Windows (should work on OSX as well but i haven't tried it out yet). Google has a good guide on setting up IMAP with your mail account in Thunderbird and this site gives a tutorial (with screenshots) on syncing Google calendar with Thunderbird. I'll post the guide on setting up an IMAP server with a local calendar setup for companies once my friend passes me the guide. Till then, happy syncing.

Secure GRUB

No its not about food. Its about making sure no one fiddles with your boot menu which can allow them to boot into single user more or change any other setting. Here's how you do it :-

  • To create a password, type "grub-md5-crypt". Enter your desired password TWICE and if it matches, the application will give you the MD5 password. Example
    • grub-md5-crypt
    • Password : <Enter your password>
    • Retype password : <Enter your password again>
    • $1$D3V8K$EnFFr14dK5PCgmz2GCsDS.
  • Copy the output given i.e. "$1$D3V8K$EnFFr14dK5PCgmz2GCsDS." either by using your mouse or you can write it down somewhere.
  • Edit your GRUB config file in "/boot/grub/menu.1st".
  • Add the line "password --md5 <MD5 password>". It can look like this
    • default 0
    • timeout 3
    • password --md5 $1$D3V8K$EnFFr14dK5PCgmz2GCsDS.
    • hiddenmenu
  • Optionally, if you dual boot, you can also make sure Windows does not boot unless the password you specified is given. For it just add the word 'lock' after the 'title' section for Windows
    • title 'Windows XP Professional Edition'
    • lock
    • root (hd0, 1)
    • chainloader +1
  • Quit and save your changes
And you're done. Happy grub-ing...

Monday, January 14, 2008

Workrave

Heh. A title that matches the software. That's new. Anyway, while I was going through the software collection in Open Source programs for Windows I stumbled onto WorkRave. From the site, "Workrave is a program that assists in the recovery and prevention of Repetitive Strain Injury (RSI). The program frequently alerts you to take micro-pauses, rest breaks and restricts you to your daily limit." Useful for those people who are constantly working in front of their PC non-stop.

Happy raving ;)

Saturday, January 05, 2008

IE coming to a Linux near you

Well first up HAPPY NEW YEAR to everyone. Goodbye 2007, helooo 2008 :D. Ok now back to blogging...

If you're into web development AND you're on a Linux machine, testing your site to make sure it looks and plays well with IE is a definite must. Well thanks to the folks at IEs 4 Linux, we can now get it working on Linux without having to boot up windows. This script can install IE5, IE5.5 or IE6. Below are the steps to get it working :-
  • You must install wine and cabextract first.
    • sudo apt-get install wine cabextract
  • Download ies4linux here.
  • Untar it in a folder of your choice and switch to that directory.
  • Install it using "./ies4linux --no-gui" (if you're installing on a remote machine).
  • Watch it download and install the necessary stuff from Microsoft's website and Flash from Adobe.
  • After you're done, you can execute it by typing "ie6" from the command line or on the link from your desktop.
  • Test your site on IE to see how it looks ;)

It is also possible to install IE7 using the method described here. Google has been kind enough create a stand alone installer which can be obtained from this link for those who just wish to obtain IE7. I'm listing the quick steps to get IE7 working here. For a more comprehensive explanation, check out the link above.
  • Switch to your local ies4linux directory.
    • cd ~/.ies4linux
  • Copy your existing IE6 folder to IE7
    • cp -r ie6 ie7
  • Replace all references of ie7 to ie7
    • sed ~/.ies4linux/bin/ie6 -e 's/ie6/ie7/g' > ~/.ies4linux/bin/ie7
  • Make the new ie7 script executable
    • chmod +x ~/.ies4linux/bin/ie7
  • switch to the directory your downloaded IE7 to.
  • use cabextract to extract the files needed
    • cabextract IE7Setup_G.exe
  • now use cabextract on the IE7 setup actual
    • cabextract IE7-Setup.exe
  • now run this command
    • for i in wininet iertutil shlwapi urlmon jscript vbscript \
      ieframe mshtml mshtmled mshtmler advpack
      do
      chmod +x $i.dll
      cp $i.dll ~/.ies4linux/ie7/drive_c/windows/system/$i.dll
      done
    • chmod +x inetcpl.cpl
    • cp inetcpl.cpl ~/.ies4linux/ie7/drive_c/windows/system/
  • These 2 files are needed for IE7 to work
    • normaliz.dll = http://www.dll-files.com/dllindex/dll-files.shtml?normaliz
    • inetcplc.dll = http://www.dlldump.com/download-dll-files_new.php/dllfiles/I/inetcplc.dll/6.00.2800.11068/download.html
  • Copy the 2 files to your IE7 folder
    • cp normaliz.dll ~/.ies4linux/ie7/drive_c/windows/system
    • cp inetcplc.dll ~/.ies4linux/ie7/drive_c/windows/system
  • Make sure WINE is using Windows XP as its container otherwise the there will be view pane corruption
    • WINEPREFIX=~/.ies4linux/ie7 winecfg
  • Lastly create a shortcut to IE7
    • ln -s ~/.ies4linux/bin/ie7 ~/bin/ie7

Happy browsing :D