Tuesday, February 19, 2008

Non geek post

Today I take a break from a geek entry and post a link to a cool site. This site lets you print and fold your own TIE fighter or even a Macross VF-1S. Have fun at http://www7a.biglobe.ne.jp/~sf-papercraft/Gallery/Gallery.html.

Monday, February 04, 2008

Git-ty up (Part 2)

Setting up your own Git server. I learned how to setup using this guide. I am duplicating the guide here for a quick reference.
  1. Installing GIT
    • If it doesn't exist on ubuntu. For some reason, GIT needs it.
      • touch /etc/inittab
    • sudo apt-get install git-arch git-cvs git-svn git-email git-daemon-run git-core curl python-setuptools
    • sudo adduser --system --shell /bin/sh --gecos 'GIT Version Control' --group --disabled-password --home /path/to/git_home_directory git_user_name (set up a user to handle all Git request)
  2. Installing gitosis-admin (for user management)
    • In any directory
      • git clone git://eagain.net/gitosis.git
    • cd gitosis
    • sudo python setup.py install
  3. Setting up initial user
    • On local machine generate a public/private ssh key it it doesn't already exist
      • ssh-keygen -t rsa
    • Copy the public key to the Git server and put it in a publicly readable folder
      • scp ~/.ssh/id_rsa.pub user@git_server:/tmp/id_rsa.pub
    • Back on Git server (as a user with sudo privileges)
      • sudo -H -u git gitosis-init < /tmp/id_rsa.pub
    • Git uses SSH as the default transport to communicate with the server, so make sure user_git is allowed in the sshd AllowUsers directive.
  4. Adding users
    • On local machine with the private key
    • Some of us will run SSH on a non standard port so it may be wise to create a .ssh/config file and add a directive to establish connection to the Git server.
      • vi ~/.ssh/config
      • Host git_server
        User git
        Hostname <ip of git server>
        Port <port ssh is listening on>
      • Quit and save.
    • Clone the gitosis-admin file for user management.
      • gitosis-clone git_server:gitosis-admin.git
      • cd gitosis-admin
      • Copy the new users SSH public keyfile to the keydir folder with the format user@server.pub. The .pub is absolutely necessary otherwise the user will not be added. The user@server is the name which appears after the == IN the public keyfile.
      • vi gitosis.conf
      • Add new users you would like to administer gitosis or keep them for other repositories.
      • Quit and save.
      • git commit -a -m "Whatever commit message you like to add"
      • git push origin master:refs/heads/master

  5. Adding repositories
    • Go back to the gitosis-admin folder on your local machine.
    • vi gitosis.conf
    • On a new line, add
      • [group repo_name]
        writable = repo_name
        members = user1@server user2@server

    • Quit and save.
    • git commit -a -m "Whatever commit message you like to add"
    • git push origin master:refs/heads/master

In the final part, I'll list a few basic commands to get started.

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

Tuesday, October 30, 2007

Foxy tips

Here are some tips for Firefox which will make your browsing a little more snappier. For this you have to launch Firefox and type "about:config" in the addressbar which brings you to your personalized configuration list.

  1. Restore your session when you repoen your browser (not when crashed)
    1. browser.startup.page = 3
  2. Address bar auto completion
    1. browser.urlbar.autoFill = true
  3. Disabling IPv6
    1. network.dns.disableIPv6 = true
  4. Download only what your specifically click (by default Firefox downloads links which it thinks you want)
    1. network.prefetch-next = false
  5. Stop that RAM hogging
    1. RAM size 128MB - 512MB : browser.cache.memory.capacity = 5000
    2. RAM size 512MB - 1GB : browser.cache.memory.capacity = 15000
Those are some of the more interesting tips from "about:config".

Here's another extremely cool feature to have. It basically lets you create keywords for sites your frequently visit i.e. g for searching through google or wiki for searching through wikipedia and you can create as many as you wish. I've been using this feature for some time and I hope this benefits someone else out there. So here's how you do it (using google as an example).
  1. Right click on the search box.
  2. Click 'Add a keyword for this search'.
  3. Enter a Name, your desired keyword and a location for your bookmark.
  4. Click OK
And now you're done. Go to your address bar, type in the keyword with your search query and watch as the magic unfolds. Experiment with other sites and see how can make this wonderful feature suit your needs.

Stay foxy ;)...