Skip to content

Instantly share code, notes, and snippets.

View meffie's full-sized avatar

Michael Meffie meffie

View GitHub Profile
@meffie
meffie / aarch64qemu
Last active August 29, 2015 14:16 — forked from ecliptik/aarch64qemu.md
Setting up a Ubuntu 14.04 or Debian 8 (jessie) arm64 VM
This is mainly a notes dump and should be used for reference. This guide assumes:
*Ubuntu 14.04 (or Debian 8) hypervisor/host with bridge networking
*Knowledge of qemu
*Knowledge of debootstrap
Limitations of the qemu-system-aarch64 emulator on x86 include only being able to emulate one CPU and no KVM support.
DOT files for "Replacing Objects in Python"
@meffie
meffie / kernel-ppa
Last active April 6, 2023 19:59
Shell script to download mainline kernel ppa packages published by the Ubuntu kernel team.
#!/bin/sh
#
# Download mainline kernel ppa packages published by the Ubuntu kernel team.
#
# usage: kernel-ppa list
# kernel-ppa get [<version>]
# kernel-ppa install
#
#
@meffie
meffie / virsh-rename
Created February 16, 2017 14:15
Rename a libvirt domain.
#!/bin/sh
#
# Rename a domain.
# Note: The domain must be shutdown.
#
die() {
echo $1 >&2
exit 1
}
@meffie
meffie / virsh-domipaddr
Created February 16, 2017 14:48
Get the ip4 addr of a domain with arp. (Helper for old versions of virsh).
#!/bin/sh
#
# Get the ipv4 address of a domain.
#
# Note: This script is obsoleted by modern versions of virsh.
#
name=$1
if [ "x$1" = "x" ]; then
echo "usage: virsh-domipaddr <name>" >&2
@meffie
meffie / afsutil-install-example
Last active March 9, 2017 14:18
Installing an openafs client with afsutil.
$ afstuil build
...
$ sudo afsutil install \
> --dist transarc \
> --comp client \
> --cell sinenomine.net \
> --realm SINENOMINE.NET \
> --hosts afsdb1.sinenomine.net afsdb4.sinenomine.net afsdb5.sinenomine.net
Looking up ip address of hostname afsdb1.sinenomine.net.
Looking up ip address of hostname afsdb4.sinenomine.net.
@meffie
meffie / emit.c
Last active March 7, 2018 09:24
Example libyaml emitter
/*
* Example libyaml emitter.
*
* This is a basic example to demonstrate how to convert raw data to a yaml
* stream using the libyaml emitter API. The example data to be converted is
* is a simple array of structs,
*
* struct fruit data[] = {
* {"apple", "red", 12},
* {"orange", "orange", 3},
@meffie
meffie / Makefile
Last active December 12, 2023 13:26
libyaml examples
all: emit scan parse
emit.o: emit.c
gcc -c emit.c -g -O0 -Wall
emit: emit.o
gcc -o emit emit.o -lyaml
scan.o: scan.c
@meffie
meffie / csdb.py
Created October 12, 2017 21:40
csdb parser
#!/usr/bin/python
import re
import pprint
import urllib2
from sh import rxdebug
def get_csdb():
response = urllib2.urlopen('https://grand.central.org/dl/cellservdb/CellServDB')
return response.read()
@meffie
meffie / check-acinclude-refactor.sh
Last active January 4, 2018 18:13
check openafs acinclude refactor
#!/bin/sh
git clean -d -f -q -x
git fetch https://gerrit.openafs.org/openafs refs/changes/44/12844/3
git checkout FETCH_HEAD
git log -n1 --oneline
echo 0.0.0 >.version # avoid false hunks in diff
./regen.sh -q
mv configure configure.new
mv configure-libafs configure-libafs.new