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 May 11, 2019 18:33
Set HostName for mac
sudo scutil --set HostName ${hostname}
@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
Created April 25, 2019 16:27
Dive into Deep Learning
@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
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
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 May 17, 2024 02:44
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 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