Skip to content

Instantly share code, notes, and snippets.

View mordr's full-sized avatar

Ragib Morshed mordr

View GitHub Profile
@mordr
mordr / note.md
Last active August 16, 2018 22:42
How to enable autocompletion for git

Install git and bash-completion

brew install git bash-completion

On success, update ~/.bash_profile

echo '[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion' >> ~/.bash_profile
@mordr
mordr / note.md
Last active July 14, 2024 13:46
Set Visual Studio Code as default editor for kubectl

Set KUBE_EDITOR to Visual Studio Code, assumes 'code' is in PATH

export KUBE_EDITOR='code --wait'

Running k edit ... will open up the yaml using Visual Studio Code.

@mordr
mordr / note.md
Last active January 6, 2022 19:22
How to setup powerline-go shell prompt

Get powerline-go

See https://github.com/justjanne/powerline-go

Update bashrc/bash_profile

Add the following. Note, this is customized to my taste.

# Add powerline-go
function _update_ps1() {
    PS1="$($GOPATH/bin/powerline-go \
 -newline -cwd-max-depth 5 -mode compatible -colorize-hostname\
@mordr
mordr / note.md
Last active December 29, 2018 22:17
File encryption and decryption with gpg
  • Let's make sure we use the most recent version of gpg
$▶ gpg --version
gpg (GnuPG) 2.2.12
libgcrypt 1.8.4
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@mordr
mordr / note.md
Created December 29, 2018 22:16
Generate hash of directory
find . -type f -print0 | sort -z | xargs -0 shasum -a 256 | shasum -a 256 | awk '{print $1}'

For example, we have the following directory.

test/
├── a
└── b
@mordr
mordr / note.md
Created April 25, 2019 16:27
Dive into Deep Learning
@mordr
mordr / note.md
Created May 10, 2019 18:29
Simple compress/uncompress directory

Compress a directory

tar -zcvf ${name-of-compressed-directory}.tar.gz ${directory-to-compress}

Uncompress a directory

tar -zxvf ${name-of-compressed-directory}.tar.gz
@mordr
mordr / note.md
Last active May 11, 2019 18:33
Set HostName for mac
sudo scutil --set HostName ${hostname}
@mordr
mordr / note.md
Created September 11, 2024 17:36
How to setup remote pbcopy?

Assuming pbcopy is installed on Mac.

Follow this blog to setup and launch a pbcopy.plist

After setting up OSX, update ~/.ssh/config to setup remote port forward RemoteForward 2224 127.0.0.1:2224

On remote host, add an executable shell script in path with

@mordr
mordr / f.md
Last active September 11, 2024 17:38
Alternate to macFuse
  • Run python -m http.server in directory. Identify the <port>
  • From a browser, hit hostname:port