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
#!/bin/bash | |
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy | |
echo 5 > /proc/sys/vm/laptop_mode | |
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs | |
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/python | |
import httplib | |
import httplibfrom operator import itemgetter | |
import re | |
def get_webpage(site,page): | |
conn = httplib.HTTPConnection(site) | |
conn.request("GET", page) | |
rd = conn.getresponse() | |
print rd.status, rd.reason |
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
#!/bin/bash | |
START=`pwd`; | |
script=$START"/hyperliskLOC.php"; | |
cd /tmp/; | |
svn co http://wiki.csc.calpoly.edu/blugoo/svn/trunk/ | |
cd trunk; | |
for i in $(seq 820 972); | |
do | |
svn up -r $i > /dev/null; |
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
curl -d 'track=one line' http://stream.twitter.com/track.json -uonelinebot:one.onelinebot > tweets.json 2> /dev/null & tail -f tweets.json | \ | |
while read tweet; do echo $tweet | \ | |
grep -E -o '"screen_name":"[[:alnum:]]+"' | cut -d '"' -f 4 | while read screen_name; do \ | |
echo "following: $screen_name"; curl -d '' http://twitter.com/friendships/create/$screen_name.json?follow=true -uonelinebot:one.onelinebot; \ | |
done ; \ | |
done |
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
DROP TABLE IF EXISTS `user_history`; | |
CREATE TABLE `user_history` ( | |
`historyid` int(10) unsigned NOT NULL auto_increment, | |
`userid` int(10) unsigned NOT NULL, | |
`delta` int(11) NOT NULL, | |
`rewarded` int(11) NOT NULL, | |
`date` int(11) NOT NULL, | |
`doctype` enum('wiki_revisions','guide_translation_revisions','guide_step_revisions','user_success','comments','posts','user_badges','user_votes','users') default NULL, | |
`docid` int(10) unsigned default NULL, | |
`event` varchar(255) default 'default', |
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
RewriteEngine On | |
# Map / to /_site. | |
RewriteRule ^$ /_site/ [L] | |
# Map /x to /_site/x | |
RewriteCond %{REQUEST_URI} !^/_site/ | |
RewriteRule ^(.*)$ /_site/$1 | |
# Add trailing slash to directories without them so DirectoryIndex works. |
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
<?php | |
/** | |
* Regex's a twitter message to make it have links like all the cool kids. | |
* | |
* ex. | |
* @username = http://twitter.com/username | |
* #hashtag = http://twitter.com/search?q=%23hashtag | |
* http://something = <a href.... | |
* | |
* @author Nat Welch |
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
# Mounts an iso to a folder | |
# usage ./mountiso.sh temp.iso mountpoint/ | |
if [ $# -ne 2 ]; then | |
echo "Mounts an iso to a folder"; | |
echo "Usage: $0 <iso> <mountpoint>"; | |
else | |
echo "running mount -o loop -t iso9660 $1 $2"; | |
mount -o loop -t iso9660 $1 $2; | |
fi |
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
[Thu Dec 24 03:24 PM] | |
[nat@arclight ~/Projects/erasmus]$ rake --trace | |
(in /home/nat/Projects/erasmus) | |
** Invoke default (first_time) | |
** Invoke test (first_time) | |
** Invoke check_dependencies (first_time) | |
** Execute check_dependencies | |
All dependencies seem to be installed. | |
** Execute test | |
/usr/bin/ruby -Ilib:lib:test "/usr/lib/ruby/1.9.1/rake/rake_test_loader.rb" "test/erasmus_test.rb" |
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
------------------------------------------------------------------------- | |
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005 | |
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5 | |
Latest version of this file (in English) is usually at: | |
http://sed.sourceforge.net/sed1line.txt | |
http://www.pement.org/sed/sed1line.txt | |
This file will also available in other languages: | |
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html |