<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ArvinderKang.com &#187; Hacks</title>
	<atom:link href="http://arvinderkang.com/category/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://arvinderkang.com</link>
	<description>The world is my backyard.</description>
	<lastBuildDate>Thu, 29 Jul 2010 22:58:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>One command to rule&#8230;. alright, just return an IP</title>
		<link>http://arvinderkang.com/2009/12/08/one-command-to-rule-alright-just-return-an-ip/</link>
		<comments>http://arvinderkang.com/2009/12/08/one-command-to-rule-alright-just-return-an-ip/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 23:49:57 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[ipaddress]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2009/12/08/one-command-to-rule-alright-just-return-an-ip/</guid>
		<description><![CDATA[One of my friends who is into networks always joke, as why there is no single Unix command to return only the IP address and nothing else. Here is a script that just does that one thing and nothing else. &#8230; <a href="http://arvinderkang.com/2009/12/08/one-command-to-rule-alright-just-return-an-ip/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of my friends who is into networks always joke, as why there is no single Unix command to return only the IP address and nothing else. Here is a script that just does that one thing and nothing else.</p>

<p><code>
    #!/usr/bin/env bash
    # Arvinder Singh Kang
    # askang@olemiss.edu
    # Version 0.1 - 2009-06-02
    # ipaddress: This snippet returns the ipaddress of the current computer. Store in a directory which is in the PATH, and make it executable by running "chmod +x ipaddress". 
    # Running command ipaddress should return ipaddresses of this machine.</p>

<pre><code>ifconfig  | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'
</code></pre>

<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2009/12/08/one-command-to-rule-alright-just-return-an-ip/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Imaging ppc iMacs using Deploy Studio</title>
		<link>http://arvinderkang.com/2009/12/07/imaging-ppc-imacs-using-deploy-studio/</link>
		<comments>http://arvinderkang.com/2009/12/07/imaging-ppc-imacs-using-deploy-studio/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 22:46:14 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[deploy studio]]></category>
		<category><![CDATA[imaging]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[OS X 10.5]]></category>
		<category><![CDATA[ppc]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2009/12/07/imaging-ppc-imacs-using-deploy-studio/</guid>
		<description><![CDATA[For imaging(reinstalling/updating/blah blah!) more than fifty ppc iMacs and G5 Mac Towers in less than a day, I started using Deploy Studio instead of NetRestore. However on booting a client from the NetBoot server, i got the following sign on &#8230; <a href="http://arvinderkang.com/2009/12/07/imaging-ppc-imacs-using-deploy-studio/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For imaging(reinstalling/updating/blah blah!) more than fifty ppc iMacs and G5 Mac Towers in less than a day, I started using <a href="http://www.deploystudio.com/" title="Image. Deploy. Configure.">Deploy Studio</a> instead of <a href="http://www.bombich.com/deprecated.html" title="Bombich.com: Bombich Software">NetRestore</a>.</p>

<p>However on booting a client from the NetBoot server, i got the following sign on <a href="http://en.wikipedia.org/wiki/PowerPC" title="PowerPC - Wikipedia, the free encyclopedia">ppc</a> client machine</p>

<p><img src="http://arvinderkang.com/wp-content/uploads/2009/12/netboot.jpg" alt="netboot" /></p>

<hr />

<p>After reading some notes on NetBoot <a href="http://www.bombich.com/mactips/netboot.html" title="Bombich.com: Troubleshooting the NetBoot Process">here</a>, I found this reason:</p>

<blockquote>
  <p>The mach.macos.mkext file is a kernel extensions cache &#8212; a file containing all the important kernel extensions for basic network booting.
  Its fairly uncommon to run into problems in this stage of the Netboot process, however, there are a couple specific issues that can cause kernel panics at this point. Possible problems would be:</p>
  
  <p>Not having a mach.macosx and mach.macosx.mkext file in your Netboot set</p>
</blockquote>

<p>And when checked <em>mach.macosx.mkext</em> was actually missing from the nbi&#8217;s dmg file. So I generated one using following code</p>

<p><code>
    kextcache -a ppc -m /Library/NetBoot/NetBootSP0/DeployStudioRuntime-091207-145110.nbi/ppc/mach.macosx.mkext -N -L /Volumes/DeployStudioRuntime/System/Library/Extensions/
</code></p>

<p>And my netboot imaging operation was back in business. Ahhh&#8230;. Freshly minted macs by the time I walk in tomorrow morning.</p>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2009/12/07/imaging-ppc-imacs-using-deploy-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gurmukhi on Android G1 mobile</title>
		<link>http://arvinderkang.com/2009/12/03/gurmukhi-on-mobile/</link>
		<comments>http://arvinderkang.com/2009/12/03/gurmukhi-on-mobile/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 00:23:53 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[G1]]></category>
		<category><![CDATA[gurmukhi]]></category>
		<category><![CDATA[punjabi]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2009/12/03/gurmukhi-on-mobile/</guid>
		<description><![CDATA[Update March 6, 2010 : As the unrooted phone does not allow change in the phone ROM, this would only run on rooted phone. Here are five reasons why you should root your phone. One way to do it, is &#8230; <a href="http://arvinderkang.com/2009/12/03/gurmukhi-on-mobile/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://arvinderkang.com/wp-content/uploads/2009/12/i_singh.jpg" alt="I Singh" /></p>

<p><em>Update March 6, 2010</em> : As the unrooted phone does not allow change in the phone ROM, this would only run on rooted phone. Here are <a href="http://lifehacker.com/5342237/five-great-reasons-to-root-your-android-phone" title="Five Great Reasons to Root Your Android Phone - Android rooting - Lifehacker">five reasons why you should root your phone</a>. One way to do it, is listed on <a href="http://wiki.cyanogenmod.com" title="CyanogenMod Wiki">CyanogenMod wiki</a>.</p>

<p>I use Google G1 running Android OS for my email. To enable Punjabi on android I used the following steps</p>

<ol>
<li>Download a <a href="http://guca.sourceforge.net/typography/fonts/" title="PCRC - Typography - Fonts">Unicode Punjabi font</a>.</li>
<li>Copy this font to your sdcard and rename it exactly <em>DroidSansFallback.ttf</em>.</li>
</ol>

<p>Now start Terminal Emulator and type exactly (watch the Case) the following commands, followed by enter.</p>

<pre><code>su (then wait for the superuser screen and press yes)
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
chmod 4755 /system/fonts/DroidSansFallback.ttf
dd if=/sdcard/DroidSansFallback.ttf of=/system/fonts/DroidSansFallback.ttf
reboot
</code></pre>

<p><img src="http://arvinderkang.com/wp-content/uploads/2009/12/android_punjabi.jpg" alt="Android Punjabi" /></p>

<p>Voila you should be able to read Hukamnama and emails written in Punjabi.</p>

<p><em>Thanks to <a href="http://www.android-devs.com/?p=33" title="Adding Additional Language Fonts to Android | Android Devs">Droidbot</a> for the idea</em></p>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2009/12/03/gurmukhi-on-mobile/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Leopard firewall revisited</title>
		<link>http://arvinderkang.com/2009/03/07/leopard-firewall-revisited/</link>
		<comments>http://arvinderkang.com/2009/03/07/leopard-firewall-revisited/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 21:19:13 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[ipfw]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[waterroof]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2009/03/07/leopard-firewall-revisited/</guid>
		<description><![CDATA[While bringing up firewalls for my test server, I thought of doing a little check on my machine. The logs raised both my eyebrows. Dear Google told me, I was not the only one. Leopard introduced application based firewall, while &#8230; <a href="http://arvinderkang.com/2009/03/07/leopard-firewall-revisited/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://arvinderkang.com/wp-content/uploads/2009/03/orion-aveugle-cherchant-le-soleil.jpg" alt="Orion Aveugle Cherchant le Soleil" /></p>

<p>While bringing up firewalls for my test server, I thought of doing a little check on my machine. The logs raised both my eyebrows. Dear Google told me, <a href="http://db.tidbits.com/article/9294" title="TidBITS Safe Computing: Leopard Firewall Takes One Step Forward, Three Steps Back">I was not the only one</a>.</p>

<p>Leopard introduced application based firewall, while the old ipfw still exists with just one default rule (Accept everything from everything!)</p>

<pre><code>65535 allow ip from any to any
</code></pre>

<p><span id="more-188"></span>
So with Application firewall doing its best, lets add some ipfw rules. One way to do is <a href="http://www.freebsd.org/doc/en/books/handbook/firewalls-ipfw.html" title="IPFW">making and adding new rules</a>. However Newton said &#8220;<em>Pigmaei gigantum humeris impositi plusquam ipsi gigantes vident</em>(If I have seen a little further it is by standing on the shoulders of Giants.)&#8221;</p>

<p>So I downloaded the tested <a href="http://securosis.com/2007/11/15/ipfw-rules/" title="ipfw Rules, 2007/11/15 revision | securosis.com">ipfw rule list from securosis.com</a> to start with and tweaked to my taste, and imported the file into <a href="http://www.hanynet.com/waterroof/" title="WaterRoof ipfw firewall frontend">WaterRoof</a>, an ipfw frontend.</p>

<p>To check your ipfw rules, use “sudo ipfw list“. When you’re satisfied with your rules, install them for future reboots with “Tools > Rules Configuration > Save to startup configuration” and “Tools > Startup Script > Install Startup Script”.</p>

<p>I also installed <a href="http://www.wireshark.org/" title="Wireshark: Go deep.">WireShark</a>, originally known as Ethereal, but could not get it working. However a look at network log is much more satisfactory now than before.</p>

<p>Image: Cedalion standing on the shoulders of Orion from Blind Orion Searching for the Rising Sun by Nicolas Poussin, 1658. This image is in the public domain.</p>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2009/03/07/leopard-firewall-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix install and Security talk</title>
		<link>http://arvinderkang.com/2009/03/07/postfix-install-and-security-talk/</link>
		<comments>http://arvinderkang.com/2009/03/07/postfix-install-and-security-talk/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 20:48:10 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2009/03/07/postfix-install-and-security-talk/</guid>
		<description><![CDATA[Once your OS is grown enough to play (I mean installed), you have to sit down with it and do the SECURITY TALK. A little on the philosophical side of it, I think sense of security is just a fad &#8230; <a href="http://arvinderkang.com/2009/03/07/postfix-install-and-security-talk/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://arvinderkang.com/wp-content/uploads/2009/03/father-son.jpg" alt="Father son" /></p>

<p>Once your OS is grown enough to play (I mean installed), you have to sit down with it and do the <strong>SECURITY TALK</strong>.</p>

<p>A little on the philosophical side of it, I think sense of security is just a fad and a perception. You are secure when you start feeling it, or we can keep on going paranoid tweaking it deeper and deeper, there will always exploits to to be known, more tools to be learnt, more WMDs to be discovered!</p>

<p>Always have a second plan- backup your data.</p>

<p>Lets get back to our Linux Box.</p>

<p><span id="more-185"></span>
One of the requirements that our installs are going to have is a mail server. The linux box can email me complaining it has stomach ache, or any activity that goes on it.</p>

<p>TechRepublic has an <a href="http://articles.techrepublic.com.com/5100-10878_11-5034523.html" title="Build Your Skills: Open source e-mail server setup">old, yet not obsolete article</a> for recipe indegrients of a mail server. We just need postfix.</p>

<p>After <a href="http://articles.techrepublic.com.com/5100-10878_11-5034638.html" title="Configure IT Quick: Set up a basic e-mail server with Postfix as the MTA">some reading</a> about postfix, here is the route I took</p>

<pre><code>$ sudo aptitude install postfix
</code></pre>

<p>Now head over to the <a href="http://www.postfix.org/BASIC_CONFIGURATION_README.html" title="Postfix Basic Configuration">postfix configuration documentation</a> and tweak the settings. The only change I did was to make sure that my server is relaying mail originating only from local machine.</p>

<pre><code>$ sudo vi /etc/postfix/main.cf
    mynetworks = 127.0.0.0/8
</code></pre>

<p>Save and exit. Now reload the changes.</p>

<pre><code>$ postfix reload
</code></pre>

<p><a href="http://arvinderkang.com/2009/02/27/ubuntu-install-on-xserve-g5" title="Ubuntu Install on XServe G5 | ArvinderKang.com">Remember</a>? We had put up a firewall on this box. However, nmap scan from another machine shows port 25 open (smtp being used by postfix.) Lets add some rules. User <code>--dry-run</code> to test command syntax.</p>

<pre><code>sudo --dry-run ufw deny proto tcp from 0.0.0.0/0 to xx.xx.xx.xx port 25
sudo ufw deny proto tcp from 0.0.0.0/0 to xx.xx.xx.xx port 25
</code></pre>

<p>I think, I&#8217;m not as happy with ufw. Its good for starters, however it does not have advanced flexibility. I&#8217;m going to return to <a href="http://www.shorewall.net/" title="Shoreline Firewall">Shorewall</a> within coming weeks.</p>

<p>Although linux machines hardly have the risk of being affected by viruses, still they can be threatened by trojans, worms by a vital part replaced by a <a href="http://en.wikipedia.org/wiki/Rootkit" title="Rootkit - Wikipedia, the free encyclopedia">rootkit</a>.</p>

<p><a href="http://www.chkrootkit.org/" title="chkrootkit -- locally checks for signs of a rootkit">chkrootkit</a> is a tool to locally check for signs of a rootkit.</p>

<pre><code>$ sudo aptitude install chkrootkit  
$ sudo chkrootkit
</code></pre>

<p>The run returned system not infected. Next lets install <a href="http://www.rootkit.nl/projects/rootkit_hunter.html" title="Rootkit Hunter">Rootkit Hunter</a>. .Rootkit scanner is scanning tool to ensure you for about 99.9%* you&#8217;re clean of nasty tools. This tool scans for rootkits, backdoors and local exploits.</p>

<pre><code>$ sudo aptitude install rkhunter
$ sudo rkhunter -c --skip-keypress
</code></pre>

<p>We came out clean.</p>

<p>Next I should look at <a href="http://www.novell.com/linux/security/apparmor/" title="AppArmor Linux Application Security">AppArmour</a> and <a href="http://www.grsecurity.net/" title="grsecurity">GRSecurity</a>. However there are other things crying for my attention. I&#8217;ll come back to them later.</p>

<p>The security paranoids can look at <a href="http://sectools.org/index.html" title="Top 100 Network Security Tools">top 100 security tools</a>.</p>

<p>Photo credits: GD Senior @ Flickr</p>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2009/03/07/postfix-install-and-security-talk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In the town called Workflow, lived three friends &#8211; Git, CVS and Drupal&#8230;.</title>
		<link>http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/</link>
		<comments>http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 02:40:58 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[public-private keys]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/</guid>
		<description><![CDATA[Moving ahead on the new project, I decided to install a versioning system. I kinda have a crush on Git, however have not been using it regularly. So what better time to rekindle the old fire? I have used SVN &#8230; <a href="http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Moving ahead on the new project, I decided to install a <a href="http://en.wikipedia.org/wiki/Revision_control" title="Revision control - Wikipedia, the free encyclopedia">versioning system</a>. I kinda have a crush on Git, however have not been using it regularly. So what better time to rekindle the old fire?</p>

<p>I have used <a href="http://subversion.tigris.org/" title="subversion.tigris.org">SVN</a> in the past, however <a href="http://www.nongnu.org/cvs/" title="CVS - Open Source Version Control">CVS</a> is still the old faithful dog hosting <a href="http://drupal.org/" title="drupal.org | Community plumbing">Drupal</a> repositories. I wanted to concentrate on using <a href="http://git-scm.com/" title="Git - Fast Version Control System">Git</a>, while wanted easy way to update drupal installations.</p>

<p>After a number of blog reads, here is my workflow (atleast planned one&#8230;)</p>

<p><img src="http://arvinderkang.com/wp-content/uploads/2009/03/git-drupal-workflowpng.png" alt="Git Drupal Workflow.png" /></p>

<p><span id="more-182"></span>
Lets start by freeing ourselves from typing in password each time and allowing only public-private key authorization.</p>

<p><strong>Password free remote Login</strong></p>

<p>Following is more or less a shameless rip from <a href="http://www.debuntu.org/ssh-key-based-authentication" title="Secure your SSH server with Public/Private key authentification | Debian/Ubuntu Tips &amp; Tricks">this article</a> (Here for my own reference).</p>

<p>On my local machine, I already had generated ssh key-pair. However in the <code>~/.ssh/</code> folder I found id&#95;dsa, id&#95;dsa.pub pair along with id&#95;rsa, id&#95;rsa.pub pair. Hmmm!  A little digging into the man pages revealed the difference between RSA and DSA.</p>

<pre><code>$ man ssh-keygen
</code></pre>

<p>RSA uses 2048 for encryption by default and can vary, while DSA used exactly 1024.</p>

<p>Lets copy our public key to the server.</p>

<pre><code>$ scp ~/.ssh/id_rsa.pub myusername@myserver:~/
</code></pre>

<p>On my remote server</p>

<pre><code>$ mkdir ~/.ssh
$ cat id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys
$ rm id_rsa.pub
</code></pre>

<p>Lets activate the key</p>

<pre><code>$ sudo su -
# vi /etc/ssh/sshd_config
</code></pre>

<p>Edit the file ensure following options</p>

<pre><code>RSAAuthentication yes
PubkeyAuthentication yes
</code></pre>

<p>Save and quit vim. Relaod the configuration.</p>

<pre><code>$ sudo /etc/init.d/ssh reload
</code></pre>

<p>Now if we access the server from my client machine, it does not asks for a password.</p>

<p>Lets disable authentication by password, to shield brute-force attempts.</p>

<pre><code>$ sudo vi /etc/ssh/sshd_config
</code></pre>

<p>Edit the file ensure following options</p>

<pre><code>....
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
...
</code></pre>

<p>and reload SSH configuration file:</p>

<pre><code>$ sudo /etc/init.d/ssh reload
</code></pre>

<p>Thats it. A machine with a differnt private key would not be able to log in.</p>

<p>I also thought of making my official <a href="http://www.gnupg.org/" title="The GNU Privacy Guard - GnuPG.org">GnuPG/PGP Encryption key</a> and putting it up on the website. But thats for another day.</p>

<p>**Back to our main topic &#8211; Git-svn workflow **</p>

<p>(Inspired by <a href="http://www.versioncontrolblog.com/2007/08/02/upgrading-drupal-52-with-git/" title="Upgrading Drupal with Git | Version Control Blog">Version Control Blog</a>, <a href="http://toolmantim.com/articles/setting_up_a_new_remote_git_repository" title="Setting up a new remote git repository">ToolmanTim</a> and <a href="http://www.aidanf.net/blog/2008/03/28/managing-drupal-installation-cvs-and-git" title="Managing a drupal installation with cvs and git | aidanf.net">Aidanf</a>).</p>

<p>On my local machine</p>

<pre><code>$ mkdir -p ~/src
$ cd src
$ cvs -z9 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-6 drupal
$ cd drupal
$ git init
$ git add .
$ git commit -m  "The inital commit of drupal6 core presently at version 6.10"
</code></pre>

<p>Now lets login to server, where we want to host the git repository for redundancy.</p>

<pre><code>$ ssh myusername@myserver
$ mkdir -p ~/gitReps/drupal.git &amp;&amp; cd  ~/gitReps/drupal.git
$ git --bare init
$ exit
</code></pre>

<p>Back on our client machine</p>

<pre><code>$ git remote
</code></pre>

<p>Nothing returns. Good we are on right track.</p>

<pre><code>$ cat .git/config
</code></pre>

<p>Returns</p>

<pre><code>[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
</code></pre>

<p>Lets add remote repository.</p>

<pre><code>git remote add myTux ssh://myusername@myserver/home/myusername/gitReps/drupal.git
</code></pre>

<p>Now above command will return</p>

<pre><code>[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "myTux"]
    url = ssh://myusername@myserver/home/myusername/gitReps/drupal.git
    fetch = refs/heads/*:refs/remotes/myTux/*
</code></pre>

<p>Running <code>git branch</code> shows just one branch locally</p>

<pre><code>* master
</code></pre>

<p>Lets push this to our remote server</p>

<pre><code>$ git push myTux master
Counting objects: 703, done.
Compressing objects: 100% (636/636), done.
Writing objects: 100% (703/703), 1.13 MiB | 1600 KiB/s, done.
Total 703 (delta 29), reused 0 (delta 0)
To ssh://myusername@myserver/home/myusername/gitReps/drupal.git
 * [new branch]      master -&gt; master
</code></pre>

<p>That is our first drupal repository. It would only carry drupal bare-bone code. Any update to drupal-core will be applied here as follows.</p>

<p>Clone the drupal on local machine and update from drupal using cvs. Then update the git and push the changes to remote server.</p>

<pre><code>$ git clone ssh://myusername@myserver/home/myusername/gitReps/drupal.git
$ cd drupal.git
$ cvs update -r DRUPAL-6.11 -dP
$ git status
$ git add .
$ git commit -m "Drupal core updated to version 6.11"
$ git push myTux master
</code></pre>

<p>Now lets create two other seperate clone of this repository. drupal-and-modules.git would keep updates repository along with updated modules and themese. drupal-production.git would keep code ready to be deployed. (I was wondering if some workaround with using branches can solve it? Any suggestions?)</p>

<p>On the server</p>

<pre><code>$ git clone drupal.git drupal-and-modules.git
</code></pre>

<p>On client machine</p>

<pre><code>$ git clone ssh://myusername@myserver/home/myusername/gitReps/drupal-and-modules.git
$ mkdir sites/all/modules
$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d sites/all/modules/cck -r DRUPAL-6--2-1 contributions/modules/cck
$ git add .
$ git commit -m "Imported cck 6-2.1 imported"
</code></pre>

<p>Now lets push this changed drupal to drupal-and-modules.git on remote server.</p>

<pre><code>$ git remote
origin
$ git branch
* master
$ git push origin master
Counting objects: 343, done.
Compressing objects: 100% (306/306), done.
Writing objects: 100% (336/336), 375.90 KiB, done.
Total 336 (delta 37), reused 0 (delta 0)
To ssh://myusername@myserver/home/myusername/gitReps/drupal-and-modules.git
   046640c..dc5c0c3  master -&gt; master
</code></pre>

<p>This updates the drupal-and-modules.git.</p>

<p>When drupal.git is updated, drupal-and-modules.git can be updated simply by using command</p>

<pre><code>git pull
</code></pre>

<p>Similarly we can maintain a third repository with all the localization and ready for production.</p>

<p>The implementation worked fine and the workflow should work in theory. However I&#8217;m pretty sure, it will be polished as I use git more and start using rebasing and stashing.</p>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing command line MP3 player</title>
		<link>http://arvinderkang.com/2008/06/28/installing-command-line-mp3-player/</link>
		<comments>http://arvinderkang.com/2008/06/28/installing-command-line-mp3-player/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 11:28:23 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[mp3 player]]></category>
		<category><![CDATA[mpg123]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2008/06/29/installing-command-line-mp3-player/</guid>
		<description><![CDATA[mpg123 is a real time MPEG 1.0/2.0/2.5 audio player for layers 1,2 and 3. I was playing with Ruby scripts and needed a command line mp3 player which was not a resource hog. Steps I took for my OS X &#8230; <a href="http://arvinderkang.com/2008/06/28/installing-command-line-mp3-player/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://arvinderkang.com/wp-content/uploads/2008/06/mpg-123-player.png" alt="Mpg 123 Player" /></p>

<p><a href="http://www.mpg123.de/" title="mpg123, Fast MP3 Player for Linux and UNIX systems">mpg123</a> is a real time MPEG 1.0/2.0/2.5 audio player for layers 1,2 and 3.</p>

<p>I was playing with Ruby scripts and needed a command line mp3 player which was not a resource hog.</p>

<p>Steps I took for my OS X (Should work on Linux/Unix box):</p>

<p>Download the latest version from <a href="http://www.mpg123.de/download.shtml" title="mpg123: download">the website</a>.</p>

<p>Untar the archive</p>

<pre><code>tar -xvf mpg123-1.4.3.tar
</code></pre>

<p>Compile and install the player</p>

<pre><code>./configure --prefix=/usr/local/mpg123
make
make install
</code></pre>

<p>Add the path to .bash&#95;profile</p>

<pre><code>echo 'export PATH=/usr/local/mpg123/bin:$PATH' &gt;&gt; ~/.bash_profile
</code></pre>

<p>Load the new path</p>

<pre><code>source ~/.bash_profile
</code></pre>

<p>Enjoy playing music from command-line!</p>

<pre><code> mpg123 ~/Music/Bagho_Bagh_Gippy_Grewal.mp3
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2008/06/28/installing-command-line-mp3-player/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Synchronizing Nokia 6086</title>
		<link>http://arvinderkang.com/2008/06/15/synchronizing-nokia-6086/</link>
		<comments>http://arvinderkang.com/2008/06/15/synchronizing-nokia-6086/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 08:33:00 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[6086]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[isync]]></category>
		<category><![CDATA[nokia]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2008/06/16/synchronizing-nokia-6086/</guid>
		<description><![CDATA[I have a cranky old Nokia 6086. And I&#8217;m waiting for Android, just because of its open source license. Love this phone(or more appropriately &#8220;used to love&#8221;), because it used to do task &#8220;rarest in its times&#8221;. I could use &#8230; <a href="http://arvinderkang.com/2008/06/15/synchronizing-nokia-6086/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have a cranky old Nokia 6086. And I&#8217;m waiting for <a href="http://code.google.com/android/" title="Android">Android</a>, just because of its <a href="http://code.google.com/android/kb/licensingandoss.html" title="Open Source Licensing Questions - Android">open source license</a>.</p>

<p>Love this phone(or more appropriately &#8220;used to love&#8221;), because it used to do task &#8220;rarest in its times&#8221;.</p>

<p>I could use any public WiFi hotspots (My Office and my home included) and route my calls through the internet, and costing me guess what &#8211; $0 (To be precise I paid $10 for <a href="http://www.t-mobile.com/promotions/hotspotathomelearnmore.aspx">TMobile@Home</a> service.) So I could talk non-stop to all the hot chicks!! Lol!</p>

<p>However since yesterday it started to show signs of aging.</p>

<p>Long story short, I was searching for a synchronizer using bluetooth. Nokia only makes <a href="http://europe.nokia.com/A4144905" title="Nokia Europe - Nokia PC Suite - Support">PC Suite</a>. I have a Mac. And Mac has iSync which is not compatible with Nokia 6086.</p>

<p><img src="http://arvinderkang.com/wp-content/uploads/2008/06/6086-not-compatible.png" alt="6086-not-compatible" /></p>

<p><span id="more-21"></span></p>

<p>Two Google searches later, <a href="http://www.howardforums.com/showthread.php?t=1199105" title="HowardForums: Your Mobile Phone Community &amp; Resource - Nokia 6086 on Mac / iSync - Fixed">here is the solution</a> that worked for me. Here is what I did.</p>

<p>Edit the following file using any editor of your choice. I use Textmate (therefore mate), you can use Vi, Emac, nano, or <a href="http://en.wikipedia.org/wiki/Image:CTR_census_machine.JPG" title="Image:CTR census machine.JPG - Wikipedia, the free encyclopedia" rel="lightbox[21]">&#8220;I&#8217;m still a fan of Charles Babbage&#8221; editor</a>:</p>

<pre><code>sudo mate /Applications/iSync.app/Contents/PlugIns/ApplePhoneConduit.syncdevice/Contents/PlugIns/PhoneModelsSync.phoneplugin/Contents/Resources/MetaClasses.plist
</code></pre>

<p>Add the following code right after 6021 entry.</p>

<pre><code>&lt;key&gt;com.nokia.6086&lt;/key&gt;
&lt;dict&gt;
        &lt;key&gt;Identification&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;com.apple.cgmi+cgmm&lt;/key&gt;
                &lt;string&gt;Nokia+Nokia 6086&lt;/string&gt;
                &lt;key&gt;com.apple.gmi+gmm&lt;/key&gt;
                &lt;string&gt;Nokia+Nokia 6086&lt;/string&gt;
        &lt;/dict&gt;
        &lt;key&gt;InheritsFrom&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;family.com.nokia.series40.bus.bt&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;Services&lt;/key&gt;
        &lt;array&gt;
                &lt;dict&gt;
                        &lt;key&gt;ServiceName&lt;/key&gt;
                        &lt;string&gt;com.apple.model&lt;/string&gt;
                        &lt;key&gt;ServiceProperties&lt;/key&gt;
                        &lt;dict&gt;
                                &lt;key&gt;ModelIcon&lt;/key&gt;
                                &lt;string&gt;NOK6086.tiff&lt;/string&gt;
                                &lt;key&gt;ModelName&lt;/key&gt;
                                &lt;string&gt;6086&lt;/string&gt;
                        &lt;/dict&gt;
                &lt;/dict&gt;
                &lt;dict&gt;
                        &lt;key&gt;ServiceName&lt;/key&gt;
                        &lt;string&gt;com.apple.synchro&lt;/string&gt;
                        &lt;key&gt;ServiceProperties&lt;/key&gt;
                        &lt;dict&gt;
                                &lt;key&gt;MaxEMailLength&lt;/key&gt;
                                &lt;integer&gt;126&lt;/integer&gt;
                                &lt;key&gt;MaxNotesLength&lt;/key&gt;
                                &lt;integer&gt;126&lt;/integer&gt;
                                &lt;key&gt;MaxURLLength&lt;/key&gt;
                                &lt;integer&gt;126&lt;/integer&gt;
                        &lt;/dict&gt;
                &lt;/dict&gt;
        &lt;/array&gt;
&lt;/dict&gt;
</code></pre>

<p>Download <a href="http://arvinderkang.com/wp-content/uploads/2008/06/nok6086.tiff">this file</a> and copy it into the following location using cp command.</p>

<pre><code>sudo cp NOK6086.tiff    /Applications/iSync.app/Contents/PlugIns/ApplePhoneConduit.syncdevice/Contents/PlugIns/PhoneModelsSync.phoneplugin/Contents/Resources/
</code></pre>

<p>Now bite your nails twice, touch the sacred Aluminum and pray to the <a href="http://www.cnn.com/2008/WORLD/asiapcf/06/07/India.god.ap/index.html" title="Indian school names monkey god chairman - CNN.com">chairman God</a>.</p>

<p><img src="http://arvinderkang.com/wp-content/uploads/2008/06/6086-detected.png" alt="6086-detected" /></p>

<p>WooHoo!! We are ready to synchronize our address book.</p>

<p><img src="http://arvinderkang.com/wp-content/uploads/2008/06/6086-lets-sync.png" alt="6086-lets-sync" /></p>

<p><img src="http://arvinderkang.com/wp-content/uploads/2008/06/6086-sync-started.png" alt="6086-sync-started" /></p>

<p>Once imported into Address Book, I created an archive of address book with date.</p>

<p>And then I gulped down a glass of milk and resumed watching the movie <a href="http://www.amuthefilm.com" title="|| amu ||">Amu</a>&#8230;&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2008/06/15/synchronizing-nokia-6086/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->