Skip to content

Instantly share code, notes, and snippets.

View fuzzy's full-sized avatar

Mike 'Fuzzy' Partin fuzzy

View GitHub Profile
/*
Copyright (c) 2014, Mike 'Fuzzy' Partin <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
# On the Chromebook:
#
DEV=/dev/mmcblk1
MNT=/mnt
# Unmount from wherever ChromeOS decided to mount the device,
# remount where we want:
umount ${DEV}p2
mount ${DEV}p2 ${MNT}
# Complete the bootstrap:
chroot ${MNT} /debootstrap/debootstrap --second-stage
@fuzzy
fuzzy / output
Created November 1, 2015 09:56
bull crap output
[255, 0, 0]
[255, 0, 0]
[255, 87, 0]
[255, 196, 0]
[205, 255, 0]
[ 95, 255, 0]
[ 0, 255, 13]
[ 0, 255, 122]
[255, 0, 0]
[255, 96, 0]
@fuzzy
fuzzy / config.py
Last active April 8, 2021 22:19
parses config files
import os
import re
import json
import shlex
import types
import ConfigParser
_tokens = []
data = {'global': {}}
regex = {
package main
import (
"fmt"
"reflect"
)
type ApiKey struct {
Key string
Enabled bool
package main
import (
"fmt"
"reflect"
)
type ApiKey struct {
Key string
Enabled bool
package main
import (
// "bufio"
// "io"
"fmt"
"os"
"math"
"path"
"math/rand"
@fuzzy
fuzzy / bootstrap-go.sh
Created June 20, 2015 16:25
bootstrap-go.sh
#!/bin/sh
unset GOROOT
unset GOPATH
GOBASE=${HOME}/.govers/$(uname -s)/$(uname -m)
GO_SVER=${1:-"1.4.2"}
go14src=https://storage.googleapis.com/golang/go${GO_SVER}.src.tar.gz
go14fnm=$(basename ${go14src})
@fuzzy
fuzzy / golang15-bootstrap.sh
Last active August 29, 2015 14:22
bootstrap for go1.5
#!/bin/sh
go14src=https://storage.googleapis.com/golang/go1.4.2.src.tar.gz
go14fnm=$(basename ${go14src})
bootstrap() {
cd /tmp
wget ${go14src}
tar zxf ${go14fnm}
cd /tmp/go/src
must() {
case "${1}" in
(have)
case "${2}" in
(file) test -f ${3} || err "Missing file: ${3}" ;;
(link) test -L ${3} || err "Missing symlink: ${3}" ;;
(dir) test -d ${3} || err "Missing dir: ${3}" ;;
(prog) which ${3} >/dev/null 2>&1 || err "Missing ${2}: ${3}" ;;
(user) test ! -z "$(grep ${3} /etc/passwd)" || err "Missing ${2}: ${3}" ;;
(group) test ! -z "$(grep ${3} /etc/group)" || err "Missing ${2}: ${3}" ;;