The world is my backyard.
Random header image... Refresh for more!

Category — Programming

Upload recipe using Net::SCP

Sharing a simple ruby recipe to automate uploads of static website, if rsync is giving you problems(like with my school web server). This script uses Net::SCP.

Net::SCP is a pure-Ruby implementation of the SCP protocol. This operates over SSH (and requires the Net::SSH library), and allows files and directory trees to copied to and from a remote server.

This solution lies somewhere between manually uploading and fully automation using Capistrano or Vlad.

November 1, 2009   1 Comment

Automating Drupal workflow using Git and Drush

Update Nov 11, 2009: Updated the script to accept username and server name as arguments and to print syntax help if no argument is passed. It would eliminate to modify script for different servers.

Drupal rocks for some things, its deployment sucks! As I automate my drupal workflows better, I should post them one by one.

Following is the my bash script recipe, for installing drupal, checking it into a git repository and replicating it remotely.

The second piece of puzzle should be automating MySQL backup and deployment using either Capistrano or Vlad.

[Read more →]

October 29, 2009   3 Comments

Installing Scala on Snow Leopard

These are instructions for quickly installing Scala. Scala is a general purpose language almost completely interoperable with Java, and having features of object-oriented and functional languages.

I installed Scala in /usr/local , the reason for which can be found here.

[Read more →]

September 1, 2009   No Comments

A simple shell trick

Here is shell a trick that I used lately.

Before moving to new system (where I enforce quotas on all home folders), I had portable home directories for all the users on my shared server storage. The old setup did not strictly apply the quota limits on all users. Some of the users had large home folders and a couple of them logging on different systems, would fill up the whole hard disk on that system.

Two find how much space each user was using on the server, I ran the following command in their home directory.

$ du -chd -1 > $HOME/user_space_report.txt

Simple.

August 20, 2008   No Comments

Git Configurations

I have started using Git over Subversion. Following is the list of my git configurations.

[Read more →]

August 5, 2008   No Comments

curl vs wget

Linux mac

Coming from Linux background, while working on OS X shell, I still cannot abandon my old Linux habits. A common one is trying to use wget instead of curl for downloading stuff.

Just out just curiosity, I was wondering why OS X supports curl, but no wget in the OS.

I came across this interesting page doing comparison of the two.

August 2, 2008   No Comments

Installing RMagick on OS X Leopard

Rmagick Clown

I work with Ruby on Leopard and and I need RMagick.

If you are a programmer and don’t know what RMagick is, you should know how code can melt your picture into art in Ruby:).

[Read more →]

August 1, 2008   2 Comments

Git remote pushing

For the last half an hour I have been playing with Git. Project I’m working on my laptop is version tracked by git. However what is the fun of using version control without a remote server.

As soon as I pushed my project directory to my remote OS X Tiger server, I got the following error.

    bash: line 1: git-receive-pack: command not found
    fatal: The remote end hung up unexpectedly

Google comes to rescue.

    Many installations of sshd do not invoke your shell as the login shell when you directly run programs; what this means is that if your login shell is bash, only .bashrc is read and not .bash_profile. As a workaround, make sure .bashrc sets up $PATH so that you can run git-receive-pack program.

Running following two lines solved the problem.

echo export PATH=/usr/local/bin:$PATH >> ~/.bashrc
source ~/.bashrc

July 19, 2008   2 Comments

What goes where? Filesystem hierarchy in Unix/Linux/OS X

Unix Filesystem Hierarchy

Although it is one of the first chapters one read when starting with Linux/Unix, it is always confusing where should we put what when it comes to installing stuff on Linux/OS X computers.

I found a detailed reference Filesystem Hierarchy standard website.

It is also worth knowing, why is it important to store any new customized apps in /usr/local.

July 19, 2008   1 Comment

Using Git on Rails project

After watching Linus Torvalds speaking for Git, and the popularity of Github, I am giving git a try. I have been using Subversion for a while, so things moved pretty smoothly.

[Read more →]

July 18, 2008   No Comments