Skip to content

Instantly share code, notes, and snippets.

@sampowers
sampowers / xsbackup.pl
Created January 3, 2011 19:47
XenServer backup script
#!/usr/bin/perl
use POSIX qw(strftime);
use Data::Dumper;
sub timestamp { return strftime("%H:%M:%S", localtime(time)); }
sub datestamp { return strftime("%b %d", localtime(time)); }
sub l {
my ($msg) = shift;
printf("$0: %s %s $msg\n", datestamp(), timestamp());
@sampowers
sampowers / catgame.sh
Created January 20, 2011 04:13
a game to play with your cats
#!/bin/sh
while read; do eject ; read ; eject -t ; done
@sampowers
sampowers / map_remote_ipmi_ports_to_loopback_ip.sh
Last active April 22, 2021 19:03
SSH tunnel 127.0.0.2 to supermicro IPMI system
#!/bin/bash
set -x
#
# Purpose: Run on a workstation to make a remote IPMI controller available at http://127.0.0.2:80/
# Only does port mapping. IPMI controllers may have their own taxing browser requirements.
# Requires that you have a shell on a host that is on the same network as your IPMI interface.
shell='user@ssh-host-on-ipmi-network'
@sampowers
sampowers / smb.conf
Created February 18, 2013 23:09
minimal smbd.conf
[global]
workgroup = WORKGROUP
printing = bsd
printcap name = /dev/null
[pub]
path = /pub
write list = root
read only = no
@sampowers
sampowers / phone-garbage.txt
Created February 22, 2013 17:25
all the garbage phone number formats in our data
000-000-0000
000-0000
AAAA 000-000-0000 AAAA 000-000-0000
0-000-000-0000
000 -000 -0000
000 000-0000
000 000-0000/000-0000 AAAAAA
000 0000
000 A AAAA, #00, AA
000- 000-0000
@sampowers
sampowers / plonk.sh
Created February 22, 2013 21:57
plonk
#!/bin/sh
. ~/.plonkrc # defines TWUSER and TWPASS. chmod 600 it... also define SMTPHOST there.
plonkmail() {
sendEmail \
-f `whoami`@`hostname -f` -t $MAILTO -u "$1" -m `basename $1` \
-s $SMTPHOST \
-a "$1"
}
@sampowers
sampowers / firstrun
Last active January 19, 2019 21:43
Debian/Ubuntu host initialization script
#!/bin/bash
set -e
###
# Script to set root password and networking config on first boot.
#
# Make your modifications and turn this on by running:
# /etc/init.d/firstrun enable
###
#!/bin/bash
# roto-chrooter, (C) 2005 Sam Powers <sam@rm-r.net>. Licensed under GNU GPL.
VER="1.4"
# You can edit the default suite and chroot dir here, or by setting one of the
# below two env vars $_SUITE or $_CHROOT_DIR prior to running the script:
test $_CHROOT_DIR || export _CHROOT_DIR="/chroot"
test $_SUITE || export _SUITE="sarge"
test $_MIRROR || export _MIRROR="http://http.us.debian.org/debian"
# pdmenu https://joeyh.name/code/pdmenu/
#!/bin/sh
function rand { foo=$1; echo $((RANDOM%foo+1)); }
function beep {
if [ -z $DISPLAY ]; then
setterm -bfreq $1
else
xset b 100 $1 50
fi
sam@halebopp /org/fridge/GNUstep/Library/WindowMaker/Themes
127 % cat devaluate.style
{
LargeDisplayFont = "Arial-12:slant=0:weight=80:width=100:pixelsize=24";
HighlightColor = "#525952";
MenuTextExtendSpace = "-1";
FTitleColor = "#f1f1f1";
MenuTitleExtendSpace = "-1";
MenuTextFont = "Arial:slant=0:weight=80:width=100:pixelsize=11";
UTitleBack = (mvgradient, "#000000", "#000000", "#707070");