I seem to preach a lot about automation for productivity, and with good reason. You should not have to perform mundane tasks repeatedly. Crontab is a fantastic tool for simply running exactly what you want at times you specify.
Fire up your terminal or Cygwin now.
crontab tutorial
Suppose I want to copy my personal wiki to my website every other hour between 8:30 and 18:30 on weekdays only. This only takes a couple minutes to setup with a bit of cron-fu.
I’m going to go ahead and use FTP to put my wiki where I want, so I wrote a quick bash script (backup_wiki.sh) for this purpose:
[code language="bash"]
#!/bin/bash
# File: backup_wiki.sh
HOST='mysite.com'
USER='myuser'
PASS='mypassword'
ftp -n ${HOST} <
quote USER ${USER}
quote PASS ${PASS}
put path/to/my/wikifile.html wikifile.html
bye
END_SCRIPT
exit 0
[/code]
Sweet, so now we can just use backup_wiki.sh
Let's edit (or create) our new crontab file:
[code language="bash"]
crontab -e
[/code]
This brings up vi (by default) with a file that may have a comment or may be empty. I don't feel like using vi right now, so I'll change it to jEdit by adding the following to my .bashrc file:
[code language="bash"]
export EDITOR="[/path/to/jedit.bat (windows) or 'jedit' (*nix)]"
[/code]
Ah, that's better. Now that we can open it up in our fav. text editor, let's learn how to create an entry in our crontab file. Continue reading →
I’ve been getting questions from co-workers and friends about how I have my desktop setup so I can get to any application I need quickly. I’ve been flattered by a few people adopting variations of my setup, and realized that I should share it just in case it might benefit some of my readers.
I know that your needs are different than mine, so pick off what you like. I’m happy to give quick setup guides for anyone that asks.
First things first: 2 Monitors
For as small of a cost as an additional monitor is, I’m disappointed that more employers don’t provide a multi-monitor setup for their developers.
Do the math: if you get an extra monitor for $250US and it increases your efficiency by even 1%, it pays for itself in 6 months or less!
Anyway, I have a somewhat typical laptop + monitor setup, and the extra screen real estate is quite helpful, especially since I can keep my browser on one monitor always and then move to all my other applications with a keystroke. Nothing too special there, but the point here is play the smart money card to get a multi-monitor setup if you can.
Desktops: 4-5 wide, 1 deep
Linux definitely makes it easier on me since I get multiple desktops built-in. Obviously, you can use Spaces on a Mac or VirtuaWin on Windows (and I do) to get the ability. Continue reading →
There are two main aspects to enhancing programming productivity, and they are what I like to call physical (decrease actual human activity) and mental (knowing the smartest way to accomplish a task) types. Humans are slow, so I want to help you prevent that slowness from killing your face-melting programming dreams.
Stop typing so much!
One great way to enhance your physical productivity is, obviously, to type less. You know what you want to do and it should take no time for you to tell your computer to do it. On the command-line, we can do this most easily with smart aliases, and perhaps creating functions that streamline our tasks for us so that we can accomplish this.
I’m going to share with you a few techniques I use to cut the number of keystrokes I type significantly while boosting my efficiency, so break out Cygwin or your favorite terminal and let’s get started.
Find out what commands you use most frequently
Here is a quick command you can use to figure out the 10 most used commands in your history (learned from lifehacker’s post):
Continue reading →