Skip to content

Instantly share code, notes, and snippets.

View furlongm's full-sized avatar

Marcus Furlong furlongm

View GitHub Profile
@furlongm
furlongm / patchman-api-excel-report.py
Last active July 10, 2024 09:52
patchman-api-excel-report.py
#!/usr/bin/env python3
import json
import requests
import xlsxwriter
from datetime import datetime
from pprint import pprint
protocol = 'http'
#sudo fallocate -l 4G /swap
sudo dd if=/dev/zero of=/swapfile bs=1024 count=4194304
sudo chmod 600 /swap
sudo mkswap /swap
sudo swapon /swap
echo "/swap swap swap defaults 0 0" | sudo tee -a /etc/fstab
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#!/bin/bash
# To install systemrescuecd on PXE:
# change the version number
version=3.2.0
wget -c http://aarnet.dl.sourceforge.net/project/systemrescuecd/sysresccd-x86/$version/systemrescuecd-x86-$version.iso
# mount the cdrom image:
mount -o loop systemrescuecd-x86-${version}.iso cd
#!/bin/bash
dist=quantal
for arch in amd64 i386 ; do
wget -c http://mirror.aarnet.edu.au/ubuntu/dists/${dist}/main/installer-${arch}/current/images/netboot/netboot.tar.gz
tar xf netboot.tar.gz ./version.info
version=`cat ./version.info | grep "Ubuntu version" | sed -e "s/Ubuntu version: *\(.*\) *$/\1/"`
rm ./version.info
echo "Installing tftp files for ubuntu ${version} - ${arch}"
if [ -d ${version}/${arch} ] ; then
#!/bin/bash
git checkout master
git remote prune origin
for b in $(git branch -v | grep "\[gone\]" | cut -d " " -f 3) ; do git branch -v -D ${b} ; done
git branch -d $(git branch --merged | grep -vw $(git rev-parse --abbrev-ref HEAD)) 2>/dev/null
git gc
#!/bin/bash
# Provide usage
usage() {
echo "Usage: $0 VM_ID"
exit 1
}
[[ $# -eq 0 ]] && usage
#!/bin/bash
delete_empty_bridge() {
for v in $(virsh list --all | tail -n +3 | head -n -1 | awk '{print $2}') ; do
virsh dumpxml ${v}
done | grep br${1} && return
ip link delete vlan${1}
ip link set down br${1}
brctl delbr br${1}
}
#!/usr/bin/env python
import sys
import socket
import select
from time import sleep
host = '127.0.0.1'
port = 5555
timeout = 3
#!/bin/bash
brew update
brew upgrade
brew cleanup
brew cask upgrade
brew doctor