Skip to content

Instantly share code, notes, and snippets.

View arastu's full-sized avatar
🦀

Touhid Arastu arastu

🦀
View GitHub Profile
brew install go-delve/delve/delve
@arastu
arastu / lunch.json
Last active February 14, 2017 13:35
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "exec",
"remotePath": "",
"port": 2345,
@arastu
arastu / macos-http-proxy-func.sh
Last active May 7, 2017 16:43
Shell function to set, on or off http and https proxy
# add this function to .zshrc or .bashrc
# Example:
# Set http and https proxy:
# $ macsetproxy 127.0.0.1 8118
#
# Turn http and https proxy off
# $ macoffproxy
#
# Turn http and https proxy on
# $ maconproxy
@arastu
arastu / sorting_integers_with_two_stacks.js
Last active October 13, 2017 00:45
Sorting Integers with two stacks in javascript
function Stack() {
this.data = []
}
Stack.prototype.pop = function () {
return this.data.pop()
}
Stack.prototype.push = function (item) {
this.data.push(item)
}
@arastu
arastu / style.css
Last active October 21, 2017 19:08
.titr, .tpost a {
font-family: 'behdad', sans-serif !important;
}
html body .top {
background: url(http://up2www.com/uploads/1b82top-1-.jpg) no-repeat top;
}
# using:
# for set proxy:
# $ setproxy 127.0.0.1 8118
# for unset:
# $ unsetproxy
function setproxy() {
export {http,https,ftp,HTTP,HTTPS}_proxy=http://$1:$2
export no_proxy="localhost,127.0.0.1,master.cafecluster"
echo "Proxy variable(http,https,ftp) set to $1:$2"
https://jsonplaceholder.typicode.com/photos?_page=1&_limit=20
https://reqres.in/api/login
https://www.sitepoint.com/react-router-v4-complete-guide/
# client ----> 1.1.1.1 --------> 2.2.2.2
# (relay) (dest)
sudo iptables -A FORWARD -d 2.2.2.2 -i ens160 -p udp -m udp --dport 500:500 -j ACCEP
sudo iptables -A FORWARD -d 2.2.2.2 -i ens160 -p udp -m udp --dport 4500:4500 -j ACCEPT
sudo iptables -t nat -A PREROUTING -d 1.1.1.1 -p udp -m udp --dport 500:500 -j DNAT --to-destination 2.2.2.2
sudo iptables -t nat -A PREROUTING -d 1.1.1.1 -p udp -m udp --dport 4500:4500 -j DNAT --to-destination 2.2.2.2
sudo iptables -t nat -A POSTROUTING -o ens160 -j MASQUERADE
@arastu
arastu / anisble-playbook.sh
Last active August 18, 2018 12:04
Fix MacOS(OSX) crash complaining of operation `in progress in another thread when fork() was called` when calling ansible-playbook
alias ansible-playbook="OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES; ansible-playbook"