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
namespace :minifier do | |
JAR = "/Users/blanders/MyDocs/Library/yuicompressor.jar" | |
def minify(files) | |
files.each do |file| | |
next if file =~ /\.min\.(js|css)/ | |
minfile = file.sub(/\.js$/, ".min.js").sub(/\.css$/, ".min.css") | |
cmd = "java -jar #{JAR} #{file} -o #{minfile}" |
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
# Deployment uses SFTP by default when you use deploy_via :copy, and there | |
# doesn't seem to be any way to configure it. Unfortunately, we don't run | |
# SFTP on our servers, so it fails. This forces it to use SCP instead. | |
# http://www.capify.org/index.php/OverridingTaskCommands | |
# | |
module UseScpForDeployment | |
def self.included(base) | |
base.send(:alias_method, :old_upload, :upload) | |
base.send(:alias_method, :upload, :new_upload) | |
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/env ruby | |
###################################################################### | |
# Statseeker to PDF Report Generator | |
# | |
# Author: Brian Landers <[email protected]> | |
# Date: 2010-10-01 | |
# | |
# Requirements: | |
# | |
# - ActionMailer 3.0 -- http://www.rubyonrails.org |
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
%define name nfsping | |
%define release 1 | |
%define version 1.0 | |
%define buildroot %{_topdir}/%{name}-%{version}-root | |
BuildRoot: %{buildroot} | |
Summary: NFSping | |
License: BSD | |
Name: %{name} | |
Version: %{version} |
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/python | |
from datetime import datetime, timedelta | |
import os, plistlib | |
pl = plistlib.readPlist('/var/db/dhcpclient/leases' + "/" + \ | |
os.listdir('/var/db/dhcpclient/leases')[0]) | |
print "Lease expires: %s" % (pl['LeaseStartDate'] + \ | |
timedelta(seconds=pl['LeaseLength'])) |
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 | |
# | |
# Generate interface configs from an exported Excel file | |
# | |
# - assumes the file is exported as tab-delimited | |
# - assumes the first column is the interface name | |
# - joins all other fields into the description | |
# | |
# $ cat interfaces.txt | |
# |
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
blanders@smurfette ~/src | |
% virtualenv dotcloud | |
New python executable in dotcloud/bin/python | |
Installing setuptools............done. | |
Installing pip...............done. | |
blanders@smurfette ~/src | |
% cd dotcloud | |
blanders@smurfette ~/src/dotcloud | |
% ./bin/pip install dotcloud | |
Downloading/unpacking dotcloud |
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
$ traceroute6 -m 120 tng.prolixium.com | |
traceroute to tng.prolixium.com (2001:48c8:1:137::32), 120 hops max, 24 byte packets | |
[snip] | |
11 v6-seattle-ix.voxel.net (2001:504:16::745f) 209.28 ms 207.781 ms 207.18 ms | |
12 3890.te6-2.tsr1.lga3.us.voxel.net (2001:48c8::8c9) 277.482 ms 279.604 ms 277.079 ms | |
13 0.ae1.tsr1.lga5.us.voxel.net (2001:48c8::822) 282.205 ms 286.997 ms 276.887 ms | |
14 0.ae2.csr2.lga6.us.voxel.net (2001:48c8::82e) 280.187 ms 284.989 ms 277.817 ms | |
15 em0.dax.prolixium.net (2001:48c8:1:2::2) 277.495 ms 277.68 ms 277.61 ms | |
16 si3.starfire.prolixium.net (2001:48c8:1:1ff::1a) 311.417 ms 305.949 ms 305.109 ms | |
17 0.re0.ra.prolixium.net (2001:48c8:1:119::2) 307.72 ms 305.633 ms 305.915 ms |
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 unittest | |
def lsb(i): | |
"""Return the position of the first (lowest) bit that's set.""" | |
if not i: | |
return 0 | |
count = 1 | |
while 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/env python | |
""" | |
Twitter Coding Challenge | |
#SREcon 2014 | |
Collect samples of Linux kernel network statistics and report the minimum, | |
maximum, and average delta for each over a given interval. | |
Uses the Google gflags module for parsing command-line arguments. | |
Available on PyPI (pip install python-gflags) |
OlderNewer