- Recovering a root disk is a bit of a pain, surprising that there isn't a way to stop a vm/detach a disk and edit it elsewhere. the general pattern is:
- snapshot running? instance
- create new disk from snapshot
- attach disk to working VM
- modify disk
- clone old VM with new disk
- move over any stuff (IP, ..?)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# program '.....' unused_letters exclusions | |
# board='..i..' guess=['roate','spunk','climb'] 3:a 1:s 4:m | |
# program '..i..' rotepunkclb 3:a 1:s 4:m | |
import sys | |
def main() -> int: | |
pattern = sys.argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#picaxe 14m2 | |
; constants | |
symbol COUNTPERIOD = 548 ; number of ms to count vss_in pulses | |
; 548 gives means vss_in ~= actual mph | |
symbol NUM_HINTS_UP = 5 ; number of times vss_in must be reported as fast/slow for the | |
symbol NUM_HINTS_DN = 5 ; tail to be triggered up/down | |
; 1 unit = .56sec | |
; 5 = 2.8sec | |
symbol MPH_RAISETAIL = 65 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function venv-activate { | |
if [ ! -z "$1" ]; then | |
. $PWD/$1/bin/activate | |
else | |
_matches=($(compgen -G "*/bin/activate") $(compgen -G ".??*/bin/activate")) | |
if [ ${#_matches[@]} -eq 0 ]; then | |
echo "Environment not found." | |
elif [ ${#_matches[@]} -eq 1 ]; then | |
_env=${_matches[0]} | |
echo "Found $_env" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Wed May 4 21:27:17 2016] Processing genuino101 (platform: intel_arc32, board: genuino101, framework: arduino) | |
------------------------------------------------------------------------------------------------------------------------ | |
arc-elf32-ar rcs .pioenvs/genuino101/libFrameworkArduino.a .pioenvs/genuino101/FrameworkArduino/CDCSerialClass.o .pioenvs/genuino101/FrameworkArduino/IPAddress.o .pioenvs/genuino101/FrameworkArduino/Print.o .pioenvs/genuino101/FrameworkArduino/RingBuffer.o .pioenvs/genuino101/FrameworkArduino/Stream.o .pioenvs/genuino101/FrameworkArduino/Tone.o .pioenvs/genuino101/FrameworkArduino/UARTClass.o .pioenvs/genuino101/FrameworkArduino/WInterrupts.o .pioenvs/genuino101/FrameworkArduino/WMath.o .pioenvs/genuino101/FrameworkArduino/WString.o .pioenvs/genuino101/FrameworkArduino/abi.o .pioenvs/genuino101/FrameworkArduino/hooks.o .pioenvs/genuino101/FrameworkArduino/i2c.o .pioenvs/genuino101/FrameworkArduino/main.o .pioenvs/genuino101/FrameworkArduino/new.o .pioenvs/genuino101/FrameworkArdui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
I hereby claim:
- I am nrh on github.
- I am nrh (https://keybase.io/nrh) on keybase.
- I have a public key whose fingerprint is C3D6 558D DB19 338F B722 3F6E 1267 D59D 266A 375D
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ "`whoami`" != "root" ] && echo "Should be run by root!" && exit 1 | |
[ -e *.vmdk ] || ( echo Extracting VMDK image from *.ova ... ; tar xf *.ova ) | |
[ -e github.img ] || ( echo Converting *.vmdk to raw image ... ; qemu-img convert *.vmdk github.img ) | |
echo Preparing mounts ... | |
losetup -f github.img -P | |
vgchange -ay enterprise-11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nrh@tinydancer ~/projects/pyrange (master)] nosetests -vxs | |
ok_expando_0 '[1-10]' ... | |
<Expando begin="1" end="10"/> | |
ok | |
ok_expando_1 '[10-1]' ... | |
<Expando begin="10" end="1"/> | |
ok | |
ok_expando_2 '[9999-10000]' ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
# describe symlink destination as ["#]file: .foo, assume $HOME | |
for file in dot.*; do | |
dest=`grep '^[\"\#\/].*.file:' "$file"|gawk -F'[:[:space:]]' '{print \$3}'` | |
dest=$(eval echo $dest) | |
destdir=${dest%/*} | |
if [ "$destdir" != "$dest" -a ! -d "${HOME}/${destdir}" ]; then |
NewerOlder