Skip to content

Instantly share code, notes, and snippets.

View ozzyjohnson's full-sized avatar

Ozzy Johnson ozzyjohnson

View GitHub Profile
@ozzyjohnson
ozzyjohnson / gist:23f5bb20146432305514
Created November 10, 2014 04:47
Segfaulting build of Bash for AFL.
apt-get update && apt-get -y install bison \
&& wget http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz \
&& tar xzvf bash-4.2.tar.gz \
&& wget -r -l 1 http://ftp.gnu.org/gnu/bash/bash-4.2-patches/ \
&& rm ftp.gnu.org/gnu/bash/bash-4.2-patches/*.sig \
&& rm ftp.gnu.org/gnu/bash/bash-4.2-patches/index* \
&& cd bash-4.2 \
&& for i in ../ftp.gnu.org/gnu/bash/bash-4.2-patches/*; do patch -p0 < $i; done \
&& CC=/usr/local/bin/afl-gcc ./configure
&& make \
@ozzyjohnson
ozzyjohnson / gist:1ea196f056ecdf30708a
Created November 13, 2014 18:40
Remove untagged docker images.
sudo docker rmi $(sudo docker images | grep '^<none>' | awk '{print $3}')
@ozzyjohnson
ozzyjohnson / gist:381b5beba6dc486b8c4f
Created November 14, 2014 18:23
Drop vmware tools on old Ubuntu guests.
mkdir -p /media/cdrom \
&& mount /dev/sr0 /media/cdrom \
&& tar -C /tmp -xzvf /media/cdrom/*.gz \
&& /tmp/vmware-tools-distrib/vmware-install.pl -d \
&& rm -rf /tmp/vmware-tools-distrib
@ozzyjohnson
ozzyjohnson / ucs_vif.md
Created November 28, 2014 22:57
Cisco UCS VIF paths enter error disabled until first use.

This produces warning events F0207, F0479, F0283. These errors clear once each port has been fully initialized by an appropriate driver - ESXi or Debian Squeeze installer images are an easy way to take care of this. Shame the docs make no mention of this and point only to failed uplinks and un-acknowledged hardware.

@ozzyjohnson
ozzyjohnson / gist:a685d8104f5ce0ecbfa8
Created December 25, 2014 22:19
Destroying all docker images.
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@ozzyjohnson
ozzyjohnson / vagrant_spot_instance.md
Last active June 19, 2018 15:44
Use an EC2 spot instance with Vagrant

Setup:

git clone git@github.com:nabeken/vagrant-aws.git
cd vagrant-aws
git checkout spot-3
gem build vagrant-aws.gemspec
vagrant install plugin vagrant-aws-0.5.0.gem

Vagrantfile:

@ozzyjohnson
ozzyjohnson / cdp_neighbor.awk
Created April 25, 2015 01:27
awk cisco IOS cli script
BEGIN {
device_id = ""
entry_address = ""
ip_address = ""
platform = ""
capabilities = ""
interface = ""
port_id = ""
holdtime = ""
version = ""
@ozzyjohnson
ozzyjohnson / esx-cdp_neighbor.awk
Created May 12, 2015 23:52
ESXi CDP Neighbor to CSV
#Parses the output of CDP neighbor information from a VMWare ESXi host.
#
#-------------------------
#hostname vmnic1
#CdpVersion : 2
#Timeout : 0
#Ttl : 152
#Samples : 9854
#DevId : aaa-bbbb-cccc-dd
#Address : 10.10.1.1
@ozzyjohnson
ozzyjohnson / filtermember.awk
Created May 12, 2015 23:56
Filtering the output of Novell eDirectory LDAP queries for CNs, I think.
BEGIN {
cn = ""
}
function trim(field) {
gsub(/\r/, "", field)
gsub(/^[ \t]+/, "", field)
return field;
}
@ozzyjohnson
ozzyjohnson / gist:aaebe09b0168da5b7180
Last active August 29, 2015 14:21
Convert exports from a NetWare DNS/DHCP server to CSV.
BEGIN {
FS = "="
ipan = ""
at = ""
lt = ""
hn = ""
lu = ""
le = ""
mac = ""
ci = ""