Skip to content

Instantly share code, notes, and snippets.

View Kartones's full-sized avatar
💻
+ 📖 + 🕹️

Diego Kartones

💻
+ 📖 + 🕹️
View GitHub Profile
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 3, 2024 20:51
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)
@Kartones
Kartones / Win 10 Disable Forced Reboot After Update.bat
Created August 26, 2023 19:30
Win 10 Disable Forced Reboot After Update.bat
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
@Kartones
Kartones / Win 10 Disable Automatic Windows Updates.bat
Created August 26, 2023 19:29
Win 10 Disable Automatic Windows Updates.bat
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
@Kartones
Kartones / Win 10 Disable Automatic App Updates.bat
Created August 26, 2023 19:28
Win 10 Disable Automatic App Updates.bat
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
@Kartones
Kartones / mac-shortcuts.md
Last active December 20, 2023 18:37
Mac Shorcuts (last used 2020)
@Kartones
Kartones / image-and-video.md
Last active November 22, 2023 20:46
image & video (Imagemagick, ffmpeg, webp...) commands
@Kartones
Kartones / statsd-local-server.md
Created August 19, 2015 09:55
StatsD local server for testing
@Kartones
Kartones / sublime-text-cheatsheet.md
Last active January 18, 2021 17:43
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