Skip to content

Instantly share code, notes, and snippets.

View thaiph99's full-sized avatar

Pham Hong Thai thaiph99

View GitHub Profile
@thaiph99
thaiph99 / postgres-cheatsheet.md
Created August 19, 2024 06:26 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@thaiph99
thaiph99 / NvChad.md
Created July 12, 2024 01:39 — forked from kashifulhaque/NvChad.md
Neovim stuff with NvChad

Neovim keybinds

  • Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
  • _ (underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)
    • 0 (zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
  • $ (dollar) to move the cursor at the end of line (doesn't switch to insert mode)
  • d$ will delete from wherever your cursor is till the end of the line
  • f<character> to move cursor to the first occurrence of <character>
    • f( to move cursor to first occurence of (
  • t<character> to move cursor to upto but not on the first occurrence of <character>
  • t( to move cursor to first occurence of (

Linux command note

# reset ssh ECDSA key
ssh-keygen -R hostname
# show disk capacity
lsblk -o NAME,FSTYPE,UUID,SIZE,FSAVAIL,FSUSE%,MOUNTPOINT

Directory structure

|__.gitconfig
|__.gitwork/
    |_.gitconfig
    |_.git-credentials
|__.getpers/
    |_.gitconfig
    |_.git-credentials
# Install curl ssh, tmux, vim, htop, git, build-essential, gcc ----------------------------
sudo apt install curl build-essential tmux vim openssh-client htop git net-tools xclip ripgrep vim-gtk3
# mapping cap to esc
gsettings set org.gnome.desktop.input-sources xkb-options "['caps:escape']"
# Install cloudflare-warp ----------------------------
## Add cloudflare gpg key
curl https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg
## Add this repo to your apt repositories
# vim:ft=zsh ts=2 sw=2 sts=2
#
# Original agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
# Pixegami: Modified some elements to suit my Python/Git heavy use.
CURRENT_BG='NONE'
# Special Powerline characters