Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pak11273
Last active January 28, 2019 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pak11273/9d4d9ba195381131994e09b1f3733262 to your computer and use it in GitHub Desktop.
Save pak11273/9d4d9ba195381131994e09b1f3733262 to your computer and use it in GitHub Desktop.
UBER COMMANDS
// VIM
// When copy/pasting react code, turn off vim autoclose tags
:CloseTagDisableBuffer
:CloseTagEnableBuffer
// vim batch command
:cdo s/pattern/newpattern/g | update
// repeat a macro with visual mode
// @a is just an example, use any macro
:'<,'>g/^/ norm @a
// sort lines alphabetically
:1,$!sort
// delete duplicate lines, MUST BE SORTED FIRST - SEE ABOVE
:1,$!uniq
// LINUX
// create a password or secret codes with openssl
openssl rand 60 | openssl base64 -A
// secret key generator
echo -n "somevalue" | openssl sha512 -hmac "somekey"
// clear systen cache (DO NOT USE IN PRODUCTION!!)
sync; echo 1 > /proc/sys/vm/drop_caches // Clears PageCache only
sync; echo 2 > /proc/sys/vm/drop_caches // Clears dentries and inodes
sync; echo 3 > /proc/sys/vm/drop_caches // Clears PageCache, dentries and inodes
sudo apt-get clean // Clears the apt cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment