Skip to content

Instantly share code, notes, and snippets.

View pooyagolchian's full-sized avatar
:octocat:
Set, Reach, Repeat

Pooya Golchian pooyagolchian

:octocat:
Set, Reach, Repeat
View GitHub Profile
@pooyagolchian
pooyagolchian / tunnle-linux.sh
Created June 1, 2020 23:11
Linux Poor Man's VPN with proxychains
#!/bin/sh
# SET VARIABLE
NET_SERVICE="Wi-Fi"
PORT=1080
SERVER=admin@example.com
PID=`pgrep -f ${PORT}`
if pgrep -f ${PORT} >/dev/null
then
echo "Ssh process in running with pid" ${PID}
sudo kill -9 ${PID}
@pooyagolchian
pooyagolchian / keybase.md
Last active January 18, 2020 12:36
Keybase

Keybase proof

I hereby claim:

  • I am pooyagolchian on github.
  • I am pooyagolchian (https://keybase.io/pooyagolchian) on keybase.
  • I have a public key whose fingerprint is A0DE 634C A616 B6F5 506E 5032 D111 24BA 18E5 6286

To claim this, I am signing this object:

@pooyagolchian
pooyagolchian / tunnle.sh
Last active May 30, 2020 20:07
Ssh tunnle on macos and set socks5 proxy (Tunnle over SSH)
#!/bin/sh
NET_SERVICE="Wi-Fi"
PORT=1080
SERVER=admin@server1.example.com
PID=`pgrep -f ${PORT}`
if [ "$EUID" -ne 0 ]
then echo "Please run as root!"
exit
fi
if pgrep -f ${PORT} >/dev/null
@pooyagolchian
pooyagolchian / index.js
Last active November 6, 2019 17:58
Find in array of object by object (Module)
const findByObject = (arrayOfObject, sourceObject) => {
let arr = [];
const sourceKey = Object.keys(sourceObject);
return collection.filter((obj) => {
return sourceKey
.map((key) => {
return obj.hasOwnProperty(key) && obj[key] === sourceObject[key]
})
.reduce((a,b) => {
return (a && b)
@pooyagolchian
pooyagolchian / index.js
Last active November 6, 2019 17:33
Seek and Destroy Algorithm
const destroyer = (arr, ...removeValue) => {
return arr.filter(item => !removeValue.includes(item))
}
@pooyagolchian
pooyagolchian / ES6 renaming objects key
Created October 23, 2019 07:59
Renaming Objects key
renameKeys = (keysMap, obj) => {
return Object.keys(obj).reduce((acc, key) => {
const renamedObject = {
[keysMap[key] || key]: obj[key]
};
return {
...acc,
...renamedObject
};
}, {});
@pooyagolchian
pooyagolchian / postman-install.sh
Last active September 3, 2019 06:54
Install last version of Postman with desktop entry - Ubuntu
#!/bin/bash
INSTALL_DIR=/opt/postman
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root. Use sudo!"
exit 1
fi