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
# Credits go to: | |
# https://www.facebook.com/permalink.php?id=120707754619074&story_fbid=389700354386478 | |
# Fixed spacing (posting python on facebook is gr8 idea guys) | |
# Added generating passwords. | |
from hashlib import md5 | |
import random | |
itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' |
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
words = [ | |
'Alfa', | |
'Bravo', | |
'Charlie', | |
'Delta', | |
'Echo', | |
'Foxtrot', | |
'Golf', | |
'Hotel', | |
'India', |
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
// ==UserScript== | |
// @name Bitbucket show merge commandline | |
// @namespace http://www.romke.net/static/grease/bb-pull-merge | |
// @description show merge commandline | |
// @include https://bitbucket.org/*/pull-request/* | |
// @grant none | |
// @version 1 | |
// ==/UserScript== | |
if (! document.getElementsByClassName("conflicts-detected")[0].classList.contains("conflicts") && |
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
sub gen_colors { | |
my $total = shift; | |
my @colors = (); | |
# round up to even number of colors: | |
$total = floor($total/2+1)*2; | |
# but divide by 1 more so first and last is different: | |
my $step = 360 / ($total+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
. virtualenv/bin/activate | |
sudo apt-get install scons libexiv2-dev libboost-dev libboost-python-dev | |
mkdir build | |
cd build | |
wget http://launchpad.net/pyexiv2/0.3.x/0.3.2/+download/pyexiv2-0.3.2.tar.bz2 -O-| tar -xpvj | |
cd pyexiv2* | |
scons | |
scons install |
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/ruby | |
# Pulseaudio volume control | |
class Pulse | |
attr_reader :volumes, :mutes | |
# Constructor | |
def initialize | |
dump = `pacmd dump`.lines | |
@volumes = {} |
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
def get_form_dict(form): | |
data = {} | |
for name, field in form.fields.items(): | |
bf = BoundField(form, field, name) | |
data[form.add_prefix(name)] = unicode(bf.value() or '') | |
return data |
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
{ | |
*************************************************** | |
* A binary compatible SHA1 implementation * | |
* written by Dave Barton ([email protected]) * | |
*************************************************** | |
* 160bit hash size * | |
*************************************************** | |
} | |
unit SHA1; |
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: set ts=2 sw=2 et : | |
# | |
# load_data loads varibles from external yaml file. | |
# | |
# EXAMPLE 1: | |
# data.yaml: | |
# -- | |
# host1.client.com: | |
# abc: def | |
# foo: bar |
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
module MCollective | |
module Agent | |
class Mysql<RPC::Agent | |
metadata .... | |
action "createdb" do | |
status = 'Unknown' | |
begin | |
>> code that fails for unknown reason << | |
rescue StandardError => e |
NewerOlder