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 | |
for line in $(iostat $(dmsetup ls | sed -n '/swap/{ s/.*, //; s/)//; s/^/dm-/; p; }') | sed 's/\s\+/,/g'); do | |
if (echo $line | grep ^dm- >/dev/null 2>&1); then | |
dm=$(echo $line | cut -d, -f1 | cut -d- -f2); | |
dname=$(dmsetup info -c --noheadings -j 253 -m $dm | cut -d: -f1); | |
echo $line | | |
sed "s/^dm-$dm/$dname/; s/,/\t\t/g;"; | |
else | |
echo "$line" | sed 's/,/\t\t/g;'; | |
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
#!/bin/bash | |
#% Title: gt-topio | |
#% Author: Eric Windisch | |
#% License: MIT | |
# default value... | |
count=20 | |
filter='.' | |
set -- `getopt c:d:e: $@` >/dev/null 2>&1 |
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 | |
for i in $(seq 0 1024); do x=$(cut -d/ -f3 <(xenstore-read /local/domain/$i/vm 2>/dev/null)); if [ $x ] && [ $x == $(cat /sys/hypervisor/uuid) ] ; then xenstore-ls /local/domain/$i ; fi ; 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
#!/bin/bash | |
#% Title: gt-topiosar | |
#% Author: Eric Windisch | |
#% License: MIT | |
# default value... | |
count=20 | |
#expr="p;" | |
filter='.' |
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
# AGPLv3, Eric Windisch. GrokThis.net / VPS Village.com | |
# This is an snippet / extract from a larger application. | |
# I don't necessarily expect this to work all on its lonesome. | |
use Locale::TextDomain ('CloudShell'); | |
our $ginterp; | |
our %interpcache; | |
my $prompt; | |
# Execute main subroutine, unless we're being subclassed... |
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
print "Importing." | |
from pprint import pprint | |
from urllib2 import urlopen | |
from bs4 import BeautifulSoup | |
# LinkedIn API code | |
import re | |
from ConfigParser import SafeConfigParser | |
import oauth2 as oauth |
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 | |
# | |
# Copyright (c) 2012 Eric Windisch <[email protected]> | |
# | |
# 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 | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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 | |
import sys | |
def calc_tax(agi, multiplier=1): | |
tax=0 | |
table = { | |
0: [ 17400, 10 ], | |
17400: [ 70700, 15 ], | |
70700: [142700, 25 ], | |
142700: [ 217450, 28 ], |
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
# vim: tabstop=4 shiftwidth=4 softtabstop=4 | |
# Copyright 2011 OpenStack LLC. | |
# Copyright 2010 United States Government as represented by the | |
# Administrator of the National Aeronautics and Space Administration. | |
# All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at |
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 python2.7 | |
def mkboard(seed): | |
columns = {} | |
# Need not be efficient while seed is small. | |
for i in seed: | |
column = set() | |
while seed[i].count(1) > 0: | |
e = seed[i].index(1) |
OlderNewer