Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

maulvi

🏠
Working from home
View GitHub Profile
@maulvi
maulvi / redocker.sh
Created Nov 25, 2020 — forked from codeck/redocker.sh
redsocks for docker container
View redocker.sh
cat <<EOF
TYPE The following commands:
sysctl -w net.ipv4.conf.docker0.route_localnet=1
iptables -t nat -N REDSOCKS
iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
iptables -t nat -A REDSOCKS -d 192.168.0.0/16 -j RETURN
@maulvi
maulvi / via-ssh.sh
Last active Nov 25, 2020 — forked from vitex/via-ssh.sh
A script that uses redsocks to build a system-wide OpenSSH SOCKS proxy.
View via-ssh.sh
#!/bin/sh
########################################################################
#
# Usage: via-ssh.sh [-v] [-d] [USER@]SERVER[:PORT]
#
# -v Provide verbose output.
# -d Send all UDP on the DNS port 53 to 127.0.0.1.
# USER User name to use for SSH; default is current user.
# SERVER Server to use for SSH.
@maulvi
maulvi / ngrok.txt
Created Nov 21, 2020
ngrok in background
View ngrok.txt
./ngrok tcp -region ap 5900 -log=stdout > ngrok.log &
@maulvi
maulvi / softether.sh
Last active Nov 13, 2019
Softether entware startup, place this file at /usr/local/etc/rc.d
View softether.sh
#!/bin/sh
case $1 in
start)
/opt/etc/init.d/S05vpnserver start
;;
stop)
;;
esac
@maulvi
maulvi / SetupSSHForwardingOnQNAP.md
Created Nov 5, 2019 — forked from smuda/SetupSSHForwardingOnQNAP.md
Setup SSH forwarding on QNAP NAS
View SetupSSHForwardingOnQNAP.md

On receiving NAS:

setcfg LOGIN "SSH AllowTcpForwarding" TRUE
reboot

On client to forward local port 8443 to the QNAP admin interface:

ssh user@host -L 8443:localhost:443
View sources.list
deb http://mirror.0x.sg/ubuntu/ xenial main restricted universe
deb-src http://mirror.0x.sg/ubuntu/ xenial main universe
###### Ubuntu Update Repos
deb http://mirror.0x.sg/ubuntu/ xenial-security main restricted universe
deb http://mirror.0x.sg/ubuntu/ xenial-updates main restricted universe
@maulvi
maulvi / nama.txt
Last active Nov 11, 2020
Nama2 orang indonesia
View nama.txt
aan
abdul
abdullah
abidin
abie
achmad
adam
ade
adhi
adhitya
@maulvi
maulvi / kota.txt
Created May 25, 2019
nama kota Indonesia
View kota.txt
teupahselatan
simeuluetimur
teupahbarat
teupahtengah
simeuluetengah
telukdalam
simeuluecut
salang
simeuluebarat
alafan
View gist:f39a47b712a8c991724a76cceaecb69b
Memuat data ke dalam Apache pig dari sistem file (HDFS / Lokal) menggunakan operator LOAD.
a = LOAD 'test_set_tweets.txt' AS (id:chararray, ts:chararray, tweet:chararray);
Fungsi FLATTEN(TOKENIZE ini digunakan untuk split string dan LOWER mengubah semua karakter dalam string menjadi huruf kecil.
b = foreach a generate tweet, FLATTEN(TOKENIZE(LOWER(tweet))) as tokens;
Fungsi yang digunakan memfilter string yang diawali dengan hashtag
c = filter b by tokens MATCHES '#\\s*(\\w+)';
Operator GROUP digunakan untuk mengelompokkan data dalam satu atau beberapa string.
@maulvi
maulvi / gist:070bb48ab462499db126d9ad96876559
Created Jul 6, 2018
fix brightness waking up from sleep/suspend
View gist:070bb48ab462499db126d9ad96876559
For waking up from suspension, I create the following script /etc/pm/sleep.d/brightness:
```shell
#!/bin/sh
case "$1" in
resume|thaw)
echo 170 > /sys/class/backlight/intel_backlight/brightness
;;
esac
```