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
# need to setup dns of your domain first | |
# cert will be stored in /etc/letencrypt | |
# renew command without --force-renew will not get new certificate if old certificate has long live til expired | |
./letsencrypt-auto certonly --webroot -w /usr/share/nginx/www -d domain.com --email phankhanh@gmail.com --agree-tos |
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
openssl req -newkey rsa:2048 -sha256 -nodes -keyout khapota.key -x509 -days 365 -out khapota.pem -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=khapota.info" |
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
import requests | |
files = {"upload_file": open('path/to/file.txt', 'rb')} | |
data = {"content": "test upload"} | |
requests.post(url, files=files, data=data) |
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
function updatePrice($itemId, $price, $title) { | |
$header = array('Host' => 'eu1.linnworks.net', | |
'Connection' => 'keep-alive', | |
'Accept' => 'application/json, text/javascript, */*; q=0.01', | |
'Origin' => 'https://www.linnworks.net', | |
'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36', | |
'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8', | |
'Referer' => 'https://www.linnworks.net/', | |
'Authorization' => '6f004779-0784-45bd-86b5-7bec6bc475', | |
'Accept-Encoding' => 'gzip, deflate'); |
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
scrub-anchor "com.apple/*" | |
nat-anchor "com.apple/*" | |
rdr-anchor "com.apple/*" | |
rdr-anchor "forwarding" | |
dummynet-anchor "com.apple/*" | |
anchor "com.apple/*" | |
load anchor "com.apple" from "/etc/pf.anchors/com.apple" | |
load anchor "forwarding" from "/etc/pf.anchors/mitm" |
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
rdr pass on en0 inet proto tcp to any port 80 -> 127.0.0.1 port 8080 | |
rdr pass on en0 inet proto tcp to any port 443 -> 127.0.0.1 port 8080 |
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
set-option -g prefix C-a | |
unbind-key C-b | |
bind-key C-a send-prefix | |
# status bar | |
set-option -g status-utf8 on | |
set -g set-titles on | |
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf | |
set-option -g status-bg colour235 #base02 |
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 | |
git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it | |
~/.bash_it/install.sh |
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 | |
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim |
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
db.currentOp().inprog.forEach( | |
function(op) { | |
if(op.secs_running > 5 && op.op == 'query') printjson(op); | |
} | |
) |