This last week has seen a few posts on the necessity, or lack thereof, for good touch typing skills.
Thursday, November 27, 2008
Typing? I'm a programmer not a secretary.
Posted by
Justin Pease
at
6:00 AM
0
comments
Links to this post
Labels: code, continued education, knowledge investment, programming, typing
Saturday, November 8, 2008
Knowing Your Languages
Posted by
Justin Pease
at
5:03 PM
0
comments
Links to this post
Saturday, September 27, 2008
Remove Gems By Prefix
If you are working with Merb or DM you know that approximately a gazillion gems are involved. When, for whatever reason, I want to remove them it is a pain to do by hand.
#!/bin/bashprefix=$1gem list --local | grep $prefix | awk '{ print $1 }' | xargs sudo gem uninstall$ remove_gem_by_prefix merb$ remove_gem_by_prefix dm
Posted by
Justin Pease
at
7:49 AM
0
comments
Links to this post
Monday, September 15, 2008
Git-O-Mator
Inspired by Rein Henrichs Hack && Ship, I have created Git-O-Mator.
new_repo foohack onhack on foohack synchack pushhack ssphack ssp -t
Posted by
Justin Pease
at
9:12 PM
1 comments
Links to this post
Saturday, September 13, 2008
Quick Remote Git Repository Creation Script
If you are using Git for your source code management, GitHub is an awesome tool. It especially shines for public projects where you freely allow others to fork your code and possibly pull patches back in.
Sometimes I'm just working on a project that I would prefer to keep in a private repository. GitHub provides paying accounts with such an option. However, I already have hosting accounts that are terribly underused. Here is a little script I use to create a remote git repository on one of my VPS accounts that I can then pull from and push to.
Prerequisites
A hosting account which you can ssh / scp into.
The Script
$ vim new_repo
#! /bin/sh
PWD=`pwd`
# You must adjust these variables for your specifc hosting account.
# Remote user you will connect as.
REMOTE_USER="admin"
# The IP address you will SSH / SCP to.
REMOTE_HOST="123.456.123.456"
# The remote path you wish to store your .git repositories in.
REMOTE_REPO_PATH="/home/admin/repos/"
if [ -d $1 ]; then
echo "EXITING: Local directory '$1' already exists."
exit 0
else
mkdir $1
cd $1
git init-db
touch README
git add .
git commit -m "Initial Repository Creation"
cd ..
git clone --bare $1/.git $1.git
echo "** Copying new repository $1.git to $REMOTE_HOST:$REMOTE_REPO_PATH"
scp -r $1.git $REMOTE_USER@$REMOTE_HOST:$REMOTE_REPO_PATH
rm -rf $1.git
rm -rf $1
echo "** Cloning locally at $PWD/$1"
git clone $REMOTE_USER@$REMOTE_HOST:$REMOTE_REPO_PATH$1.git
fi
exit 0
Or get it from GitHub
http://github.com/jpease/git-o-mator
Configuration
Once that is done, provide executable permissions.
$ chmod +x new_repo
That's it. Now if you execute:
$ ./new_repo testing
You will end up with /home/user/repos/testing.git on your remote host, and ./testing locally. From ./testing you can git push to send commits to the remote repository, and git pull to retrieve from the remote repository.
If you see room for improvement, I'm sure there is some, please leave a comment with your revision!
Posted by
Justin Pease
at
2:04 PM
2
comments
Links to this post
Saturday, August 30, 2008
Compiling Nginx on OS X Leopard in 5 minutes
I went to compile Nginx on my laptop this evening, and couldn't find a how-to for Leopard. Well at least not on the first page or 2 of search results.
Danger Weary Traveller!
Related Sites
Nginx Wiki
Official PCRE Site
Satisfy PCRE Dependency
Nginx requires PCRE to be installed. PCRE stands for Prank Calling Really is Evil, or something like that. But whatever it is, Nginx thinks it just can't live without it.
$ sudo mkdir -p /usr/local/src
$ cd /usr/local/src
$ curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.7.tar.gz
$ tar xvfz pcre-7.7.tar.gz
$ cd pcre-7.7
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd ..
Install Nginx
$ curl -O http://sysoev.ru/nginx/nginx-0.6.32.tar.gz
$ tar xvfz nginx-0.6.32.tar.gz
$ cd nginx-0.6.32
$ ./configure --prefix=/usr/local --with-http_ssl_module
$ make
$ sudo make install
Now if you ask:
$ which nginx
You should receive the answer /usr/local/sbin/nginx
If not, you probably need to add /usr/local to your PATH.
Nginx will setup a default index.html file in /usr/local/html. The default nginx.conf file will be in /usr/local/conf and will be set to serve this index.html file. To start Nginx:
$ sudo nginx
And finally, to see the fruits of your labors open your favorite browser and navigate to http://localhost
Next you get to configure Nginx to serve up whatever it is you want to serve. But that search query will already provide you with many, many results...
Posted by
Justin Pease
at
7:43 PM
0
comments
Links to this post
Wednesday, July 16, 2008
The Real Goal of Education
Is education about memorizing facts? No, it's about learning to learn. It's about learning how to think.
"...developers today code in something called Python, but when I was in school C was all the rage. The need for reasoning, though, remains constant..." - Our Googley advice to students: Major in learning
Posted by
Justin Pease
at
8:45 AM
1 comments
Links to this post