Skip to content

Instantly share code, notes, and snippets.

View rtucker's full-sized avatar

Rey Tucker rtucker

View GitHub Profile
@rtucker
rtucker / setdnstarget.sh
Created August 27, 2009 00:11
A one-liner to set a Linode DNS Manager target to your client's current public IP address
ssh you@yourlinode "wget -O - -q https://api.linode.com/?api_key=$LINODE_API_KEY\&api_action=domain.resource.update\&domainid=$DOMAINID\&resourceid=$RESOURCEID\&target=\`echo \$SSH_CLIENT | cut -d' ' -f1\`"
#!/bin/sh
# lspci -vvv -s 01:00.0
# 01:00.0 VGA compatible controller: ATI Technologies Inc Rage 128 Pro Ultra TF
# [...]
# Region 0: Memory at f8000000 (32-bit, prefetchable) [size=64M]
# allowing 0x100000 (1MiB) for "other stuff", we specify the range
# as starting from 0xf8100000 and going for 0x3f00000 (63MiB).
[ 66.572527] BUG: soft lockup - CPU#1 stuck for 61s! [invoke-rc.d:1215]
[ 66.572537] Modules linked in: ipv6 dahdi_transcode dahdi_dummy dahdi crc_ccitt
[ 66.572541]
[ 66.572544] Pid: 1215, comm: invoke-rc.d Not tainted (2.6.31-302-ec2 #7-Ubuntu)
[ 66.572546] EIP: 0061:[<c0101227>] EFLAGS: 00000246 CPU: 1
[ 66.572549] EIP is at 0xc0101227
[ 66.572550] EAX: 00030004 EBX: deadbeef ECX: deadbeef EDX: f57fb000
[ 66.572552] ESI: 00000003 EDI: d7aa2a20 EBP: d569bca4 ESP: d569bc9c
[ 66.572554] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0069
[ 66.572559] CR0: 8005003b CR2: b7713f90 CR3: 159cb000 CR4: 00002660
@rtucker
rtucker / php-downgrade.sh
Created July 25, 2010 20:42
Downgrades an Ubuntu 10.04 LTS system to PHP 5.2, from Ubuntu 9.04
#!/bin/sh
# Downgrades an Ubuntu 10.04 LTS system to PHP 5.2, from Ubuntu 9.04
# Ryan Tucker <rtucker@gmail.com>, 2010/07/20
# Based on http://mrkandy.wordpress.com/2010/04/16/install-php-5-2-x-in-ubuntu-10-04-lucid/
# Get current PHP 5.3 packages from 10.04 LTS
PHP53PACKAGES=`mktemp php53packagesXXXXX`
@rtucker
rtucker / pollstatus.py
Created July 30, 2010 00:11
Queries Google Voice to determine voicemail counts, then creates dummy files for Asterisk's voicemail system
#!/usr/bin/python
import glob
import os
import sys
from googlevoice import Voice,util
mailboxroot = "/var/spool/asterisk/voicemail/default"
@rtucker
rtucker / extensions_override_freepbx.conf
Created July 30, 2010 00:18
FreePBX/Asterisk dialplan override configuration to reroute *97 (check voicemail) for one extension
[app-vmmain]
include => app-vmmain-custom
exten => *97,1,Answer
exten => *97,n,Wait(1)
exten => *97,n,Macro(user-callerid,)
exten => *97,n,GotoIf($["${AMPUSER}" = "103"]?googryan)
exten => *97,n,Macro(get-vmcontext,${AMPUSER})
exten => *97,n(check),MailBoxExists(${AMPUSER}@${VMCONTEXT})
exten => *97,n,GotoIf($["${VMBOXEXISTSSTATUS}" = "SUCCESS"]?mbexist)
exten => *97,n,VoiceMailMain()
@rtucker
rtucker / clients.conf
Created August 15, 2010 15:32
FreeRADIUS configuration snippets for wifi Protected EAP + MySQL authentication
client wifi-sodtech1 {
ipaddr = 192.168.1.2
netmask = 32
secret = BigLongSecret
require_message_authenticator = no
nastype = other
}
<p>Matthew Crawford, author of the best-selling <a href="http://www.burlinghambooks.com/book/9780143117469">Shop Class as Soulcraft</a>, opened the <a href="http://www.cwgp.org/">Caroline Werner Gannett Project</a>'s "Visionaries in Motion IV" speaker series at RIT on September 8. Crawford, whose career path has meandered from electrician to philosopher to think-tank director to motorcycle mechanic, speaks a gospel seemingly well-crafted to the emerging open-it-up-and-make-it-better maker culture. The prevalence of futuristic seamless designs, built to be replaceable rather than repairable, is but one contributor to the demise of the craftsperson in every day life, however.</p>
<p>The focus of Crawford's ire is more systemic. Over the past few generations, the perceived value of doing "hard work" for a living has plummeted. Smart kids have been increasingly funneled towards a college degree in some field of thinking, such as engineering or computer science or philosophy. This left the more vocational career p
@rtucker
rtucker / gist:1010850
Created June 6, 2011 19:06
The IPv4 Internet may be turned off now
$ dig +trace rocwiki.org aaaa
; <<>> DiG 9.4.2-P2.1 <<>> +trace rocwiki.org aaaa
;; global options: printcmd
. 468336 IN NS a.root-servers.net.
. 468336 IN NS b.root-servers.net.
. 468336 IN NS c.root-servers.net.
. 468336 IN NS d.root-servers.net.
. 468336 IN NS e.root-servers.net.
. 468336 IN NS f.root-servers.net.
@rtucker
rtucker / partsum.m
Created November 8, 2011 03:14
partsum.m from Chapter 7 of Sherrick's Concepts in Systems and Signals, 2nd Ed, used in RIT/ECTET 0609-333
function [y,t]=Partsum(x,M,win,T)
% partsum calculates the partial Fourier series of x with period T
% including out to the Mth harmonic
% win=0 specifies rectangular window (default)
% win=1 specifies hamming window
% win=2 specifies hanning window
% win=3 specifies a triangular window
% x must be described over T starting from t = 0 in a 1024-point vector
% The command format is [partial_sum,time]=Partsum(x,M,win,T)
% Used without output arguments, Partsum plots the results