Skip to content

Instantly share code, notes, and snippets.

@gardner
gardner / sauce_is_missing.sh
Last active August 8, 2017 06:18
Create React Native App with Maps
#!/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"
@gardner
gardner / iptables.sh
Last active August 11, 2017 10:45
Allow http,https from CloudFlare. Allow ssh from Mexico. Prevent new outgoing connections.
#!/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
@gardner
gardner / provision.sh
Last active November 22, 2019 22:33
Provision Scaleway C2L Debian Buster instance as a high bandwidth i2p relay with fail2ban and rkhunter
#!/bin/bash
# Update Debian
apt-get update && apt-get upgrade -y && apt-get install apt-transport-https fail2ban rkhunter -y
# Remove apt versions of lynis (should not be required on new instance)
apt-get remove --purge lynis
# Add lynis apt repo
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C80E383C3DE9F082E01391A0366C67DE91CA5D5F
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/99disable-translations
@gardner
gardner / aws_vs_scaleway.log
Last active September 5, 2017 08:18
AWS c4.large vs Scaleway C2L
[email protected]:~# sysbench --test=cpu --cpu-max-prime=20000 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
#!/bin/sh
# This file is part of netfilter-persistent
# (was iptables-persistent)
# Copyright (C) 2009, Simon Richter <[email protected]>
# Copyright (C) 2010, 2014 Jonathan Wiltshire <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
@gardner
gardner / uninstall_vmware.sh
Created November 17, 2017 20:46
Uninstall vmware fusion
#!/bin/bash
# @see https://kb.vmware.com/s/article/1017838
rm -rf "/Library/Application Support/VMware"
rm -rf "/Library/Application Support/VMware Fusion"
rm -rf "/Library/Preferences/VMware Fusion"
rm -rf "~/Library/Application Support/VMware Fusion"
rm -rf "~/Library/Caches/com.vmware.fusion"
rm -rf "~/Library/Preferences/VMware Fusion"
@gardner
gardner / README.md
Created November 24, 2017 11:10 — forked from Anubisss/README.md
How to compile statically linked OpenVPN client for ARMv5

How to compile statically linked OpenVPN client for ARMv5

You need to install ARMv5 gcc cross compiler: apt-get install gcc-arm-linux-gnueabi

You have to define a directory (via --prefix) where all of your binaries will be installed (copied). In the guide I use the following: /home/user/vpn_compile

OpenSSL

  1. Download the source: wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz
@gardner
gardner / less_urgent_hotels.js
Created November 26, 2017 01:57
Remove annoying urgency decorations from Hotels.com booking website
// ==UserScript==
// @name Hotels.com Silence Urgency
// @namespace https://gist.github.com/gardner/3196364c7c6c701d800906757798ae6c
// @version 0.1
// @description Remove annoying urgency decorations from Hotels.com booking website
// @author Gardner Bickford
// @match https://www.hotels.com/*
// @grant none
// ==/UserScript==
@gardner
gardner / .bash_profile
Last active October 24, 2019 22:51
bash aliases
#!/bin/bash
export GREP_OPTIONS='--color'
## Save everything
export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi'
# Print some useful milestones
python -c "from datetime import date; print '%s days until beta' % (date(2018,04,07) - date.today()).days; print '%s days until release' % (date(2018,10,7) - date.today()).days; print '%s days left of TSM ' % (90 - (date.today() - date(2017,9,10)).days)" &

Keybase proof

I hereby claim:

  • I am gardner on github.
  • I am gbickford (https://keybase.io/gbickford) on keybase.
  • I have a public key ASC1xdWdbMj5Wox1M_C7kCEXZ9m8XkVcRsTLRAyh7585cgo

To claim this, I am signing this object: