Skip to content

Instantly share code, notes, and snippets.

View matinrco's full-sized avatar
🤔

Matin matinrco

🤔
View GitHub Profile
@matinrco
matinrco / chromePasswordImport.md
Created December 3, 2019 19:24
Chrome password import argument , due to missing "PasswordImport" flag in recent versions
--enable-features=PasswordImport

Create tmux config file in your home directory:

touch ~/.tmux.conf
  • To enable mouse support:
    set -g mouse on

  • To enable 256color (to fix highlighting style in zsh-autosuggestions in my case):
    set -g default-terminal screen-256color

@matinrco
matinrco / batchSymlink.sh
Last active October 10, 2019 21:11
Find specific files recursively in a directory & symlink all of them with new given name
@matinrco
matinrco / GitPermissions.sh
Created June 14, 2019 14:59
Change file permissions when working with git repo’s
# check the existing permissions , the command will show you the current file permissions like 100644
git ls-files --stage
# update the file permission
git update-index --chmod=+x 'name-of-shell-script'
# check-in the files
git commit -m "Made a file executable"
@matinrco
matinrco / ip.sh
Last active September 8, 2019 13:49
ip - commands that I use most
# View all network interfaces
ip a
# View all interfaces traffic-volume
ip -s link show
# Find your gateway IP
ip route
ip route | grep default
@matinrco
matinrco / VMwareWorkstationDHCP.md
Created May 24, 2019 22:49
VMware Workstation DHCP ip address splitting paradigm

Address Use on a Host-Only Network

Range Address use Example
<net>.1 Host machine 192.168.0.1
<net>.2-<net>.127 Static addresses 192.168.0.2-192.168.0.127
<net>.128-<net>.253 DHCP-assigned 192.168.0.128-192.168.0.253
<net>.254 DHCP server 192.168.0.254
<net>.255 Broadcasting 192.168.0.255
@matinrco
matinrco / DockerWindowsBinaries.url
Created May 24, 2019 11:50
Docker windows binaries
https://go.microsoft.com/fwlink/?LinkID=825636&clcid=0x409
@matinrco
matinrco / async_await.js
Last active May 13, 2019 10:45
Sample javascript / nodejs / ecma6 async & await
const asyncAction = ( name )=>{
return new Promise(( resolve , reject )=>{
setTimeout(()=>{
resolve("kk , promise resolved "+ name +" !");
//reject("rejected")
},3000);
});
};
(async ()=>{
@matinrco
matinrco / updateAndCleanImages.sh
Created April 29, 2019 12:45
Update all docker images then remove all untagged images
#!/bin/zsh
####################################################
## Notice : use for development environment only. ##
####################################################
#Update all images
docker images --format "{{.Repository}}:{{.Tag}}" | grep -v "<none>" | xargs -L1 docker pull
@matinrco
matinrco / openconnect.sh
Created April 12, 2019 12:01
Establish VPN connection with Openconnect on linux
echo YourPass | sudo openconnect -u YourUsername --authgroup=DEFAULT -b --passwd-on-stdin --cafile=/path/to/ca.crt --servercert=YourServerCert --pfs Server:Port