Skip to content

Instantly share code, notes, and snippets.

@joshenders
joshenders / gist:7761887
Last active December 30, 2015 02:19
The Binutils documentation recommends building Binutils outside of the source directory in a dedicated build directory:
mkdir --verbose ../binutils-build
cd ../binutils-build
../binutils-2.23.2/configure \
--prefix=/tools \
--with-sysroot=$LFS \
--with-lib-path=/tools/lib \
--target=$LFS_TGT \
--disable-nls \
--disable-werror
@joshenders
joshenders / dump.sh
Created January 3, 2014 23:16
Backup a DVD and send a pushover notification upon completion
#!/bin/bash
device='/dev/dvd'
label="$(blkid -o value -s LABEL ${device})"
log="${label}.log"
dvdbackup \
--mirror \
--progress \
--verbose \
jenders@captivus/pts/0: ~ $ cat > lsb_release << EOF
cat << END
No LSB modules are available.
Distributor ID:Debian
Description:Debian GNU/Linux 7.0 (wheezy)
Release:7.0
Codename:wheezy
END
EOF
http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz
http://ftp.gnu.org/gnu/automake/automake-1.14.tar.xz
http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz
http://alpha.gnu.org/gnu/bc/bc-1.06.95.tar.bz2
http://ftp.gnu.org/gnu/binutils/binutils-2.23.2.tar.bz2
http://ftp.gnu.org/gnu/bison/bison-3.0.tar.xz
http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
http://sourceforge.net/projects/check/files/check/0.9.10/check-0.9.10.tar.gz
http://ftp.gnu.org/gnu/coreutils/coreutils-8.21.tar.xz
http://ftp.gnu.org/gnu/dejagnu/dejagnu-1.5.1.tar.gz
@joshenders
joshenders / HPN40L BMC Setup.md
Last active September 2, 2023 08:00
How to setup an N40L Remote Access Card (BMC/IPMI) under Debian Wheezy

Update BMC Firmware

As of this writing (2014-02-18), the latest firmware is 1.3. It can be updated from the webif. Use Safari, the credentials are admin/password. If you're trying to find it on your network, the OUI of the BMC NIC is a0:b3:cc.

Install Utilities

apt-get install openipmi ipmitool
@joshenders
joshenders / pesar_guy.md
Last active August 29, 2015 13:56
pesar_guy is a scammer

From: pesar_guy
Sent: Jan-06-14 05:26 PM

Can you send it to 21500 Burbank Blvd Apt 206 Woodland hills CA 91367 thanks

From: joshenders

@joshenders
joshenders / offline.sh
Last active August 29, 2015 13:56
bash function to offline an arbitrary scsi device
function offline() {
if [[ "$EUID" -ne '0' ]]; then
echo "This function requires root privileges"
return 1
elif [[ "$#" -ne '1' ]]; then
echo "Usage: $FUNCNAME <device node>"
return 1
fi
# basename
@joshenders
joshenders / start.sh
Created February 28, 2014 20:49
plexmediaserver's primitive start.sh script
#!/bin/sh
#SCRIPTPATH=$(dirname $(python -c 'import sys,os;print os.path.realpath(sys.argv[1])' $0))
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname ${SCRIPT}`
export LD_LIBRARY_PATH="${SCRIPTPATH}"
export PLEX_MEDIA_SERVER_HOME="${SCRIPTPATH}"
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
ulimit -s 3000

Keybase proof

I hereby claim:

  • I am joshenders on github.
  • I am joshenders (https://keybase.io/joshenders) on keybase.
  • I have a public key whose fingerprint is 2FA2 9C3D 3D16 E8E6 B841 E926 C1F0 A6E2 7139 3C70

To claim this, I am signing this object:

#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select