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
function usage() { | |
cat <<EOD | |
$0 [-hnv] | |
-h, --help Print this text and exit | |
-n, --dry-run Dryrun; do not make any changes | |
-v, --verbose Enable verbose output; repeat for more verbosity | |
EOD | |
} | |
function debug() { |
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
function retry() { | |
# retry [--limit,-l] [--delay,-d] [--] command args.. | |
[ $# -lt 1 ] && echo "return [-ld] [--] commands [args...]" >&2 && return | |
LIMIT=5 | |
DELAY=5 | |
while [[ $# > 0 ]]; do | |
case $1 in | |
--limit|-l) | |
shift |
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 | |
# -*- coding: utf-8 -*- | |
# vim: ft=python ts=4 sw=4 expandtab | |
# | |
# Copyright (c) 2013 Reed Kraft-Murphy <reed@reedmurphy.net> | |
# | |
# 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 |
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
import os | |
import os.path | |
import re | |
import fabric.api | |
import fabric.tasks | |
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) | |
SUDO_PREFIX = re.compile(r'/(root|sudo)_?', re.I) |
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 | |
function check_proc() { | |
pid=$1 | |
link=$(readlink /proc/$pid/exe) | |
if [[ "$link" =~ \ \(deleted\)$ ]]; then | |
proc_launched=$(stat -c '%y' /proc/$pid) | |
binary=${link% (deleted)} | |
binary_stat=$(stat $binary | sed 's/^/\t\t/') | |
cmdline=$(cat /proc/$pid/cmdline | tr '\000' ' ') |
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 -e | |
days_before_purge=30 | |
tracdb="/var/www/trac/db/trac.db" | |
attachment_dir="/var/www/trac/attachments/ticket" | |
sqlite3="/usr/bin/sqlite3" | |
sql_closed="select distinct id from ticket join attachment using (id) where status = \"closed\" and datetime(changetime/1000000, 'unixepoch') <= datetime('now', '-${days_before_purge} days');" | |
closed_tickets=$(echo ${sql_closed} | ${sqlite3} ${tracdb}) | |
for id in $closed_tickets; do |
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
function wat(elem){ | |
var color = $.Color({ | |
hue: Math.random() * 360, | |
saturation: 1, | |
lightness: 0.5 | |
}); | |
$(elem).animate( { color: color }, 500, function(){wat(elem)}); | |
} | |
if (window.addEventListener) { |
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 | |
me=$0 | |
die() { | |
echo $* | |
usage | |
exit 1 | |
} | |
usage() { |
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
[info] | |
checksum=0x8f421f9c | |
version_name=v0.34.11 | |
complete=true | |
[addresses] | |
translation_vector=0x01636a88 | |
language_vector=0x01636a70 | |
creature_vector=0x015f56ec | |
dwarf_race_index=0x015dcf80 |
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
reedm@www:~/tmp $ ls -ld . | |
drwx------ 2 reedm reedm 4096 Feb 4 14:54 ./ | |
reedm@www:~/tmp $ cat > foo | |
This is a file | |
reedm@www:~/tmp $ chmod -w foo | |
reedm@www:~/tmp $ mv foo bar | |
reedm@www:~/tmp $ ls -la | |
total 12 | |
drwx------ 2 reedm reedm 4096 Feb 4 14:54 ./ | |
drwx-----x 54 reedm reedm 4096 Feb 4 10:18 ../ |