View watch_woot.pl
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 | |
# Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com> | |
# | |
# Permission to use, copy, modify, and distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
View import-cvs-to-git
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 | |
# https://gist.github.com/gists/2641363 | |
# https://github.com/jasperla/openbsd-wip | |
# $ cd ~/openbsd-wip && CVSROOT=:local:/cvsroot import-cvs-to-git misc/anyport | |
#GITROOT=~/openbsd-wip | |
#GITROOT=/usr/ports/mystuff | |
GITROOT=`pwd` | |
CVSROOT=${CVSROOT:-/cvs} | |
# SUBDIR can be any valid dirname without trailing / |
View tcpbench_client.pl
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 | |
# Start this on a server someplace with tcpbench | |
# Start tcpbench -s on a machine that is the remote IP you are connecting the the web from | |
# Browse to the page. | |
use Mojolicious::Lite; | |
use Mojo::IOLoop; | |
use Mojo::IOLoop::Stream; | |
# Template with browser-side code | |
get '/' => sub { |
View lat_lon_to_from_google.pl
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
# Converted from http://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/ | |
# http://trac.osgeo.org/proj/wiki/man_cs2cs | |
# similar to | |
# cs2cs -f "%.10f" +init=epsg:3857 +to +init=epsg:4326 | |
# and | |
# cs2cs -f ".10f" +init=epsg:4326 +to +init=epsg:3857 | |
# http://trac.osgeo.org/proj/wiki/man_cs2cs | |
use Math::Trig; |
View screen_sizes
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 | |
_screen=1 | |
xrandr | sed -ne 's/(.*$//' -e 's/.* connected *//p'| | |
while read _line; do | |
_size=${_line#* } | |
echo SCREEN_${_screen}_HEIGHT=`echo $_size | sed -e 's/.*x//' -e 's/\+.*//'` | |
echo SCREEN_${_screen}_WIDTH=`echo $_size | sed -e 's/x.*//'` | |
echo SCREEN_${_screen}_X=`echo $_size | sed -e 's/[^+]*+\([0-9]*\).*/\1/'` | |
echo SCREEN_${_screen}_Y=`echo $_size | sed -e 's/.*+.*+//'` |
View git_prompt.sh
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 _git_prompt() { | |
local _branch=`git branch --no-color 2> /dev/null | sed -ne 's/^* //p'` | |
[[ -z $_branch ]] && return | |
local _bgcolor | |
local _color | |
for s in `git status --porcelain | tr ' ' '.' | cut -c 1-2`; do | |
if [ -z "$_color" ]; then | |
case "$s" in |
View cleanup_maildirs.pl
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 | |
# $Id: cleanup_maildirs,v 1.27 2011/02/22 00:36:24 andrew Exp $ | |
# Copyright (c) 2013 Andrew Fresh <andrew@afresh1.com> | |
# | |
# Permission to use, copy, modify, and distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
View qemu_carp_on_vlans.sh
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 | |
# This uses qemu, so pkg_add qemu | |
# Download and extract flashrd, either from github or here: | |
# http://www.nmedia.net/flashrd/ | |
# Grab a flashrd image from here: | |
# http://www.nmedia.net/flashrd/images/ | |
# and set the name: | |
flashimg=flashimg.amd64.pccons-20130318 |
View tmup.sh
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
tmup () { | |
echo -n "Updating to latest tmux environment..."; | |
local IFS=","; | |
for line in $(tmux showenv -t $(tmux display -p "#S") | tr "\n" ","); | |
do | |
if [[ $line == -* ]]; then | |
unset $(echo $line | cut -c2-); | |
else | |
export $line; |
View palm_keyring2pwsafe.pl
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 | |
######################################################################## | |
# Copyright (c) 2013 Andrew Fresh <andrew@afresh1.com> | |
# | |
# Permission to use, copy, modify, and distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
OlderNewer