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/sh | |
# either list sinks | |
if test $# -eq 0; then | |
pacmd list-sinks | grep 'index:\|name:' | |
exit | |
fi | |
# or set sink |
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
# need Cisco WebEx on 64-bit Debian? | |
apt-get install libxmu6:i386 libxtst6:i386 libxt6:i386 libasound2:i386 libxv1:i386 libuuid1:i386 openjdk-7-jre-headless:i386 |
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
apt-get install libxss1:i386 libqtdbus4:i386 libqtwebkit4:i386 |
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 python | |
from lxml import etree | |
doc = etree.parse("http://www.8bitpeoples.com/feed/feed.rss") | |
links = doc.xpath("//link/child::text()") | |
albums = [link[-6:] for link in links if 'discography' in link] | |
print "\n".join(albums) |
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 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
class Array | |
alias :_old_index_op :[] | |
def [] a | |
if a.is_a?(Regexp) then |
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 perl -w | |
sub foo() { | |
$pw = `pwgen -ABn 4 1`; | |
($a, $b, $c, $d) = unpack('cccc', $pw); | |
$dom[0] = pack('cccc', $a, $b, $c, $d) .'.com'; | |
$dom[1] = pack('cccc', $b, $a, $c, $d) .'.com'; | |
$dom[2] = pack('cccc', $a, $c, $b, $d) .'.com'; | |
$dom[3] = pack('cccc', $a, $b, $d, $c) .'.com'; |
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 'rubygems' | |
dep = Gem::Dependency.new '', Gem::Requirement.default | |
specs = Gem.source_index.search dep | |
specs.each do |spec| | |
print "gem install #{spec.name} -v #{spec.version} --no-rdoc --no-ri\n" | |
end |
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/sh | |
ec2din | grep $(host $1 | cut -d' ' -f4) | cut -f2 |
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
class Fixnum | |
def split(bits, count) | |
array = [] | |
value = ord | |
mask = (1 << bits) - 1 | |
count.times do | |
array << (value & mask) | |
value = value >> bits | |
end | |
array |
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
int allocate(blocks *b) { | |
int i; | |
i = (b->index + 1) % b->size; | |
while (i != b->index) { | |
if (b->map[i] == 0) { | |
b->map[i] = 1; | |
b->index = i; | |
return i; | |
} | |
i = (i + 1) % b->size; |
OlderNewer