Tips and Tricks
A collection of random tid-bits I come across during my everyday life which I cannot keep organized anywhere else.
Vim tab completion is slow
This happens if the autocompletion has to search through a large file you once opened but have since closed (SuperTab
does that, for example).
Close such buffer
by first viewing their number via :ls
and then :bwipeout <number-of-buffer>
.
Convert epoch
to TIMESTAMP for PostgreSQL
hash
index on PostgresSQL take too long to create
I think if there are a lot of repeated values in a column, the hash
index takes too long to create because of collisions. It is better to use the default btree
indexes in those cases.
Different prompt when on a remote machine
I often have to recall instead of recognize whether I am on a remote machine or a local machine because I have the same .bashrc
on both machines.
This snippet in my .bashrc
includes (in bright red color) a string in my bash prompt warning me if I am on a remote machine:
Naming screens
Give names to screen sessions by pressing Ctrl-a
followed by :sessionname <name>
. Then the screen can be reattached thusly: screen -r <name>
.