Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# either list sinks
if test $# -eq 0; then
pacmd list-sinks | grep 'index:\|name:'
exit
fi
# or set sink
# 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
@acdimalev
acdimalev / gist:f8b003b9929aa7217857
Created June 4, 2015 21:22
Debian 8 Skype dependencies
apt-get install libxss1:i386 libqtdbus4:i386 libqtwebkit4:i386
#!/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)
#!/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
#!/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';
#!/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
#!/bin/sh
ec2din | grep $(host $1 | cut -d' ' -f4) | cut -f2
class Fixnum
def split(bits, count)
array = []
value = ord
mask = (1 << bits) - 1
count.times do
array << (value & mask)
value = value >> bits
end
array
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;