Wednesday, November 25, 2015

Handy howmany commandy

Here's a handy little bit of... well it isn't really SQL, is it? Shell scripting and SQL*Plus, more like.

tcsh & csh

alias howmany "echo 'select count(*) from table;' | sqlplus -s 'xxxxxx/xxxxxx@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxx)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xxxxxx)))'"

sh & bash

alias howmany="echo 'select count(*) from table;' | sqlplus -s 'xxxxxx/xxxxxx@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxx)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xxxxxx)))'"

(for ksh use either) - and then...

$ howmany


p.s. I'd love to add a pipe to

sed -e '/^$/ d; s/^\s-*//g'

but the dollar sign screws things up, at least in tcsh. Oh well!

Wednesday, November 18, 2015

Sunday, November 15, 2015

Hard-to-read Podcasts

If you use the iOS Podcasts app, you've probably had occasion to swear at the producers of a podcast for their graphics and how they translate into dark text on a dark background. It's even worse in low light.

Well swear no more! At least not about this. It turns out there's a setting for that! Unfortunately, because this is iOS, you have to open the Settings app. Go there and choose Podcasts. And there aren't that many settings, so find this one, Custom Colors, and turn it off

And enjoy more podcasts!

Saturday, November 14, 2015

Don't take checks from strangers

I don't tend to be alarmist, but this article has an important warning... when you deposit a check, everything you write on it can go back to whoever issued it - your account number, social security number... huge identity theft problem.

Wednesday, October 07, 2015

Emacs cleanup

Because I'm always needing this between tasks...
;; kill buffers visiting /scratch or /tmp files
(defun cleanup ()
  (let* (
    (setq list (buffer-list))
    (setq n 0)
      (dolist (elt list)
        (setq file (buffer-file-name (get-buffer elt)))
        (if (and
              (string-match "^/scratch/" file)
              (string-match "^/tmp/" file)
              (if (kill-buffer elt)
                  (setq n (+ n 1))
      (message "Delete %d buffer%s." n (if (= n 1) "" "s"))

Wednesday, August 26, 2015

I Repeat...

I'm always forgetting how to repeat a command. Here's how in tcsh:

$ repeat 9999 sh -c 'now=`date +%s` ; date > /tmp/tmp ; then=`date +%s` ; diff=`expr ${then} - ${now}` ; echo xxxxx ${diff} xxxxx ; if [ ${diff} -gt 0 ] ; then date ; fi ; sleep 15'

(The inner command is /bin/sh, of course)

Saturday, January 03, 2015

Hot and Sour Matzo Ball Soup


  • Swanson Chinese hot and sour broth 
  • more broth (h&s or vegetable, optional)
  • a can or two of mushrooms
  • a scallion or two, chopped like you do
  • matzo balls, prepared as directed on the back of a can of Manischewitz matzo meal
Note: you can use one or two boxes/cans of broth, depending on your desired broth/ball ratio. The amount of scallions & mushrooms would then tend to follow the broth.


  1. Mix up the matzo ball ingredients and put them in the refrigerator.
  2. Cut up the scallion(s) and put them, along with the mushrooms, into the broth.
  3. Bring the broth and vegetables to a boil.
  4. Add the matzo balls to the boily broth.
  5. Lower the heat and simmer per the Manischewitz directions, about 30 minutes or so.