April 15, 2017

git branching strategy for most project i do


December 18, 2013

Bash: about .bashrc, .bash_profile, .profile, /etc/profile, etc/bash.bashrc and others


  • http://stackoverflow.com/questions/415403/whats-the-difference-between-bashrc-bash-profile-and-environment
  • http://stackoverflow.com/questions/6372751/what-is-the-difference-between-the-various-shell-profiles
  • http://unix.stackexchange.com/questions/40708/what-is-the-difference-between-profile-bashrc-bash-profile-gnomer
  • http://superuser.com/questions/183870/difference-between-bashrc-and-bash-profile


May 7, 2013

Create/Push/Track new branch in git

Create New branch : git checkout -b your_branch
Push and track new branch you just created, git push -u origin your_branch
Now if you check your git configuration file you should see: 
[branch "your_branch"] remote = origin merge = refs/heads/your_branch

October 20, 2010

Connecting to a Cisco IPSEC VPN from Linux — without the Cisco client

So, let’s say your workplace uses a Cisco IPSEC VPN solution. Many places do. Let’s also say you at home have a Linux machine. Being the good Linux user that you are, you keep your system well patched and run a recent kernel release.

You download the Cisco VPN client — from your corporate website since, of course. Cisco would never make such a thing publicly downloadable.. who does that anyway?

You extract the tarball, run the vpn_install script as instructed and BAM. The whole thing bombs! Why? Because your system is too cutting edge for the guys at Cisco to keep up (clearly!). So, your possible solutions are:

1. Dig through a bunch of random internet forums, searching for the right combination of patches and command incantations that will make the damn thing work on your particular OS and kernel version.
2. Ditch the piece of junk altogether and install something nicer.

So which should we do? Alright.. let’s go with option 1… just kidding, I mean 2.

Enter a wonderful piece of software called vpnc. Now, I’ll be the first to admit I don’t know much about how this particular piece of software works. And that’s the great thing. Getting the VPN connection up and going was just that simple. So here’s how:

1. I presume your company uses a PCF file along-side their Cisco VPN client. If not, you have to figure out how to enter the settings yourself. Download this .pcf file and put it somewhere. Say ~/mycompany.pcf
2. Download http://svn.unix-ag.uni-kl.de/vpnc/trunk/pcf2vpnc
3. Install vpnc. If you use Ubuntu, this means aptitude install vpnc. Yes, that is all.
3. Run pcf2vpnc mycompany.pcf mycompany.conf
4. cp mycompany.conf /etc/vpnc/
5. sudo vpnc mycompany
6. There is no step 6!

Oh yeah, at some point you want to disconnect and go do something else other than work. For that use sudo vpnc-disconnect.

I tested this on Ubuntu 10.04, results may vary between distributions.

When running pcf2vpnc you may receive the following message:

Can't exec "cisco-decrypt": No such file or directory at ./pcf2vpnc line 30.
cisco-decrypt not in search path,
adding passwords in obfuscated form

This just means that your vpn configuration will contain your password in obfuscated form instead of plaintext, it does not mean the conversion failed.

Update Oct 19, 2010:
If you receive an error message such as
vpnc: no response from target

you need to add the line

NAT Traversal Mode cisco-udp

to your mycompany.conf file.

March 11, 2009

If - Rudyard Kipling

If
By Rudyard Kipling

If you can keep your head when all about you
Are losing theirs and blaming it on you;
If you can trust yourself when all men doubt you,

But make allowance for their doubting too:
If you can wait and not be tired by waiting,
Or, being lied about, don't deal in lies,
Or being hated don't give way to hating,
And yet don't look too good, nor talk too wise;


If you can dream -- and not make dreams your master;
If you can think -- and not make thoughts your aim,
If you can meet with Triumph and Disaster
And treat those two impostors just the same:
If you can bear to hear the truth you've spoken

Twisted by knaves to make a trap for fools,
Or watch the things you gave your life to, broken,
And stoop and build 'em up with worn-out tools;

If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,

And lose, and start again at your beginnings,
And never breathe a word about your loss:
If you can force your heart and nerve and sinew
To serve your turn long after they are gone,
And so hold on when there is nothing in you

Except the Will which says to them: "Hold on!"

If you can talk with crowds and keep your virtue,
Or walk with Kings -- nor lose the common touch,
If neither foes nor loving friends can hurt you,

If all men count with you, but none too much:
If you can fill the unforgiving minute
With sixty seconds' worth of distance run,
Yours is the Earth and everything that's in it,
And -- which is more -- you'll be a Man, my son!