This file contains hidden or 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 perl | |
use strict; | |
use warnings; | |
use Sys::Hostname; | |
require 'sys/ioctl.ph'; | |
main(@ARGV); | |
sub main { |
This file contains hidden or 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
# put these in ~/.config/fish/functions/fish_user_key_bindings.fish | |
function bind_bang | |
switch (commandline -t) | |
case "!" | |
commandline -t $history[1] | |
commandline -f repaint | |
case "*" | |
commandline -i ! | |
end |
This file contains hidden or 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 | |
# A wrapper script for sdcv which provides line spacing and wrapping to improve | |
# readability. | |
# | |
# Please note: sdcv(1) relies on dictionary files being in | |
# /usr/share/stardict/dic | |
# $(HOME)/.stardict/dic | |
usage() { |
This file contains hidden or 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
if ( window.addEventListener ) { | |
var pressed_keys = []; | |
var cheat = "38,38,40,40,37,39,37,39,66,65"; | |
window.addEventListener("keydown", function(e){ | |
pressed_keys.push( e.keyCode ); | |
if ( pressed_keys.toString().indexOf( cheat ) >= 0 ) { | |
// User entered the cheat - do something HILARIOUS | |
pressed_keys = []; // wipe the keys | |
} | |
}, true); |
This file contains hidden or 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
ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | |
sudo kill -HUP `ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}'` |
This file contains hidden or 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
[ec2-user@hop ~]$ curl --head http://people.com.cn/ | |
HTTP/1.0 200 OK | |
Server: nginx | |
Date: Mon, 14 Feb 2011 16:22:31 GMT | |
Content-Type: text/html | |
Content-Length: 152319 | |
Last-Modified: Mon, 14 Feb 2011 16:18:17 GMT | |
Vary: Accept-Encoding | |
Accept-Ranges: bytes | |
X-Cache: MISS from www21.people.com.cn |
This file contains hidden or 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
HTTP GET URIs in the form of: | |
http://gdata.youtube.com/feeds/api/videos/-/{http://gdata.youtube.com/schemas/2007/keywords.cat}tag?author=username | |
Examples: | |
Videos uploaded by user BBCWorldwide with tag "wildlife": | |
http://gdata.youtube.com/feeds/api/videos/-/{http://gdata.youtube.com/schemas/2007/keywords.cat}wildlife?author=BBCWorldwide |
This file contains hidden or 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 python | |
from optparse import OptionParser | |
import sys, csv, os.path, random | |
def main(): | |
usage = "usage: %prog [options] arg" | |
parser = OptionParser(usage) | |
parser.add_option("-t", "--template", dest="filename", | |
help="use FILENAME as CSV template") |
This file contains hidden or 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 perl | |
sub toss( $ ); # prints coin toss results for $ coins | |
if( !defined($ARGV[0]) ) | |
{ | |
# If there was no command line argument | |
print "Number of coins not specified - using default number: 3\n\n"; | |
toss( 3 ); | |
} |
This file contains hidden or 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 | |
function sleepsort() { | |
sleep "$1" | |
echo "$1" | |
} | |
while [ -n "$1" ]; do | |
sleepsort "$1" & shift | |
done | |
wait |
OlderNewer