Skip to content

Instantly share code, notes, and snippets.

Working from home

Faizar Septiawan icarrr

Working from home
View GitHub Profile
icarrr /
Created Jun 4, 2021
#Python Encode & Decode URL


Encode & Decode URL


$ alias urldecode='python -c "import sys, urllib as ul; \
    print ul.unquote_plus(sys.argv[1])"'
icarrr /
Created Mar 26, 2021
Forward port from private network to public port
# sudo iptables -t nat -I POSTROUTING -m comment --comment "NAT the src ip" -d -o ppp0 -j MASQUERADE
sudo iptables -t nat -I POSTROUTING -m comment --comment "NAT the src ip" -d -j MASQUERADE
sudo iptables -I FORWARD -d -m comment --comment "Accept to forward winbox mikrotik traffic" -m tcp -p tcp --dport 800 -j ACCEPT
sudo iptables -I FORWARD -m comment --comment "Accept to forward winbox mikrotik return traffic" -s -m tcp -p tcp --sport 800 -j ACCEPT
sudo iptables -t nat -I PREROUTING -m tcp -p tcp --dport 1001 -m comment --comment "redirect pkts to virtual machine" -j DNAT --to-destination
icarrr /
Created Nov 1, 2020
Install MongoDB 3.2
# Tested : Ubuntu 16.04
set -e
# Setup
mkdir mongo-pkg
cd mongo-pkg
sudo dpkg -i *

Open edX

Install Open edX Using Method Native Installation

Add some variables to your server

echo "export LC_ALL='en_US.UTF-8'" >> ~/.bashrc
echo "export LANG='en_US.UTF-8'" >> ~/.bashrc
echo "export LANGUAGE='en_US.UTF-8'" >> ~/.bashrc
icarrr /
Last active Sep 15, 2020
chatwoot installation script

Chatwoot installation script

icarrr /
Created Mar 5, 2020 — forked from willurd/
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
icarrr /
Created Feb 29, 2020
example conf nginx using ssl

Note: If you want to use main_y config, you need a directory of snippets.

$ tree snippets
├── self-signed.conf
├── ssl
│   ├── portal.crt
│   └── portal.key
icarrr /
Created Jan 22, 2020 — forked from elleryq/
Create Django super user in ansible
set timeout -1;
spawn {{django_dir}}/venv/bin/python changepassword {{admin_user}};
expect {
"Password:" { exp_send "{{admin_pass}}\r" ; exp_continue }
"Password (again):" { exp_send "{{admin_pass}}\r" ; exp_continue }
icarrr /
Created Jan 17, 2020 — forked from Zate/
Shell script to download and install latest golang
#! /bin/bash
# [](
# Download latest Golang release for AMD64
set -euf -o pipefail
# Install pre-reqs
sudo apt-get install python3 git -y
o=$(python3 -c $'import os\nprint(os.get_blocking(0))\nos.set_blocking(0, True)')

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.


git config --global core.excludesfile ~/.gitignore


git config --global core.excludesfile %USERPROFILE%\.gitignore