This file contains hidden or 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/env python | |
keylist = " 5H4S!V3I?F@U$^2E L R - A P W J .6B=D/X7N C K Y T Z G Q M8: O9)0" | |
def decode(code): | |
o = i = len(keylist) >> 1 | |
for c in code: | |
o >>= 1 | |
i += o if c == '-' else -o | |
return keylist[i] |
This file contains hidden or 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
Verifying that +elitak is my blockchain ID. https://onename.com/elitak |
This file contains hidden or 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/env bash | |
# nixos-infect is so named because there's a good chance the system will get | |
# sick if anything goes wrong, and possibly die, requiring reprovisioning. | |
# Use with caution. | |
# | |
# WARNING NB This script wipes out the targeted host's root filesystem when it | |
# runs to completion. Any errors halt execution. set -x is used to help debug, | |
# as often a failed run leaves the system in an inconsistent state, requiring a | |
# rebuild (in DigitalOcean panel: Droplet Settings -> "Destroy" -> "Rebuild |
This file contains hidden or 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
//// UI | |
dota_camera_disable_zoom "1" //Can't zoom camera in | |
engine_no_focus_sleep 0 // unlimited alt-tabbed framerate | |
dota_minimap_hero_size 1100 //Changes the size of heroes on the minimap | |
// this enables alt+right click to move towards location without pathing | |
// (stop at first obstacle). This is for aiming forcestaff/raze/pounce, | |
// planting wards on base highground, fake planting wards in river, | |
// move illus onto rosh (clicks thru), |
This file contains hidden or 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
@echo off | |
set PATH=%~dp0;.;%PATH% | |
for %%I in (busybox.exe) do set BUSYBOX=%%~$PATH:I | |
REM this is still wrong if scriptname has a space in it | |
REM (bug? just don't put a space in this filename) | |
set ORIGPATH=%~f0 | |
"%BUSYBOX%" sed "1,/^#!\/bin\/bash/d" "%ORIGPATH%" > "%TEMP%\%~n0.sh" |
This file contains hidden or 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 | |
# Rather than scping to then invoking this script on the remote host, you can run: | |
# sed s,^tarpath=.*,tarpath=theURL, thisfile | ssh targethost | |
# TODO: add this as an invocation option that can be run on local host. | |
set -a | |
if [[ "$BASH_SOURCE" = "$0" ]]; then | |
[[ `whoami` == "root" ]] || { echo "Run as root."; exit 1; } |
This file contains hidden or 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/env python | |
from github import Github | |
import os, sys | |
g = Github(os.environ.get('GH_USER', 'elitak'), os.environ.get('GH_PASS', '')) | |
g.get_user().create_repo(name=sys.argv[1]) | |
for repo in g.get_user().get_repos(): | |
print(repo.name) |
This file contains hidden or 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
# in one window, get the offenders (change ack filter to whatever's most accurate) | |
sudo tail -f /var/log/nginx/access.log | ack 'GET / ' | awk '{print $1}' | teesample | |
# in the other, have a look at the worst with this: | |
sort sample | uniq -c | sort -n | tail -n 50 | |
# and then ban them | |
sort sample | uniq -c | sort -n | awk '{print }' | tail -n 50 | xargs -i echo {} tcp http | sudo tee -a /etc/shorewall/blacklist | |
# restart shorewall, then nginx to clear up latent connections | |
# Then, restart the sampler to get a new batch. |