Skip to content

Instantly share code, notes, and snippets.

Kartones Kartones

Block or report user

Report or block Kartones

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Kartones /
Last active Jun 3, 2020
PostgreSQL command line cheatsheet


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)
Kartones /
Last active May 25, 2020
Imagemagick & ffmpeg commands


  • Nornalize all images of a folder converting them to jpgs with 90% quality (warning, removes original files):
rename 's/\.JPG$/\.jpg/' *.JPG
rename 's/\.JPEG$/\.jpg/' *.JPEG
rename 's/\.jpeg$/\.jpg/' *.jpeg
mogrify -format jpg *.png
mogrify -resize 1600x1280\> -quality 90 *.jpg
rm *.png
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "http://hostname/resource"
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "http://hostname/resource"


  • git checkout -b __newbranch__ : get a new branch and switch to it
  • git checkout -b __branchname__ / __branchname__ : get a local copy of a remote existing branch
  • git checkout __branchname__ : switch branch
  • git checkout --orphan __branchname__ : create branch without full history
  • git log -n X -p : show X last commits with diffs
  • git log __branchA__ ^__branchB__ : commits in branch A that aren't in branch B
  • git log --pretty=oneline --stat --all __foldername__ : modified files under a given folder
  • git fetch
  • Update version: sudo pip install --upgrade youtube-dl
  • Download only MP3 audio of a video: youtube-dl <VIDEO-URL> --extract-audio --audio-format mp3
  • For the above, ensure you have: sudo apt-get install ffmpeg
Kartones /
Last active Mar 28, 2020
Sublime Text 3 Cheatsheet

Keyboard shorcuts

  • CTRL + SHIFT + p: Command panel
  • CTRL + p: File search
  • CTRL + r: Method search inside current file
  • CTRL + g: Go to line #
  • CTRL + SHIFT + [: Fold code
  • CTRL + SHIFT + ]: Unfold code
  • ALT + SHIFT + 2: Double column/file mode
  • ALT + SHIFT + 1: Single column/file mode
Kartones /
Created Aug 19, 2015
StatsD local server for testing
Kartones / no-css
Created Dec 22, 2016
Bookmark to remove all CSS, JS and iframesfrom a page. Just paste as new bookmark
View no-css

Keybase proof

I hereby claim:

  • I am Kartones on github.
  • I am kartones ( on keybase.
  • I have a public key whose fingerprint is 183E 1F5A 1324 8786 6422 4300 3601 C4A0 ED24 F41D

To claim this, I am signing this object:

You can’t perform that action at this time.