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 | |
apt-get install ipset netfilter-persistent -y | |
iptables-save > /tmp/iptables.backup | |
iptables -F | |
if ipset create cf hash:net; then | |
for x in $(curl https://www.cloudflare.com/ips-v4); do ipset add cf $x; done | |
fi |
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 | |
npm install -g react-native-cli && \ | |
react-native init MDemo && cd MDemo && \ | |
git init && git add . && git commit -am "Initial commit after react-native init" && \ | |
npm install --save react-native-maps && react-native link react-native-maps && \ | |
git commit -am "Added react-native-maps and then ran: react-native link react-native-maps" |
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
{ Error: Must be input type | |
at invariant (/Users/gardner/src/demo/join-monster/node_modules/graphql/jsutils/invariant.js:19:11) | |
at valueFromAST (/Users/gardner/src/demo/join-monster/node_modules/graphql/utilities/valueFromAST.js:156:125) | |
at getArgumentValues (/Users/gardner/src/demo/join-monster/node_modules/graphql/execution/values.js:144:57) | |
at Object.populateASTNode (/Users/gardner/src/demo/join-monster/dist/query-ast-to-sql-ast/index.js:100:21) | |
at Object.queryASTToSqlAST (/Users/gardner/src/demo/join-monster/dist/query-ast-to-sql-ast/index.js:60:19) | |
at /Users/gardner/src/demo/join-monster/dist/index.js:9:29 | |
at next (native) | |
at step (/Users/gardner/src/demo/join-monster/dist/index.js:103:183) | |
at /Users/gardner/src/demo/join-monster/dist/index.js:103:437 |
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 | |
sudo apt-get install git make debootstrap -y | |
curl -sSL https://get.docker.com | sh | |
git clone https://github.com/jmtd/debian-docker.git | |
cd debian-docker/ | |
sudo make release=jessie prefix=gardner arch=armhf mirror=http://mirrordirector.raspbian.org/raspbian/ | |
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/sh | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update && apt-get upgrade -y && apt-get install build-essential git curl screen -y | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash | |
source .bashrc | |
nvm install v6 | |
git clone https://github.com/gardner/vanityssb.git | |
cd vanityssb |
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
# find case-insensitive string within files using all cpu cores | |
alias f='time find . \( -name .git -o -name node_modules \) -prune -o -type f -print0 | xargs -0 -n1 -P8 grep -H' | |
# show which processes are listening on which ports as numbers | |
alias lsof="sudo lsof -iTCP -sTCP:LISTEN -P -n" | |
# "shell" into a docker instance | |
docker_ssh() { | |
container_id=$(docker ps | awk '{ print $1 " " $2}' | grep $1 | awk '{ print $1}') | |
docker container inspect $container_id | grep Image | tail -1 | awk '{ print $2 }' |
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 | |
/usr/bin/caffeinate -s dd if=/dev/disk0s2 of=backup.img bs=4m | |
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 | |
if [ $EUID != 0 ]; then | |
sudo "$0" "$@" | |
exit $? | |
fi | |
if [ -z "$1" ]; then | |
echo "Usage: sudo $0 client_name" | |
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
#!/bin/bash | |
export DEBIAN_FRONTEND="noninteractive" | |
sudo apt-get update && sudo apt-get upgrade | |
sudo apt-get install openjdk-8-jdk -y | |
sudo apt-get install git ccache automake lzop bison gperf build-essential \ | |
zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx \ |
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 | |
# This creates a CSV file that can be uploaded to Google Docs where you can insert a chart to graph the values | |
LOG_FILE=/var/log/url_monitor.log | |
if [ ! -f $LOG_FILE ]; then # add CSV column headers | |
echo Date,Total Time,Redirect Time,DNS Lookup,Connect,App Connect,Pretransfer,starttransfer,Status Code > $LOG_FILE | |
fi |