Skip to content

Instantly share code, notes, and snippets.

@khalido
Last active June 11, 2020 05:49
Show Gist options
  • Save khalido/328c342127dfd54002bda4e04970effc to your computer and use it in GitHub Desktop.
Save khalido/328c342127dfd54002bda4e04970effc to your computer and use it in GitHub Desktop.
[working on a remote server] #cli

Get size of directories in a folder sorted by size:

du -h --max-depth=1 | sort -hr

List files with humun readable file sizes:

ls -lh

Most remote VM's are running a basic bash shell. Fix that by running

sudo apt update &&
sudo apt install htop neofetch -y &&
wget https://github.com/sharkdp/bat/releases/download/v0.15.1/bat-musl_0.15.1_amd64.deb &&
sudo dpkg -i bat-musl_0.15.1_amd64.deb &&
rm bat-musl_0.15.1_amd64.deb &&
sh -c "$(curl -fsSL https://raw.github.com/ohmybash/oh-my-bash/master/tools/install.sh)"

This updates repos - but doesn't upgrade as no need generally for a short lived VM and installs

  • htop: monitor machine use
  • neofetch: show machine overview
  • Bat: better cat with syntax highlighting
  • oh-my-bash - makes the terminal look good

If working with files:

sudo apt install fzf mc -y
  • mc: file manager
  • fzf: fuzzy search

git

Setup git by running the following inside a git repo (if needed).

git config --global user.name "khalido" &&
git config --global user.email "khalid.omar@gmail.com" &&
git config credential.helper 'cache --timeout=21600'

Note, there has gotta be a better way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment