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
def humanized_diff(L, delta): | |
""" | |
Convert the given (sorted!!) tabular diff to a string, | |
marked up with +s and -s, similar to regular diff(1)'s "-u" mode. | |
""" | |
D, A = delta | |
U, D = drop(L, D), [L[i] for i in D] | |
def prefix(v, S): |
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 -e | |
i=0 | |
while true; do | |
echo "yadda yadda ||$i||" | |
sleep 3; | |
i=$(($i+1)) | |
done | |
#while true; do #HILARIOUS: |
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
-- 1) run postgres | |
-- 2) load this into it (if postgres wasn't compiled with python support, bad things will happen) | |
CREATE LANGUAGE plpython2u; | |
DROP FUNCTION IF EXISTS b(); | |
CREATE FUNCTION b() RETURNS void AS $$ | |
print "HATCH HATCH HATCH" | |
print plpy |
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
This is a dump of the ASCII found in the bootloaders (plural!) on a T-Mobile branded LG-P769. | |
This phone is mostly just an Texas Instruments OMAP4430, which is a reasonably liberal system board. | |
The board has a microscopic 1st stage bootloader in ROM | |
x-loader is the tiny 2nd stage bootloader | |
u-boot is the standard ARM bootloader, which is a 3rd stage loader for this system, instead of being a 2nd stage like on most phones. | |
Each partition was dumped by | |
``` | |
adb shell "su -c 'dd if=/dev/block/mmcblk0p$i of=/sdcard/mmcblk0p$i.img'" | |
adb shell pull /sdcard/mmcblk0p$i.img |
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
If you're on Archlinux you shouuuuld just be able to drop these two files in a dir by themselves, chmod +x them, and run "install.sh". | |
If you're on a different Unix you can probably adapt this without too much effort to your system, especially the part about . | |
If you're not in Winter 2015 you probably need to tweak update.sh. | |
Sorry for the poor documentation and poor testing! And also the almost complete lack of error handling! | |
Hopefully this helps someone else in the future! this represents 13 hours of my life! | |
Tip: make your empty dir a git repo so that then you can just do | |
``` | |
git clean -df && git clean -xfd |
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
...possibly python wins this one. |
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
# ***** BEGIN LICENSE BLOCK ***** | |
# Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
# | |
# The contents of this file are subject to the Mozilla Public License Version | |
# 1.1 (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# http:#www.mozilla.org/MPL/ | |
# | |
# Software distributed under the License is distributed on an "AS IS" basis, | |
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
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 | |
# automagic VPNing into Windows machines, via ssh | |
# this assumes the machine you're VPNing into also runs an ssh server, which admittedly is an unusual configuration (it could be stretched to not do this) | |
# we knock on the RDP port; if it doesn't respond, assume we're outside of the firewall, and construct a tunnel | |
#XXX -g workarea *does not work* with i3. Much sadness. | |
HOST=${HOST:=XXXXXXXXXXXXXXXXXXX} | |
PORT=${PORT:=3389} |
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
# mpd config file | |
### XXX this has been manually hacked up to | |
# mpd (undocumentedly) checks $XDG_CONFIG_DIR/mpd/mpd.conf before ~/.mpdconf, before /etc/mpd.conf | |
# since it does that... why not the rest of the system eh? | |
# but this script doesn't understand environment vars of course, though it *will* expand ~/ to $HOME | |
# for some reason linux has decided that $XDG_RUNTIME_DIR should be on /run (/run/user/1000) which is annoying | |
# Files and directories ####################################################### |
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 | |
# unrealircd is designed to be VERY GOOD at staying alive | |
# which means it's very hard to kill | |
# ctrl-c'ing it doesn't kill it, but sometimes it restarts it | |
# instead, we background it and translate ctrl-c to a stronger signal, which it will listen to | |
# | |
CONF=$(mktemp ircd.conf.XXXXX) | |
LOG=$(mktemp ircd.log.XXXXXX) |
OlderNewer