Skip to content

Instantly share code, notes, and snippets.

dohsimpson / wireguard.conf
Created October 3, 2020 15:58 — forked from nealfennimore/wireguard.conf
Wireguard VPN - Forward all traffic to server
View wireguard.conf
# ------------------------------------------------
# Config files are located in /etc/wireguard/wg0
# ------------------------------------------------
# ---------- Server Config ----------
Address = # IPV4 CIDR
Address = fd86:ea04:1111::1/64 # IPV6 CIDR
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Add forwarding when VPN is started
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Remove forwarding when VPN is shutdown
dohsimpson / gist:62b4bf6b028138990bb5e3fb0c0f4093
Created May 2, 2019 15:39
Install VIM8 from source (Unix)
View gist:62b4bf6b028138990bb5e3fb0c0f4093
cd /tmp/
tar xzf v8.1.1244.tar.gz
cd vim-8.1.1244/
./configure --enable-perlinterp --enable-rubyinterp --enable-python3interp --enable-luainterp
make install
View learn-django-rest.txt
* Notice that we're using hyperlinked relations in this case, with HyperlinkedModelSerializer. You can also use primary key and various other relationships, but hyperlinking is good RESTful design
* HyperlinkedModelSerializer:
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')
dohsimpson /
Created October 13, 2018 23:02 — forked from wikrie/
Install Tmux 2.5 Ubuntu
# Steps to build and install tmux from source on Ubuntu.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
sudo apt-get -y remove tmux
sudo apt-get -y install wget tar libevent-dev libncurses-dev
tar xf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
dohsimpson / sa_application_guide.markdown
Last active November 7, 2018 01:04
SA Application Guide
View sa_application_guide.markdown


Create User

$ sudo -u postgres createuser -P cronly
$ sudo -u postgres psql
psql (10.5 (Ubuntu 10.5-2.pgdg16.04+1))
Type "help" for help.

postgres=# ALTER USER my_username WITH PASSWORD 'my_password';
dohsimpson / advanced_search.markdown
Last active March 24, 2023 21:42
Advanced Search Tricks
View advanced_search.markdown


  • "cocotte bag": exact match
  • "* is thicker than water": * to replace a phrase inside exact match
  • jaguar -car: minus to filter out matches
  • google: search on site, you don't need '.', e.g. 'site:gov'
  • define:bae: check definition, even for slang
  • $0..$50: numeric range (ignore $)
  • "inbound marketing" ~professional: synonyms
  • similar sites
dohsimpson / better_than_self.txt
Last active April 1, 2018 21:30
Better Than Self Hosted
View better_than_self.txt
* BitTorrent (or http) Download: 百度盘离线下载
* Voip: GMail -> Hangout
dohsimpson / docker-tools.txt
Created March 20, 2018 12:09
Docker Tools
View docker-tools.txt
composerize: turn docker cli command into docker-compose file
* composerize docker run -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro --restart always --log-opt max-size=1g nginx
dohsimpson / angular.txt
Created December 7, 2017 02:48
Frontend Development with Angular
View angular.txt
## Angluar CLI
* angular new APP_NEW
* angular generate component NEW_COMPONENT