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 json | |
import sys | |
def pp(vv, prefix='$'): | |
if isinstance(vv, (list,tuple)): | |
for i, v in enumerate(vv): | |
pp(v, "{0}[{1}]".format(prefix, i)) | |
elif isinstance(vv, dict): |
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 | |
# | |
# This script activates a Gem Bundler environment in current shell | |
# session. This lets you type commands without `bundle exec` all the | |
# time, even if you leave the project's directory, and without complex | |
# magic that runs with every command. | |
# | |
# Usage: save this file somewhere. Use following command to activate | |
# current directory's bundle in current shell session: | |
# |
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 | |
# | |
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
# Version 2, December 2004 | |
# | |
# Copyright (C) 2013 Maciej Pasternacki <maciej@pasternacki.net> | |
# | |
# Everyone is permitted to copy and distribute verbatim or modified | |
# copies of this license document, and changing it is allowed as long | |
# as the name is changed. |
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
require 'fileutils' | |
require 'open-uri' | |
require 'yaml' | |
require 'rubygems' | |
require 'nokogiri' | |
FileUtils.mkdir_p 'items' | |
feed = Nokogiri::XML(File.open('3fc1319c496ea1aacde451cecbdc17e3.rss')) |
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
xkb_keymap { | |
xkb_keycodes { include "xfree86+aliases(qwerty)" }; | |
xkb_types { include "complete" }; | |
xkb_compat { include "complete" }; | |
xkb_symbols { | |
include "pc+pl+ctrl(swap_lwin_lctl)+ctrl(swap_rwin_rctl)" | |
replace key <UP> { | |
type[Group1]= "THREE_LEVEL", | |
symbols[Group1]= [ Up, Up, NoSymbol ], | |
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<PGUP>, clearMods=Mod5) ] |
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
from django.conf import settings | |
from django.core.management.base import BaseCommand | |
#### pyflakes.scripts.pyflakes, modified: | |
## - return array of warnings instead of printing them | |
## - honour pyflakes:ignore comments | |
import compiler, sys | |
import os | |
import pyflakes.checker |
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
# Chef resources describing how to set up package repository server, | |
# simplified fromactual cookbook (not open sourced yet). Sets up apt | |
# repository in /srv/apt directory, with system user "apt-repo". Packages | |
# are GPG-signed to prevent apt-get from complaining on every install. | |
# | |
# Directory /srv/apt should be reachable to clients via http or other | |
# means. This is left as an exercise for the reader. | |
# | |
# For extra explanations, see: | |
# http://joseph.ruscio.org/blog/2010/08/19/setting-up-an-apt-repository/ |
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
on js(jscpt) | |
set jscpt to "(function _l () {" & jscpt & "}());" | |
tell application "Safari" to do JavaScript jscpt in document 1 | |
end js | |
on log_into_google(method, username, password) | |
tell application "Safari" to set URL of document 1 to "https://accounts.google.com/" & method | |
delay 2 | |
js("var f = document.getElementById('gaia_loginform'); | |
f.Email.value = '" & username & "'; |
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
# Example usage: | |
# perl_module_build "0.3601" | |
define :perl_module_build do | |
execute "/usr/local/bin/cpan_install Module::Build" do | |
cwd "/root" | |
path [ "/usr/local/bin", "/usr/bin", "/bin" ] | |
not_if { `perl -mModule::Build -e 'print $Module::Build::VERSION'`.to_f >= params[:name].to_f } | |
end | |
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
#!/usr/bin/perl -w | |
# | |
# check_with_hysteresis.pl - hysteresis for nagios service checks' limits | |
# | |
# Usage: check_with_hysteresis.pl $LASTSERVICESTATE$ default check --- STATE1 check for state1 --- STATE2 check for state2 ... | |
# | |
# If $LASTSERVICESTATE$ is STATE1, "check for state1" will be | |
# executed, if it's STATE2, "check for state2" will be executed, and | |
# so on; if state is undefined, "default check" wil be executed. | |
# |