Searching for #hashtags (or other special characters) in Evernote

Evernote won’t let you search for “#hashtag”, it ignores the “#” character.  This is apparently an integral part of its search grammar, it treats punctuation as spaces.  Or something.  Anyway: I had several notes with both “#documentation” and “documentation”.  I couldn’t find the former without also finding the latter.  (I didn’t realize this when I was tagging things with “#documentation” or I’d’ve done it differently.  I’ve also tagged many other items with internal hashtags.)

Chrome has no such limitation, thank $DEITY.

So I did the seach for “documentation”, selected all those notes, exported them as a single HTML file, opened the note in Chrome (something EN helpfully offers to do for you at the end of the export), and now I can find all my #documentation tags.

It’s not great, but it’s not terrible, either.

Hope this helps.

Update 4/9/14: Minor edits to the above, and this: After trying a couple of different things, using a QQ suffix seems to work.  I tried _documentation, which doesn’t suck, and EN will find it, but it doesn’t match a plain search for “documentation”, and I’d rather not duplicate all my inline tags (e.g. “… add this to the documentation _documentation”).

If you have “documentationQQ” then searching for “documentation” finds it, as well as searching for “documentationQQ”, which finds only the tags.  And “QQ” kinda sorta looks like eyeballs, and regardless is a clear tag (ha) that “this is something different …”.

Blocking Skype ads

If you’ve upgraded Skype lately (excuse me, allowed Skype to “improve your experience”), you may’ve been dismayed by ads in your chat windows.

This article describes how to disable them, basically by black-holing the domains the ads are served from.

It worked for me.

Mute speaker for 30 seconds during iTunes radio commercial

I’ve recently started listening to iTunes Radio.  It has ::shudder:: commercials.  Ick.  They’re typically 30 seconds, near as I can tell, and you can’t skip them.  I’ve started hitting “mute” as soon as they come on.

But I frequently forget to “unmute”.  Oops.

So I wrote an AutoHotkey script to mute the master speaker for 30 seconds, then automatically unmute it.

; Shift-Control-Alt-F9 -- Because "FN-F9" is the special "mute"
; button on my keyboard, so this is easy to remember
+^!F9::
  ; mute the master volume setting
  SoundSet, 1, Master, Mute
  ; display a msg box for 1 second that says you're muting for 30 seconds
  Msgbox,, Commercial, Sound is muted for 30 seconds, 1
  ; sleep for 29 more seconds
  Sleep, 29*1000
  ; unmute the master volume setting
  SoundSet, 0, Master, Mute
  ; and return
  return

Enjoy.

Update 2014/02/21: This script has come in handy many times already just today.  Life is good.  ðŸ™‚

Monitoring pipes in Linux

Have you ever said

gzip file > /path/to/an/nfs/drive/file.gz

and wondered how far it’d gotten?  I did that just today, more or less.  I poked around for something that’d tell me how far gzip had gotten, and found pv (http://www.ivarch.com/programs/pv.shtml).

From the pv manpage:

pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.

To use it, insert it in a pipeline between two processes, with the appropriate options.  Its standard input will be passed through to its standard output and progress will be shown on standard error.

pv will copy each supplied FILE in turn to standard output (- means standard input), or if no FILEs are specified just standard input is copied. This is the same behav‐ iour as cat(1).

A simple example to watch how quickly a file is transferred using nc(1):

pv file | nc -w 1 somewhere.com 3000

A similar example, transferring a file from another process and passing the expected size to pv:

cat file | pv -s 12345 | nc -w 1 somewhere.com 3000

A more complicated example using numeric output to feed into the dialog(1) program for a full-screen progress display:

(tar cf - . 
| pv -n -s $(du -sb . | awk '{print $1}')
| gzip -9 > out.tgz) 2>&1
| dialog --gauge 'Progress' 7 70

Frequent use of this third form is not recommended as it may cause the programmer to overheat.

I like that last line.  ðŸ™‚

And so now I have

#pv a_large_file | gzip > /mnt/backup/a_large_file.gz
4.41GB 0:08:56 [12.2MB/s] [==> ] 31% ETA 0:19:09

Woohoo!

running cygwin’s “ping” as administrator

I installed Cygwin’s “ping” package and couldn’t run it in a regular mintty due to permissions problems.  I got “ping: socket: Operation not permitted” errors.  But it worked fine if I ran it in a mintty that I’d started with “Run as administrator”.

I searched around a bit and couldn’t find the right answer to my question of “how to run /bin/ping as administrator in a regular terminal window”, and couldn’t get it to work on my own either, but I thought I’d post my work-around, to wit:
alias ping=/cygdrive/c/Windows/system32/PING