Skip to content

Instantly share code, notes, and snippets.

View maxclark's full-sized avatar

Max Clark maxclark

View GitHub Profile
@maxclark
maxclark / gist:11258216
Created April 24, 2014 15:09
Ping a range of IPs without using NMAP
# In BASH shell
for i in {1..254}; do
ping -c 1 -W 1 10.1.1.$i
done
# In TCSH
foreach number ( `jot 254` )
do ping -c 1 -W 1 10.1.1.$i
/*
This widget shows Recent Posts on your Tumblr blog.
Its dependency is jQuery.
Usage:
1) Add html:
<div id="recent-posts"></div>
2) Add code into the <head>:
@maxclark
maxclark / gist:7816389
Created December 6, 2013 00:01
Remove empty lines and lines starting with a "#" comment.
egrep -v '^#|^$' <file>
@maxclark
maxclark / README.md
Last active December 30, 2015 10:29
PowerDNS tinydns backend support for FreeBSD

PowerDNS tinydns backend support for FreeBSD

Notes:

FreeBSD's tinycdb port is missing pkg-config data and targest to compile shared objects. For the time being I found it easier to compile and install tinycdb using the following flags:

make all shared piclib
make install install-sharedlib install-piclib

Grab the libcdb.pc file and place it in /usr/local/libdata/pkgconfig/libcdb.pc

@maxclark
maxclark / PythonInstall.md
Last active December 22, 2015 18:39
Install Python 2.7 (homebrew + pip + virtualenv) on Mac OS X Lion

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

@maxclark
maxclark / admin.lua
Created August 2, 2013 20:20
The illusive read/write splitting lua for the mysql-proxy. Includes connection pooling and read load balancing.
--[[
Copyright 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@maxclark
maxclark / Open Safari URL in Google Chrome.scpt
Created July 18, 2011 22:42
Open Safari URL in Google Chrome
tell application "Safari" to set currentURL to URL of current tab of window 1
tell application "Google Chrome"
activate
if (exists window 1) and (URL of active tab of window 1 is "chrome://newtab/") then
tell window 1 to set URL of active tab to currentURL
else
open location currentURL
end if
end tell