Friday, March 08, 2019

How to Cook Salmon

I'm going to forget if I don't write this down.

- 1 lb salmon
- couple TBS oil
- Fish seasoning (salt, etc)

425 deg, 25 min

WIP: I'll write down more about this when I get a chance

Wednesday, February 06, 2019

My Very Own Burrito Recipe

I believe it was Benjamin Franklin who first said, "eat a burrito a day."

His recipe has been lost to the fog of time, but here's one I think he would like:

Makes two good-sized burritos

Ingredients

  • 1/4 lb., your choice of meat, cooked (alternatively 1/2 cup of cooked beans)
  • 1/2 cup, cooked rice
  • 1/2 cup, grated cheese - I used cheddar
  • 1/4 cup, salsa
  • two 10-inch flour (or gluten-free) tortillas

Steps

  • Mix it all up (everything but the tortillas, of course) in a microwave-safe dish (or fire-safe, if you're into that kind of thing).
  • Heat (microwave, fire, etc) the mixture until the cheese is melted
  • Give it all a good stir
  • Divide the melty mixture between the two tortillas, flattening and shaping it so as to create proper burrito-shaped innards
  • Fold the two sides toward the middle, then the near end over the center; finally flop the middle part onto the other end of the tortilla - please don't make me draw a diagram
Garnish the tortilla with a little more cheese, which then melt


Serve with a little more salsa, some Spanish rice, maybe some refried beans.

And enjoy!

Monday, December 31, 2018

Onion Dip Experiment #2

It's time to try the onion dip recipe again.

Here are my notes from last time.

Here's what I'm doing this time...

Ingredients
  • 2-3 small-medium onions (2 cups finely chopped)
  • 2 TBS unsalted butter
  • 3/4 tsp Kosher salt
  • 1/8 tsp pepper
  • 2 cups, plain yogurt
  • 2 TBS chives
Directions
Chop the onions finely. Try not to cry. They're just onions.

Melt the butter. Add the onions and 1/2 tsp salt. Cook until golden brown. You'll know they're golden brown when a spouse or other responsible adult tells you you're golden brown. It should take about 30-35 minutes.

Put the cooked onions in a tightly covered dish and refrigerate until cool. While you wait, you can tweet or write a blog post about the experience.

Once the onions are cool, mix them in a medium bowl with the yogurt, 1/4 tsp salt, the pepper, and the chives.

I know I said I was going to try adding cayenne pepper. We'll see about that, and I'll let you know. Nah, I think it's perfect as-is.

So as promised, the sodium content. The TOTAL sodium in the whole recipe is just about 1000 mg:
  • onions: 8 mg
  • unsalted butter: 0 mg
  • 3/4 tsp kosher salt: 840 mg
  • pepper: <1 mg
  • yogurt: 150 mg
  • chives: 0 mg
So one eighth of the recipe (about 1/4 cup) would have about 120 mg of sodium.

Let's compare this with Lipton's onion soup mix. The mix itself has 610 mg. The sour cream adds another 40-something.

This recipe reduces the sodium by more than 80%. That's quite a savings!!

Can we get that number up to 96%? Stay tuned, I'll try that in a couple weeks!

Tuesday, December 25, 2018

Sausage Bread

Originally from an old friend of the family.

Sausage Bread

  • 1 box of hot roll mix
  • 1/4 cup Parmesan cheese
  • 1/2 cup grated Swiss cheese
  • 2 eggs beaten
  • 1/4 tsp Tabasco
  • 1/2 tsp salt
  • 2 tbsp parsley
  • 1 onion chopped
  • 1 lb sausage, hot or sweet

Mix dough according to directions on box. Let rise 45 min. Roll out 1/4" thick oval. Cook onions wish sausage (not brown). Drain excess fat. Add all other ingredients. Stir until cheese has melted. Let cool. Don't spread to edges. Roll up and pinch ends together. Shape into crescent. Place on greased cookie sheet (with edges). Bake 20 min at 400 degrees until brown and toothpick comes out fairly clean.

I'm going to try and make this with gluten free bread dough sometime soon. I'll report back.

Sunday, December 23, 2018

Italian Wedding Soup

I found this great recipe for Italian Wedding Soup.

I used a one-pound box of baby spinach for the greens.

Instead of the three kinds of meat, I just used a pound of ground turkey.

Gillian's (unseasoned) gluten free bread crumbs worked very nicely.

I made the meatballs smaller - about 3/4 inch - which I find much nicer for soup.

And when you put them into the broth, it's a good idea to count them, so you know just how many you have if you're divvying them up for a large crowd. This batch served thirteen people as a soup course with a couple cups left over.

The spinach and puffed-up meatballs insisted on floating to the top, so swirling in the egg and cheese mixture was a bit difficult. I actually removed a bunch of it to perform this step!

Also worth noting: The meatball parsley should be chopped finely. And the recipe calls for a teaspoon of minced garlic - two cloves in the garlic press was just the right amount.

Garnish means "don't eat me" in Italian. Next time I'd use whole leaves of parsley and more coarsely grated cheese. (yes, eat the cheese)

Here's a pantry/fridge/freezer/shopping list for your convenience:

3 quarts homemade chicken stock (I might have used four? sorry, not sure)
1 lb. ground turkey
1 cup unseasoned (gluten free for my needs) bread crumbs
1/8 lb. Parmigiano-Reggiano (sorry, not sure how much I actually used)
3 large eggs
a medium onion
a bunch of fresh parsley
two cloves of garlic
kosher salt
black pepper grinder

Tuesday, December 11, 2018

Onion Dip Experiment #1

I love onion dip. Who doesn't? People on low-sodium diets, that's who. And besides, who wants all the crap that's in those processed soup packages? Not me, thanks!

So I went looking for an onion soup recipe to play with, and I found this one. My plan was to make it the first time exactly as written, but since I had some sour cream left over from Hanukkah, I combined that with some plain yogurt (Siggi's). And instead of unsalted butter and salt, I used the Land O' Lakes spread we had in the fridge. The rest of the salt I figured I would leave out.

The mixture is way too thick for my taste, so I think instead of the cream cheese, I'll stick with all yogurt next time - Greek or Icelandic.

My dip seemed a little bland, so I added some garlic powder. I guess I wish I'd read the original recipe's comments section, because somebody suggested adding a little cayenne pepper. That seems like a better idea.

Another commenter suggested getting a better texture by putting the cooked onions through a food processor.  That seems like a lot of work, so I think next time I'll chop the onions instead of just slicing them before cooking them.

Now as for the salt, the recipe calls for cooking with a half teaspoon of salt, which I left out, though I did use a buttery spread containing about 25 mg of sodium per serving of dip. The additional quarter teaspoon of salt the recipe calls for only adds another 30 mg of sodium per serving, so I think next time, I'll leave it in. The overall sodium savings compared with processed soup mix has to be at least 500 mg. Once I have the recipe perfected the way I like it, I'll do that math.

One more thing, I put a small container in the freezer. I'll thaw it out next week and see if it's any good. Update: I froze a 5 oz yogurt container of the original unsalted recipe. It was in there for about a week and then I put it in the refrigerator for about a day to thaw. The texture was just as it was, still too thick for my taste. And taste, just the same. I would have added some cayenne, but dang it, there wasn't any in the cupboard. That will have to wait for experiment #2.

UPDATE: read all about Onion Dip Experiment #2!

Monday, November 26, 2018

Soup: Split Pea with Turkey

Thanksgiving took place under my roof, so naturally I took custody of the turkey carcass - with an eye toward soup, of course! On the other hand, I've had a hankering for split pea soup, but preferring to avoid all the sodium that ham is full of.

Enter this recipe. I used turkey broth instead of chicken. And instead of ham, I used the turkey that boiled off the bones during the broth-making. And I left out the salt (and forgot about the pepper).

It's really good!

There's still plenty of broth left over, some of which will turn into Sherry Noodle Soup. But I also plan to make a batch (or half batch) of split pea with a cup of water swapped out for sherry. UPDATE: I swapped 1/2 cup water for sherry, which really helps when you cook without salt. It was a great addition!

Saturday, November 17, 2018

Apache Reverse Proxy for Microservice Subdomain

You've got Apache 2 running. What more does a plain-old simple HTML site need, after all?

Now you want to add a microservice, but you don't want to add more hosting. Can you add it to this existing host? Yes you can!

Here's how to add a subdomain - tictactoe.example.com - that will send requests to your microservice that's listening on port 8888.

Put the following in /etc/apache2/sites-available/tictactoe.com.conf

<VirtualHost *:80>
    ServerName tictactoe.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    ProxyPass "/"  "http://example.com:8888/"
    ProxyPassReverse "/"  "http://example.com:8888/"

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


Then add your site:

sudo a2ensite tictactoe.com

The best part is your Go code (or Rust, Ruby, Python, whatever) can just handle HTTP. You can use Let's Encrypt/certbot to add the HTTPS virtual host that will proxy secure traffic to your microservice as well.

UPDATE: Nothing like getting an invalid command error trying to do this on an Apache without proxy enabled. So...

sudo a2enmod proxy_http

Sunday, November 11, 2018

All kinds of Ubuntu troubles (fixed)

All three kinds of Ubuntu troubles (all of them fixed)

1. Can't get Ubuntu to start up without using recovery mode? Try making this change in /etc/defaults/grub

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset" 

But then don't forget to

$ sudo update-grub

I've lost track of all the sites I looked at that steered me in the right direction, but I was still having trouble because I'd forgotten the update-grub step!



2a. Trouble getting VNC to install and start up? Look no further than Ubuntu's own Screen Sharing feature!

2b. Once I got that working, I discovered that I could not connect using:
  • the RealVNC viewer (error: "Unable to connect to VNC Server using your chosen security setting. Either upgrade VNC Server to a more recent version from RealVNC, or select a weaker level of encryption.")
  • MacOS Screen Sharing (error: "The software on the remote computer appears to be incompatible with this version of Screen Sharing.")
Fortunately I found a video explaining the solution. Install and launch dconf Editor. Then navigate to org > gnome > desktop > remote-access and turn off the require-encryption option. Once I did this, I was able to use all of my VNC clients!

Thursday, November 01, 2018

Git won't Pull

Problem: cannot connect to remote

$ git pull
nc: getaddrinfo: nodename nor servname provided, or not known
ssh_exchange_identification: Connection closed by remote host

fatal: Could not read from remote repository.

$ git remote -v
origin git@github.com:blah/blah (fetch)

origin git@github.com:blah/blah (push)

$ cat .git/config
...
sshCommand = ssh -o 'ProxyCommand=nc -X connect -x blah:80 %h %p'
...

Aha!

Possible solution: remove sshCommand line from .git/config unless you are ALWAYS connecting through the proxy server.

Friday, October 26, 2018

Sherry Noodle Soup (v2!)

Back in the day, you could find my recipe for Sherry Noodle Soup on dave-net.com. Well that old domain is long gone. And sadly, I don't think you can even find it on The Wayback Machine!

But I found it on a hard drive and decided to cook up a batch. But nah, that recipe needed a little tweak here and there. So without further ado, here's version two...

Sherry Noodle Soup

Ingredients:
  • A couple chicken bodies or one turkey frame, with a little meat left on (you'll want about two cups of meat off the bones later)
  • 3 quarts, water
  • 1 medium-large onion (half quartered, half chopped)
  • 2 tsp, salt (if you really must)
  • 1 cup, dry sherry
  • 1½ tsp, oregano
  • 1 tsp, thyme
  • 1/8 tsp, ground black pepper
  • 2 cups, chopped carrots
  • 2 cups, chopped celery
  • 2 cups, raw mushrooms (optional)
  • 1 lb, cooked pasta (or dry + ??? cups, water TBD)

Combine meaty bones, water, half of the onion (quartered) in a large pot. Bring to boil and then simmer for an hour or so.

Remove everything from the broth. Salvage whatever meat you can from the bones. Discard the bones and the soggy onion and the other yucky stuff. Set aside two cups of meat for later. The rest will make a nice sandwich! you can give to your dog! ONLY GIVE MEAT TO YOUR DOG IF YOU LEAVE OUT THE ONION.

Strain the broth. If you like, you can let it cool and skim the fat off the top.

Combine the broth with the meat and the rest of the raw onion (chopped) and everything else except for the pasta, which you should save for later. Bring it all to a boil and then simmer for 30 minutes.

Add the pasta (cooked or dry plus ??? cups of water) and simmer for another ten minutes or so.

Enjoy!!

Update (12/11/18): I made this with mushrooms for the first time the other day, and I really liked how it turned out!

Saturday, June 16, 2018

Fix your iTunes names (and numbers!)

I made a thing!

https://github.com/dldnh/fix-itunes-names

When Amazon announced they were retiring their Music Storage Subscriptions, I decided to download all of my music.
This was troublesome in a number of ways. The metadata was pretty well screwed up, so there would be songs without an artist name or album name. So I ended up downloading just one album at a time, so I would know which album was which. Yeah, total PITA.
But once that was done, I found I had a number of songs with names like 'dd-tt- Title of the Song' where dd is the disc number and tt is the track number. And thankfully so, since some of these tracks didn't have the disc or track number in the metadata.
So what I've done is made this little AppleScript (called Fix_iTunes_names.scpt) that will go through all of the songs and rename them from 'dd-tt- Title of the Song' to just 'Title of the Song' - but ONLY IF dd matches the disc number and tt matches the track number. So totally safe!
And then I added another Applescript (called Fix_itunes_names_and_numbers.scpt) for more adventurous folks that will also rename songs from 'dd-tt- Title of the Song' to just 'Title of the Song' and ALSO set the disc number and tarck number to dd and tt - but ONLY IF either number was blank to start with.
You don't have to buy me a beer or anything, but if you want to, feel free - and thanks! http://paypal.me/dldnh

Sunday, February 11, 2018

Use curl to test nginx rewrite rules

Be very careful using nginx rewrite. Consider this answer on SO:

The answer author wrote this correct rewrite rule:
location  /foo {
  rewrite /foo/(.*) /$1  break;
  proxy_pass         http://localhost:3200;
  proxy_redirect     off;
  proxy_set_header   Host $host;
}
Which was later edited erroneously:
location  /foo {
  rewrite /foo(.*) /$1  break;
  proxy_pass         http://localhost:3200;
  proxy_redirect     off;
  proxy_set_header   Host $host;
}
That very subtle change causes nginx to redirect, which is undesirable.

This can easily go unnoticed without curl testing:
$ curl -i http://localhost:8080/foo/bar
HTTP/1.1 301 Moved Permanently
Server: nginx/1.13.8
Date: Sun, 11 Feb 2018 14:18:12 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 40
Connection: keep-alive
Location: /bar

<a href="/bar">Moved Permanently</a>.
I've edited the answer back to the original.

Here's a great article about setting up nginx for serving Go apps.

NOTE: you'll need the GVM readme for an up-to-date command to install GVM.

Friday, December 15, 2017

ISP's and Markets

​The idea that an ISP can collect money from a content provider because a consumer requested content is like saying Safeway should be able to charge Kellog's for the Pop-Tarts I want to eat.

Just wait until Disney starts telling Time Warner to pony up for all the Toy Story they've been carrying. The real problem is that consumers have little or no choice of ISP. Each ISP has a practical monopoly in the markets where they operate.

In order for a free market to be a solution to some problem, there has to be a choice. I may choose from a variety of content providers, but I don't get to choose my cable company.

If a consumer doesn't like the way their ISP is regulating content, they should be able to choose a different ISP. But they can't. Maybe it's time we start regulating ISP's like the monopolies they really are.

Sunday, July 09, 2017

When resources unavail

Every so often my Linux system starts feeling poorly. Firefox will hang and won't let me close its window. So I ALT-TAB over to my terminal window to kill it.

$ ps -fewww | grep -v grep | grep firefox
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: retry: Resource temporarily unavailable
bash: fork: Resource temporarily unavailable

When this first happened, I figured I would reboot and that, of course, would fix it. But I couldn't even run shutdown! That's when I thought of this extremely inelegant but useful solution:

$ cd /proc
$ kill *

And that freed up enough of whatever that I could get on with the reboot and then with my life.

When it happened today, I googled around and saw saw solutions suggesting...
  • su root and (WRONG: can't su)
  • ps blah blah and (WRONG: can't ps)
  • ulimit (hmmm... OK I'll try that.)
This particular solution suggests setting NPROC (max user processes) using ulimit -u like so:

$ ulimit -a
...

max user processes              (-u) 2047
...

$ ulimit -u 2100

Upping that value allowed me to kill and restart Firefox without rebooting!!

Thanks, IBM!!

Friday, March 24, 2017

Mac + Virtualbox/Linux ALT=CMD

By default it seems that when you run Linux in Virtualbox on a Mac, ALT will be mapped to the OPTION key and SUPER will be mapped to CMD.

It's much more natural to swap these, i.e. to map ALT to CMD.

And here's how you do it:

Create ~/.Xmodmap containing...

clear mod1
clear mod4

keycode 133 = Alt_L NoSymbol Alt_L
keycode 64 = Super_L NoSymbol Super_L

add mod1 = Alt_L
add mod4 = Super_L


And then

$ xmodmap ~/.Xmodmap

Enjoy!

Monday, January 23, 2017

VNC + Mac OS + Option Key = WINNING!!

I love my Macs, but sometimes through no real fault of their own, they can be a bit of a pain in the butt.

Take the Option Key. Very helpful if you're using the Finder.


Ever try using the Option Key when you're connected remotely to your Mac Desktop using VNC? It just doesn't work. VNC settings, nothing.

But I have discovered a solution. Simply turn on Sticky Keys and use the Keyboard Viewer. Now you can use your mouse to press the Option Key - not ideal, but in a pinch, it's better than nothing!

Here are the step-by-step instructions for setting this up:

1. Open up the Preferences


2. Choose Accessibility


3. Turn on Sticky Keys



4. Go back to Preferences and choose Keyboard


5. Turn on "Shoe keyboard and emoji viewers in menu bar"



6. Open up the Keyboard Viewer


7. Now whenever you need to hold down the Option Key, tap it in the Keyboard Viewer


8. If you didn't have Sticky Keys turned on, you'd have to keep it held down in the viewer, but you can just tap it the once. Tapping it again puts it into some other state. Tapping it a third time turns it off. So whenever I want Option, I double click it in the viewer. Then I do whatever it was that needed the Option Key in the first place. And then I tap it again to turn it off.

I hope you find this helpful!

Saturday, December 24, 2016

#selector vs Selector

TLDR: In Swift 3, use #selector instead of Selector (see here).

The warning (No method declared with Objective-C selector 'swipedLeft:') should be your first clue that there's a problem...



If you use this code in Swift 3, the left-swipe will result in an error like this:

2016-12-24 08:15:12.645 SpriteSimpleGame[65853:2987246] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SpriteSimpleGame.GameScene swipedLeft:]: unrecognized selector sent to instance 0x7fb99e4101f0'

Worst of all, examples like this are all over the place because leaving out the colon results in a similar error.

Thanks to this answer I learned that what you want instead is this:

let swipeLeft = UISwipeGestureRecognizer(
    target: self,
    action: #selector(swipedLeft(sender:))
)

Thanks, internets!!

Friday, September 09, 2016

VNC black screen of sadness

Did you connect to your VNC server only to be greeted by a black screen of sadness? 

It happened to me not long ago and I don't know what made me try this, but here's what fixed it:

$ vncpasswd

As always, you're welcome.

Monday, June 20, 2016

Old code, new Xcode

When you download some old code from the Interwebs with such like:

[self.window addSubview:self.viewController.view];

and it runs just fine... and later you update Xcode and start getting runtime errors:

Applications are expected to have a root view controller at the end of application launch

Fortunately the fix is easy:

[self.window setRootViewController:self.viewController];

Thanks, Interwebs!!