in praise of Silver Searcher
Occasionally, I have to search lots of files for a pattern. It was only recently I discovered the wonderful silver searcher utility which saves me a lot of time.
To install ‘ag’ on Fedora, use the following (which isn’t entirely obvious or intuitive if you’re used to typing ‘ag’).
# sudo dnf install the_silver_searcher
I believe there is an Emacs interface which would save me even more time.
$ time ag 'sql statement execute time' ~
real 0m0.125s
user 0m0.128s
sys 0m0.257s
$ time find ~ -type f -print0 | xargs -0 grep -i 'sql statement execute time'
real 0m23.725s
user 0m7.965s
sys 0m1.618s
extending Bash history
I have used the Unix bash shell for many years. As I am incredibly lazy and forgetful, I have become accustomed to using ctrl-r ‘find’ to find and scroll though the latest ‘find’ commands I have issued.
Occasionally, I noticed that a lengthy, complex, useful ‘find’ command’ (which I mercilessly plagiarised from a clever person via Google) was no longer in my shell history.
Investigations revealed the default bash history is a paltry 1000 commands so I decided to increase this to 10000 by adding the following line to ‘~/.bash_profile’.
Read morehow mu4e changed my life
Getting email
No mail. In three whole days. Weird. I wonder if it’s Thanksgiving over in the States. Not even any football related banter. Is this thing even on ?
Then I realised precisely why I was sitting alone in an island of blissful isolation, devoid of all email communications and staring at an Inbox in a perpetual state of ‘Zero’.
I had forgotten to configure inbound email.
When I was testing, I used mbsync to synchronise emails from my ISP which worked well (fast, reliable, well documented) with bi-directional sync between IMAP and my local Maildir.
Read more