pomodoro cheat sheet

downloaded from Francesco Cirillo's (the creator of the Pomodoro Technique) website http://www.pomodorotechnique.com/ check there for even more Pomodoro related goodies. There is also an excellent book by describing the Pomodoro Technique in detail available as a free download here http://www.pomodoro-book.com/ 

(download)


python script template


#!/usr/bin/env python
"""
Some documentation:
Usage:
-h help
-r results file
"""
# Import libraries
import sys
import getopt
 
def process(arg):
  if arg.endswith(".results"):
   print_results(arg)
  else:
   print arg, "not recognized :'("
 
class Usage(Exception):
  def __init__(self, msg):
   self.msg = msg
 
def main(argv=None):
  if argv is None:
   argv=sys.argv
   try:
   # parse command line options
   try:
   opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
   except getopt.error, msg:
   raise Usage(msg)
   # process options
   for o, a in opts:
   if o in ("-h", "--help"):
   print __doc__
   return 0
   # process arguments
   for arg in args:
   process(arg)
   except Usage, err:
   print >> sys.stderr, err.msg
   print >> sys.stderr, "for help use -help"
   return 2
 
if __name__ == "__main__":
  sys.exit(main())

spotlight on linux

if you use a mac and have made spotlight part of your workflow GNOME + Do (http://do.davebsd.com/) is really worth a look

creating a bootable usb drive from a .img file on OSX

From https://help.ubuntu.com/community/Installation/FromImgFiles:

  • Download the desired .img file
  • Open a Terminal (under Utilities)
  • Run diskutil list to get the current list of devices
  • Insert your flash media
  • Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2)
  • Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2)
  • Execute sudo dd if=/path/to/downloaded.img of=/dev/diskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img). If you see the error dd: Invalid number `1m', you are using GNU dd. Use the same command but replace bs=1m with bs=1M.
  • Run diskutil eject /dev/diskN and remove your flash media when the command completes

copying files with rsync

rsync is a great way to copy files between computers as it can continue after partial copies and update directories when only a few files have changed, it also supports secure file copies over ssh as shown below:

copy files locally:

rsync -rtvzP --delete --exclude=.Trash /Users/evan/ /Volumes/backup/evan/

copy local files to a remote computer excluding all the mac .DS_Store folders in the path:

rsync -ravzP --exclude=**/.DS_Store -e ssh "/Users/evan/my files/" evan@someserver.codepit.ca:/home/evan/files/

copy remote files onto a local computer:

rsync -ravzP -e ssh 10.10.238.123:"/home/evan/my files/" /Users/evan/files/

NOTE the use of " when there is are spaces in the file paths

Useful switches:

-n == dry run, very useful with --delete :o
--delete == delete files when they are missing from the source computer and present on the target