$ 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';
ALTER ROLE
This file contains 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
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: dind | |
namespace: public | |
labels: | |
app: dind | |
annotations: {} | |
spec: |
This file contains 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
{ | |
"basics": { | |
"name": "Joe Doe", | |
"label": "", | |
"image": "", | |
"email": "john@gmail.com", | |
"phone": "(912) 555-4321", | |
"url": "https://johndoe.com", | |
"summary": "A summary of John Doe…", | |
"location": { |
This file contains 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
# ------------------------------------------------ | |
# Config files are located in /etc/wireguard/wg0 | |
# ------------------------------------------------ | |
# ---------- Server Config ---------- | |
[Interface] | |
Address = 10.10.0.1/24 # 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 |
This file contains 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 | |
cd /tmp/ | |
wget https://github.com/vim/vim/archive/v8.1.1244.tar.gz | |
tar xzf v8.1.1244.tar.gz | |
cd vim-8.1.1244/ | |
./configure --enable-perlinterp --enable-rubyinterp --enable-python3interp --enable-luainterp | |
make | |
make install |
This file contains 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
** | |
* | |
******* | |
* | |
***** | |
* | |
****** | |
---------- | |
*** |
This file contains 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
Django-REST-Framework | |
Serializers | |
* 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') |
This file contains 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 | |
# Steps to build and install tmux from source on Ubuntu. | |
# Takes < 25 seconds on EC2 env [even on a low-end config instance]. | |
VERSION=2.5 | |
sudo apt-get -y remove tmux | |
sudo apt-get -y install wget tar libevent-dev libncurses-dev | |
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz | |
tar xf tmux-${VERSION}.tar.gz | |
rm -f tmux-${VERSION}.tar.gz | |
cd tmux-${VERSION} |
"cocotte bag"
: exact match"* is thicker than water"
:*
to replace a phrase inside exact matchjaguar -car
: minus to filter out matchessite:time.com 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
: synonymsrelated:nationalgeographic.com
: similar sites
This file contains 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
* BitTorrent (or http) Download: 百度盘离线下载 | |
* Voip: GMail -> Hangout |
NewerOlder