Skip to content

Instantly share code, notes, and snippets.

View prestelpirate's full-sized avatar

Tom Kranz prestelpirate

View GitHub Profile

Keybase proof

I hereby claim:

  • I am prestelpirate on github.
  • I am prestelpirate (https://keybase.io/prestelpirate) on keybase.
  • I have a public key whose fingerprint is 2DC2 E0EB 770F 903A DD74 93C1 09A4 DEDD 92BB E219

To claim this, I am signing this object:

@prestelpirate
prestelpirate / if_check.ksh
Created December 7, 2016 12:16
Ported from an original script written for Solaris 2.6 Provides basic failover between two network interfaces on your IRIX host
#!/bin/sh
#
# See http://www.gaeltd.com/scripts-and-tools/ for more details
#
# 2004-09-14 Tom Kranz <tom@siliconbunny.com>
#
# Ported from an original script written for Solaris 2.6
# Provides basic failover between two network interfaces on your IRIX host
#
# Pre-reqs:
@prestelpirate
prestelpirate / kstat_check.ksh
Last active December 7, 2016 12:17
kstat can return a lot of useful information about the state of your ethernet interfaces. However, the syntax can be confusing and difficult to remember. This script functions as a wrapper around kstat – tell it the interface type and instance number, and it will return configuration details. It’s important to note that older cards, like hme, wi…
#!/bin/ksh
# See http://www.gaeltd.com/scripts-and-tools/ for more details
# 2004-01-20 Tom Kranz (tom@siliconbunny.com)
# This script is distributed under the GNU Public License (GPL) with the
# following extra conditions:
# - attritbution must be maintained
# - CD-ROM or similar media for commercial distribution without the prior
@prestelpirate
prestelpirate / int_check.ksh
Last active December 7, 2016 12:17
Tired of remembering and typing in the ndd variables to check the speed and duplex settings of an ethernet port? This script automates the drudge work – just give it an interface type (hme, ce, bge) and an instance number, and it will tell you how that port is configured.
#!/bin/ksh
# See http://www.gaeltd.com/scripts-and-tools/ for more details
# 2004-01-20 Tom Kranz (tom@siliconbunny.com)
# This script is distributed under the GNU Public License (GPL) with the
# following extra conditions:
# - attritbution must be maintained
# - CD-ROM or similar media for commercial distribution without the prior
@prestelpirate
prestelpirate / clone_root_disk.ksh
Last active December 7, 2016 12:17
While IRIX comes with the XLV volume manager, the license to mirror (plex) your volumes is an expensive extra. This script allows you to clone the root disk, creating a bootable spare which is not normally mounted, allowing easy root disk recovery.
#!/bin/ksh
#
# See http://www.gaeltd.com/scripts-and-tools/ for more details
#
# 2004-09-15 Tom Kranz <tom@siliconbunny.com>
#
# Script to clone root disk
# Run this from cron nightly when things are quiet to keep so you have a
# reasonably up to date bootable clone of your root partition
#
@prestelpirate
prestelpirate / if_check.sh
Last active December 7, 2016 12:18
Before IP MultiPathing (IPMP) came along in Solaris 8, it was difficult to have 2 ethernet interfaces connecting your host to the same LAN in a failover configuration. This script pings a highly-available source (usually your default router or switch) and calls ifconfig to down an interface and up the spare if the ping fails. Your two interfaces…
#!/bin/sh
#
# See http://www.gaeltd.com/scripts-and-tools/ for more details
#
# 2001-01-30 Tom Kranz (tom@siliconbunny.com)
#
# This script is distributed under the GNU Public License (GPL) with the
# following extra conditions:
# - attritbution must be maintained
# - CD-ROM or similar media for commercial distribution without the prior
@prestelpirate
prestelpirate / mem_dis.ksh
Last active December 7, 2016 12:18
During performance testing on F15k domains, it was required to remove memory from several system boards to gauge relative performance when increasing CPU count, memory, and both together. Rather than physically removing the boards, this script was developed. It uses the Sunfire’s DR to unconfigured memory from selected system boards. The operati…
#!/bin/ksh
# See http://www.gaeltd.com/scripts-and-tools/ for more details
# 2004-06-08 Tom Kranz (tom@siliconbunny.com)
# This script is distributed under the GNU Public License (GPL) with the
# following extra conditions:
# - attritbution must be maintained
# - CD-ROM or similar media for commercial distribution without the prior
@prestelpirate
prestelpirate / ce_settings.ksh
Last active December 7, 2016 12:19
Sun’s Cassini Ethernet (ce) cards are available in either 100mb or 1gb versions. The same driver is used for both. Problems arise because speed and duplex settings cannot be set from within /etc/system. Instead, a configuration file must be used. The syntax is cryptic and prone to mistakes – at the worst case, a poorly written configuration file…
#!/bin/ksh
#
# 2004-01-20 Tom Kranz (tom@siliconbunny.com)
#
# This script is distributed under the GNU Public License (GPL) with the
# following extra conditions:
# - attritbution must be maintained
# - CD-ROM or similar media for commercial distribution without the prior
# approval of the author
#
@prestelpirate
prestelpirate / ods_breakage.ksh
Last active December 7, 2016 12:19
Used on hosts with Solaris Disksuite volume management. The script parses metastat output and checks the status of metadevices. Any errors are collated and a status report is emailed.
#!/bin/ksh
# See http://www.gaeltd.com/scripts-and-tools/ for more details
# 2005-01-10 Tom Kranz (tom@siliconbunny.com)
#
# Quickie script to catch Disksuite breakage
#
# We store a temp file in /tmp with our errors - once the script is complete, if
# that file has anything in it we know something has gone wrong - so we
@prestelpirate
prestelpirate / leach-phrack.sh
Created August 12, 2019 14:41
Download and unpack all issues of Phrack
#!/bin/bash
# Current issue is 69, cycle through everything since issue 1
# Create a subdirectory to stash the files in
# and make sure the downloaded archive is removed once done
for i in {1..69}
do
FILE="phrack${i}.tar.gz"
mkdir ${i}