Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python2
import binascii
import hashlib
drv='/dev/sdb'
mode='rb+'
# pwd default is 'admin'
@nguyenl95
nguyenl95 / .bash_aliases
Last active June 7, 2018 09:13
personal snippets for ubuntu 16.04
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
@nguyenl95
nguyenl95 / reset.sh
Last active August 22, 2018 03:15
multiple ppp usb on linux
#!/bin/bash
reset_iptables() {
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
@nguyenl95
nguyenl95 / install-docker-compose.sh
Last active October 17, 2018 01:34 — forked from ohze/install-docker-compose.sh
Install docker-compose in boot2docker 1.7.0+
#!/bin.sh
# install bash
# todo how to make persistent bash?
tce-load -wi bash
# then to docker compose
DOCKER_COMPOSE_VERSION=1.22.0
# Download docker-compose to the permanent storage
@nguyenl95
nguyenl95 / vn.json
Last active October 16, 2018 10:05
iso 3166-2
{
"VN-44": "An Giang",
"VN-43": "Bà Rịa–Vũng Tàu",
"VN-54": "Bắc Giang",
"VN-53": "Bắc Kạn",
"VN-55": "Bạc Liêu",
"VN-56": "Bắc Ninh",
"VN-50": "Bến Tre",
"VN-31": "Bình Định",
"VN-57": "Bình Dương",
@nguyenl95
nguyenl95 / add_pritunl_server_route.sh
Created October 17, 2018 01:33
pritunl config on linux
VPN_SERVER_IP=
ROUTER_IP=
ROUTER_DEV=
sudo ip route add $VPN_SERVER_IP via $ROUTER_IP via $ROUTER_DEV
var a = [
"bG9n",
"WW91IG11c3Qga25vdyB0aGUgZmxhZyBieSBub3ch",
"Y2xvc2U=",
"YmlnbnVtYmVyLmpz",
"Y29uZmln",
"cmVhZGxpbmU=",
"Y3JlYXRlSW50ZXJmYWNl",
"c3RkaW4=",
"c3Rkb3V0",
@nguyenl95
nguyenl95 / rest-api-php.md
Created March 12, 2019 08:19
REST API Resources
set -x
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# if the box is Red hat based
# sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
@nguyenl95
nguyenl95 / change_sources_list.sh
Last active August 16, 2019 05:28
linux quick and dirty scripts
sudo sed -ie 's/\([a-zA-Z0-9]*\.archive\.\)\{0,1\}\(archive\.\)\{0,1\}\(security\.\)\{0,1\}ubuntu\.com/opensource\.xtdv\.net/g' /etc/apt/sources.list