Skip to content

Instantly share code, notes, and snippets.

View troyunverdruss's full-sized avatar

Troy Unverdruss troyunverdruss

View GitHub Profile
[
["f", "Show next/latest diffs", "setProposedDiffBounds()"],
["n", "Next unreviewed file", "nextUnreviewedFile()"],
["p", "Previous unreviewed file", "prevUnreviewedFile()"],
[null, "Next personally unreviewed file", "nextPersonallyUnreviewedFile()"],
[null, "Previous personally unreviewed file", "prevPersonallyUnreviewedFile()"],
["shift+n", "Next changed file", "nextChangedFile()"],
["shift+p", "Previous changed file", "prevChangedFile()"],
[null, "Next visible file", "nextVisibleFile()"],
echo 8 custom > /etc/iproute2/rt_tables
ip rule add fwmark 8 table custom
ip route add default via globalip dev vlan2
iptables -A OUTPUT -t mangle -o tun11 -p tcp --sport 2222 -j MARK --set-mark 8
iptables -A PREROUTING -t mangle -s internalip/32 -p tcp --sport 22 -j MARK --set-mark 8
iptables -A PREROUTING -t mangle -s internalip/32 -p udp --sport 1194 -j MARK --set-mark 8
echo 0 > /proc/sys/net/ipv4/conf/vlan2/rp_filter
@troyunverdruss
troyunverdruss / org.my.ifconfig.plist
Created June 12, 2019 16:25
Set up a loopback IP on startup, put in file: /Library/LaunchDaemons/org.my.ifconfig.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.my.ifconfig</string>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
#!/bin/bash
# in ~/.gitconfig
# [alias]
# lines = !~/bin/calculate-changed-lines.sh
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
CURRENT_REPO_PATH=$(git rev-parse --show-toplevel)
@troyunverdruss
troyunverdruss / US_no_modifiers.keylayout
Created April 20, 2019 00:30
US QWERTY without any modifiers, (goes in /Library/Keyboard Layouts)
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Created by Ukelele version 3.3.0.248 on 2019-01-14 at 12:43 (PST)-->
<!--Last edited by Ukelele version 3.3.0.248 on 2019-01-14 at 12:43 (PST)-->
<keyboard group="126" id="-9574" name="US_no_modifiers" maxout="1">
<layouts>
<layout first="0" last="17" mapSet="ANSI" modifiers="Modifiers"/>
<layout first="18" last="18" mapSet="JIS" modifiers="Modifiers"/>
<layout first="21" last="23" mapSet="JIS" modifiers="Modifiers"/>
<layout first="30" last="30" mapSet="JIS" modifiers="Modifiers"/>
@troyunverdruss
troyunverdruss / docker-compose.yml
Created April 4, 2019 23:58
Run essential services in a container
version: "2"
services:
pihole:
container_name: pihole
restart: always
image: pihole/pihole:latest
hostname: pihole
domainname: local
environment:
- ServerIP=10.0.2.27
#!/bin/bash
# Handy script to print out how much your branch diverges from master
# to help you reduce pull request size for your reviewers
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
CURRENT_REPO_PATH=$(git rev-parse --show-toplevel)
@troyunverdruss
troyunverdruss / multiple-inheritance.py
Last active June 19, 2018 00:49
Multiple inheritance with Python 3
#!/usr/bin/env python3
class A(object):
def go(self):
print("Entering A")
print("go A go")
class B(A):
private AtomicInteger poolIdProvider = new AtomicInteger(0);
public ThreadFactory getThreadFactory(String name) {
int poolId = poolIdProvider.getAndIncrement();
//grab security group for use in all threads from this factory
SecurityManager s = System.getSecurityManager();
ThreadGroup group = s != null ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
return new ThreadFactory() {

Keybase proof

I hereby claim:

  • I am troyunverdruss on github.
  • I am troyunverdruss (https://keybase.io/troyunverdruss) on keybase.
  • I have a public key whose fingerprint is 19BA BB61 8F63 4A88 E7B6 1D2A B3C1 2869 D1DB 4D24

To claim this, I am signing this object: