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 | |
# pad an RRD with 5-minute data covering 24 hours | |
# starting yesterday | |
time = Time.now.to_i - 86400 | |
288.times do | |
time = time + 300 | |
puts "rrdtool update test.rrd #{time}:#{rand(1..64)}" |
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
--Grab selected story pertinents | |
tell application "NetNewsWire" | |
set u to (URL of selectedHeadline) | |
set t to (title of selectedHeadline) | |
end tell | |
--Hand off to Safari | |
tell application "Safari" | |
add reading list item (u as string) | |
end tell |
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 | |
require 'sinatra' | |
require 'haml' | |
get "/upload" do | |
haml :upload | |
end | |
post "/upload" 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
property theUrl : "" | |
tell application "Safari" | |
set theUrl to URL of current tab of window 1 | |
end tell | |
set validUrl to text ((offset of ":" in theUrl) + 1) thru -1 of theUrl | |
tell application "Internet Explorer" |
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
property theURL : "" | |
tell application "Safari" | |
set theURL to URL of current tab of window 1 | |
end tell | |
tell application "Google Chrome" | |
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 | |
@leases =[] | |
File.open('dhcpd.leases', 'r').read.gsub(/\n/, '').split('}').each { |lease| @leases << lease.split(';') } |
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 cache_leases | |
leases = {} | |
File.open('/path/to/dhcpd.leases', 'r').read.gsub(/\n/, '').split(/}/).each do |lease| | |
l = lease.split(';') | |
if l.index(' next binding state free') | |
l[0].gsub!(/.*lease (.*?) {.*/, '\1') | |
leases[l[0]] = l if l[0] =~ /[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ | |
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
#!/bin/bash | |
cp /etc/issue-clean /etc/issue | |
for x in $(ip link show | egrep -o 'eth[0-9]') | |
do | |
INTERFACE=$x | |
for y in $(ip addr show ${INTERFACE} | grep -o 'inet .*' | awk '{ printf "%s|%s\n", $7, $2 }') | |
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
#!/bin/sh | |
clamscan="/usr/local/bin/clamscan" | |
file=$1 | |
if [ -z "$clamscan" ] | |
then | |
echo "Add clamav to your \$PATH or set \$clamscan, dawg." | |
exit 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
#!/usr/bin/env ruby | |
f = File.open("tcpdump.log", 'r') | |
endpoints = {} | |
conversations = {} | |
f.each_line do |l| |
OlderNewer