Skip to content

Instantly share code, notes, and snippets.

View lovubuntu's full-sized avatar
🎯
Focusing

Prabu K lovubuntu

🎯
Focusing
  • https://www.quintype.com
  • Chennai
View GitHub Profile
@lovubuntu
lovubuntu / psql_commands_history.md
Last active February 7, 2023 20:06
History for psql commands

There's no history in the database itself, if you're using psql you can use "\s" to see your command history there.

You can get future queries or other types of operations into the log files by setting log_statement in the postgresql.conf file. What you probably want instead is log_min_duration_statement, which if you set it to 0 will log all queries and their durations in the logs. That can be helpful once your apps goes live, if you set that to a higher value you'll only see the long running queries which can be helpful for optimization (you can run EXPLAIN ANALYZE on the queries you find there to figure out why they're slow).

Another handy thing to know in this area is that if you run psql and tell it "\timing", it will show how long every statement after that takes. So if you have a sql file that loo

There are lots of tcsh commands that help you navigate around when playing in the terminal.
Ctrl-a : back to begining of line
Ctrl-e: end of line
Ctrl-k: kills everything from the cursor to the end of line
Ctrl-b: moves cursor back (like the back arrow, but you don't have to move your hand as much)
Ctrl-f: moves the cursor forward
tab: completes the filename you are typing, very useful if you also set an environment
variable in your ~username/.tcshrc file like this "set autolist" alone on a line. Try the tab with
and without the environment variable. If you hate the beeping, put this environment variable
to get the first value of ` set<E> someSet;` its better to use `someSet.iterator.next()` than converting it to arraylist or array and then getting the first element
@lovubuntu
lovubuntu / Intellij Shortcuts
Created December 16, 2014 09:27
Intellij Shorcuts I learnt
To create a new file in Intellij:
1. press ⌘+1 to get to project view
2. Now move up or down to select the package
3. Press Control+N to create a new file
@lovubuntu
lovubuntu / links_gone_thro
Last active August 29, 2015 14:02
This is a gist of links that I found interesting and gone thro
Level 1 https://gist.github.com/anonymous/c9d83c2c1ecc7bfe501c
Level 9 https://gist.github.com/anonymous/3796e00c851b18011d39
Level 10 https://gist.github.com/anonymous/561aca26c35f8d060083
Level 11 https://gist.github.com/anonymous/23173aad302f28029e9f