This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Output lines 100 and 101 from a large gzipped file. | |
# '102q' causes sed to exit immediately upon line 102 which prevents | |
# zcat from continuing to cat the file after the lines we want. | |
zcat large_file.gz | sed -n '102q;100,101p' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create your very own Kim Jong Il funeral magic! | |
# Requires ImageMagick. | |
# OS X: brew install imagemagick | |
# Ubuntu: sudo apt-get install imagemagick | |
# | |
# Background image from Dustin Fenstermacher via http://gawker.com/5871682/give-yourself-a-dictators-funeral-with-this-kim-jong+il-photoshop-template | |
abort 'usage: jongify.rb image_file' unless ARGV.size == 1 | |
original_image = ARGV[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libyaml-dev | |
gem instal psych | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SHK.m | |
// ShareKit | |
// | |
// Created by Nathan Weiner on 6/10/10. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'time' | |
require 'real_growl' | |
require 'progressbar' | |
INCREMENTS=100 | |
class TimeFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm a Python newb so YMMV. Python 2.6 64-bit is installed by default and wxPython doesn't play nicely with it, so install 2.7 and the unstable version of wxPython. | |
1. Install Python 2.7: http://www.python.org/ftp/python/2.7/python-2.7-macosx10.5.dmg | |
2. Install development wxPython binary "wxPython2.9-osx-cocoa-py2.7" from http://www.wxpython.org/download.php#unstable | |
3. Install numpy: http://www.scipy.org/Installing_SciPy/Mac_OS_X | |
4. Download pyspread and edit the following: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#start,end (note: not zero indexed) | |
sed -n "1,100p" org_file > new_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resque.after_fork do |job| | |
# How many jobs should we process in each fork? | |
jobs_per_fork = [ ENV['JOBS_PER_FORK'].to_i, 1 ].max | |
# Set hook to nil to prevent running this hook over | |
# and over while processing more jobs in this fork. | |
Resque.after_fork = nil | |
# Make sure we process jobs in the right order. | |
job.worker.process(job) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create a truecrypt file (follow the setup script) | |
sudo truecrypt -t -c test.tc | |
#mount TC volume | |
sudo mkdir /mnt/tc | |
sudo truecrypt test.tc /mnt/tc | |
#dismount | |
sudo truecrypt --dismount /mnt/tc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#verify drive is seen by system | |
cat /proc/scsi/scsi | |
#determine which device it is | |
dmesg | grep sd | |
#mount | |
mount /dev/sdc1 /mnt/usb | |
#or to be extra safe |