A A

Tag Archive | "bash"

Bash Tips for Power Users

Wednesday, June 10, 2009

2 Comments

Every Geek site needs an obligatory Bash Tips post Copy Files Securely Between Two Machines I used to always forget the syntax for this, until I realized that the syntax is exactly like the standard cp command. In fact, you can copy files like you normally would using scp, on your local machine. The following are equivalent: $ [...]

Calculate Your GPA Using this Bash Script

Thursday, May 21, 2009

0 Comments

This Bash script is used to calculate your Grade Point Average (GPA) on the command line. Usage might not be intuitive. Please see the usage function or just run the script without passing it any arguments. The gval function should be edited to reflect your own region or university. It has been written and tested on [...]

Bash Script to Force an Empty Git Push

Wednesday, April 1, 2009

0 Comments

Sometimes, like when you’re testing hooks or trying to create synced remote and local repos, you’ll find yourself touching empty files just to get a git push going. This script automates this task by creating a unique temporary file, committing it, pushing, and then removing the file. #!/bin/sh TMP=tmp-`date +'%m%s'` touch $TMP git add $TMP git commit $TMP -m '(forced [...]

How to Maintain Static Sites with Git & Jekyll

Tuesday, March 31, 2009

4 Comments

Static sites in this context just means non-database driven sites. Your static site can be an elaborate PHP script or just a few markup and image files. For this I am using Jekyll – A neat Ruby gem that makes your static sites dynamic. It lets you create layouts and embed custom variables in your [...]