Skip to content

Instantly share code, notes, and snippets.

View gretel's full-sized avatar
🚀
the jitter does know where it is at none time

Tom Hensel gretel

🚀
the jitter does know where it is at none time
View GitHub Profile
@gretel
gretel / .curlrc
Created May 14, 2016 13:20
people seem to be afraid about having a .curlrc - i dont because i have read the documentation :)
#ipv6
#verbose
connect-timeout=30
no-sessionid
progress-bar
referer=";auto"
retry-delay=3
retry=2
show-error
user-agent="curl/7.9.8 (i686-pc-linux-gnu) libcurl 7.9.8 (OpenSSL 0.9.6b) (ipv6 enabled)"
@gretel
gretel / bootstrap_python.sh
Last active June 22, 2016 00:42
debian/ubuntu: script ensures `python-2.7` gets installed so `ansible` can be
#!/usr/bin/env sh
# https://gist.github.com/gretel/7a76a3fe1e15a8a8e0c37457d18e795a
# 2016 tom hensel <github@jitter.eu>
# this script ensures `python-2.7` gets installed so `ansible` can be (on debian)
# i.e. in a `Vagrantfile`:
# config.vm.provision 'Bootstrap Python', type: 'shell', path: 'scripts/bootstrap_python.sh', args: ['2.7', 'python python-pkg-resources']
#
find_pyver="$1"
if [ -z "$find_pyver" ]; then
@gretel
gretel / openbsd.profile.sh
Last active October 25, 2016 15:56
profile is all so on openbsd (sh/ksh)
# $OpenBSD: ~/.profile
#
# gretel's sh/ksh initialization
trap '. $HOME/.logout; exit' 0
escape=$(print '\033')
ctrla=$(print '\001')
PS1=$(print '\001\015')
PS1=$PS1$ctrla$escape'[$(($? ? 31 : 32))m'$ctrla
@gretel
gretel / clean.gcode
Last active January 27, 2017 07:14
gcode to clean the nozzle before starting to print. works super for a Multec M420 and should for many other single-extruders
;...
;https://gist.github.com/gretel/b78fc580b805225f51ba96afcd2e7624
M117 Cleaning ;display
G1 X0 Y0 Z10 F3000 ;move to cleaning position
T0 ;select tool
G92 E0 ;reset position
M300 S300 P50 ;beep
G1 Z0 F1200 ;lower nozzle
G4 S1 ;spread heat
M106 S64 ;fan on, slowly
@gretel
gretel / rpi3strech_custom
Last active April 14, 2017 17:36
template for https://github.com/drtyhlpr/rpi23-gen-image to build a very minimal debian strech image (armhf/rpi3)
# https://gist.github.com/gretel/0b3cb1fced594fa0a9011c91da2603d8
# https://github.com/drtyhlpr/rpi23-gen-image/blob/master/README.md
#
APT_INCLUDES="ca-certificates,curl,tmux"
APT_SERVER="ftp.de.debian.org"
BUILD_KERNEL=true
DEFLOCAL="en_US.UTF-8"
ENABLE_DHCP=true
ENABLE_HARDNET=true
ENABLE_MINBASE=true
// www.thingiverse.com/thing:1397964
// https://gist.github.com/gretel/3a2ff28e2489105f966c787eed160ef1
/* Measurements */
// Dog Width in inches
A = 5.906;
// Dog Height in inches
B = 11.417;
@gretel
gretel / install_suricata.sh
Last active May 30, 2017 17:46
install suricata on openbsd-current https://suricata-ids.org
#!/bin/sh
## adopted from https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Basic_Setup
doas pkg_add gcc git libtool pcre jansson libmagic libyaml
## version strings might change like patchlevel and stuff
doas pkg_add libnet-1.1.2.1p3v0 autoconf-2.69p2 automake-1.14.1p0
cd
git clone --depth 1 git://phalanx.openinfosecfoundation.org/oisf.git
cd oisf
git clone --depth 1 https://github.com/OISF/libhtp.git -b 0.5.x
export AUTOCONF_VERSION=2.69
@gretel
gretel / fix_brew.sh
Last active June 8, 2017 18:32
homebrew on 'brew update' brawling "Your local changes to the following files would be overwritten by merge" at you? add a scoop of shell!
#!/bin/sh
#
cd $(brew --repository)
git reset --hard FETCH_HEAD
cd $(brew --repository)/Library
git clean -fd
@gretel
gretel / external_ip.go
Last active June 10, 2017 11:10
tiny golang to gather external ipv4/6 addresses using https://github.com/andreaskoch/myip
///usr/bin/true; exec /usr/bin/env go run "$0" "$@"
//
//https://gist.github.com/gretel/1cadb5c626930cab7a0b8687aa710916
//usage:
// $ external_ip.go
// $ external_ip.go -4=true -6=true
// $ external_ip.go -4=false -6=true
package main
@gretel
gretel / build_sierra_iso.sh
Created September 20, 2017 15:26
build osx sierra .iso to use in virtualbox (or burn a dual-layer rom)
rm -f /tmp/Sierra.cdr
rm -f /tmp/Sierra.cdr.dmg
hdiutil attach '/Applications/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg' -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg