![]() |
My Top 3 |
![]() |
I just want to mention a few random technical things that have come up recently and are worth sharing:
- If you find yourself commonly running ps ax | grep myapp | grep -v grep, you should try ps ax | grep [m]yapp. Putting square brackets around any single character makes a regular expression that still only matches the string “myapp”, but doesn’t match itself. In particular, this is nice if the command line of the program you’re searching for contains the string “grep”, but in general it’s shorter and more correct.
- In command mode in vim, Ctrl-Y and Ctrl-E scroll the view up and down, respectively, without changing the cursor position, which is often nice. In insert mode, they insert the character that’s immediately above or below the cursor - this turns out to be surprisingly useful when you’re typing in
#ifndef MY_LONG_HEADER_FILE_H
#definein new C/C++ header files - since #ifndef is the same number of characters as #define, you can just Ctrl-Y your way out of having to retype the define value. I often find it easier than copy-and-pasting the first line.
Does anyone else have any other similar little tips that make life a bit easier?



Leave a Reply