Skip to content

Instantly share code, notes, and snippets.

@paxperscientiam
paxperscientiam / .gitconfig
Created May 10, 2017 16:32
Some git aliases I like
# Note, I call my fork 'origin' and the owner's fork 'upstream'.
# this syncs your current branch with that of upstream/master
rewind = reset --hard upstream/master
# make log output pleasing to the eye.
log = log --oneline --graph --pretty=format:'%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]' --decorate --all
# this destroys a branch locally and remotely. Must not be the active branch.
nuke = "!sh -c 'git branch -D $1 && git push origin :$1' -"
@paxperscientiam
paxperscientiam / promise-chain.js
Created May 14, 2017 18:01
promise chain example
// thanks to @kakashiAL from #node.js on freenode
function getDataA(data) {
return new Promise (function(res,rej) {
res(data);
})
}
function getDataB(data) {
return new Promise (function(res,rej) {
@paxperscientiam
paxperscientiam / Aircrack Commands
Created May 15, 2017 21:15 — forked from victorreyesh/Aircrack Commands
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//Install Macports.
//Install aircrack-ng:
sudo port install aircrack-ng
//Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
//Figure out which channel you need to sniff:
sudo airport -s
sudo airport en1 sniff [CHANNEL]
@paxperscientiam
paxperscientiam / brew-instructions.sh
Created May 27, 2017 03:11 — forked from petemcw/brew-instructions.sh
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.dev domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache
@paxperscientiam
paxperscientiam / chmodr.sh
Created July 5, 2017 19:13 — forked from francisbyrne/chmodr.sh
Recursive chmod script for dirs and/or files
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#
@paxperscientiam
paxperscientiam / bash-args-options
Created July 9, 2017 01:03 — forked from un33k/bash-args-options
Bash - Simple Skeleton for arg parsing in bash
#!/bin/bash
# Argument = -t test -r server -p password -v
usage()
{
cat << EOF
usage: $0 options
This script run the test1 or test2 over a machine.
@paxperscientiam
paxperscientiam / testanybar.sh
Last active July 13, 2017 22:04
Attempt AnyBar launch only if AnyBar not already using it
# Note, use at your own peril.
# Will test a set of ports so that anybar instance not created with unfree port.
# silent.
for i in {1738..1740}; do
netstat -ln | grep -q $i
[ ! $? -eq 0 ] && ANYBAR_PORT=$i open -na AnyBar
done
# https://github.com/tonsky/AnyBar
@paxperscientiam
paxperscientiam / frontendDevlopmentBookmarks.md
Created July 15, 2017 17:51 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@paxperscientiam
paxperscientiam / create_tunnel
Last active October 3, 2017 15:10
Julian Simioni's to accesss *nix machine behind home router (tweaked)
#!/bin/bash
# 'pax' is simply an alias for one my ssh connections,
# which are configured in your user ssh_config file.
# For more info, see Julian Simioni's original post:
# https://juliansimioni.com/blog/howto-access-a-linux-machine-behind-a-home-router-with-ssh-tunnels/
relay_server="pax"
createTunnel() {
@paxperscientiam
paxperscientiam / install-mosh.sh
Created October 1, 2017 18:18 — forked from jaywilliams/install-mosh.sh
Compiling and running mosh on Dreamhost (Updated - 2017)
#!/usr/bin/env bash
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME/local
VERSION=1.2.6
# Create Source Directory
mkdir -p $PREFIX/src