Saturday, March 10, 2018

How to: Cook shrimp in an air fryer

We recently got a cool new toy, something that I've wanted for a very long time: An air fryer!

What does an air fryer do? It doesn't actually fry. It is a convection oven that uses forced hot air to cook things quickly. These "air fryers" are meant to be used sort of like deep fryers; they're good for things like fries, potatoes, chicken wings, breaded shrimp, and other snacky things that you would cook in a deep fryer, if you had one. Well, I don't want a real deep fryer, because all that oil is bad for you, and it makes your home smell like a Burger King. So I've been wanting one of these things for a while. When I first started looking these up a couple years ago, I saw that that Philips was selling them for $200 -- just too expensive for me. I started looking again recently and saw that there are now some other well-reviewed ones from other brands for under $100. I ended up buying this GoWISE USA GW22639 3.7-Quart Programmable Air Fryer on Amazon for about $62. It was list price for somewhere around $70 or $80, so I ended up buying a used one (a returned one, I think) for $65, then I got an extra five percent off thanks to our Amazon card.

We've had lots of success with our GoWISE USA GW22639 3.7-Quart Programmable Air Fryer! Timing (and temps) on different foods can take some trial and error; the manual isn't very detailed, and online instructions vary greatly. But still, our first attempts at cooking food in this thing have gone very well. We did a "test case" of frozen french fries (that happened to be Dollar Tree) and they came out perfectly on the "chips" (fries) setting. We've since cooked chickpeas, chicken wings, shrimp and more in it.

Here's a short video I made showing how easy it is to make frozen shrimp.

All you do is take the frozen breaded shrimp and throw it in the pot. Make sure it evenly covers the bottom, and try to have only one layer of shrimp, if possible. The "shrimp" preset setting cooked the shrimp for 15 minutes at 330 degrees. I've also done it on the "fish" setting, which is 20 minutes at 400. That was a bit too long, and yet when done on the shrimp setting, they could have perhaps gone for a minute longer. So next time, I'll go somewhere in between.

Also, now I know how to use iMovie.

Note: The air fryer is likely not suitable for cooking either crab claws or cocaine. You have been warned.

Friday, February 23, 2018

Guns are too easy to get, thanks to the modern NRA

Karl Frederick, NRA President in 1934, during congressional hearings on the National Firearms Act (which the NRA supported) testified "I have never believed in the general practice of carrying weapons. I seldom carry one. [...] I do not believe in the general promiscuous toting of guns. I think it should be sharply restricted and only under licenses."

The NRA also supported the Gun Control Act of 1968 (GCA), which together created a system to federally license gun dealers and established restrictions on particular categories and classes of firearms.

Something changed in the 1970s. From Politico in 2014:
From 1888, when law review articles first were indexed, through 1959, every single one on the Second Amendment concluded it did not guarantee an individual right to a gun. The first to argue otherwise, written by a William and Mary law student named Stuart R. Hays, appeared in 1960. He began by citing an article in the NRA’s American Rifleman magazine and argued that the amendment enforced a “right of revolution,” of which the Southern states availed themselves during what the author called “The War Between the States.”
At first, only a few articles echoed that view. Then, starting in the late 1970s, a squad of attorneys and professors began to churn out law review submissions, dozens of them, at a prodigious rate. Funds — much of them from the NRA — flowed freely. An essay contest, grants to write book reviews, the creation of “Academics for the Second Amendment,” all followed. In 2003, the NRA Foundation provided $1 million to endow the Patrick Henry professorship in constitutional law and the Second Amendment at George Mason University Law School.
This fusillade of scholarship and pseudo-scholarship insisted that the traditional view — shared by courts and historians — was wrong. There had been a colossal constitutional mistake. Two centuries of legal consensus, they argued, must be overturned.
It's time for something to change.

Chicago highlights why gun control doesn't work? No.

I lived in Chicago for just under ten years. I love the city, and I consider it my adoptive home town. One thing I heard over and over, usually from people that didn't live there, was that Chicago was the perfect example of how gun control doesn't work. Guns are banned, but gun crime happens. Often. What it actually tells us is that gun control requires a comprehensive, nationwide policy or it will not work. This pro-gun blogger points out data that says that the majority of traceable guns used in crime in Chicago came from straw purchases. He's right that we do need to prosecute straw purchases better -- but we also need to better prevent those purchases to begin with. The process is just too easy today, and there are too many idiots who will buy guns and give them to other idiots. Including my now-deceased father, who wanted me to buy a particular gun for him, after he was denied its purchase due to having a restraining order against him (if I recall correctly).

Indiana and Wisconsin are an easy drive from Chicago. Friends today in Chicago drive to Indiana just to buy cheaper cigarettes. Of course people are going to do the same to avoid a localized attempt at gun control. It's too easy to get around the rules.

No, the real problem with Chicago and guns is "all those young urban thugs."

False. All the mass school shootings and mass workplace shootings that I know about seem to have been perpetrated by white people, not people of color.

The real problem for somebody in Texas who complains about "urban thuggery in Chicago" isn't worth unpacking here. Let's instead focus on the problem of crime in the poor inner city. This is driven by poverty in the inner cities caused by racism and inequality of opportunity and inequality of infrastructure. Bad schools and no other options. Born into poverty means you're likely to live your life in poverty. Here's one example of how providing access to better schooling and social programs can help to break that cycle.

Let's stop school shootings by arming teachers!

There are a million reasons why this is a dumb, but here's one reason I've rarely heard anything about: Some of those teachers will be people of color, and cops today aren't necessarily all that kind to people of color who carry firearms legally. Just ask Philando Castile. Teachers who are people of color would be scared shitless (and rightly so) if they ever got pulled over for anything at all by the police, while traveling to and from school with their (legal or perhaps even legally mandated) guns. What could go wrong?

Why not call out the car manufacturers for making these killing machines?

Inevitably the argument turns to cars and how they kill more than guns. Even though the numbers are roughly equal, people say that it's fair to pull out numbers for suicide-by-gun, "and it would appear that traffic fatalities, in sheer number, are a much greater blight upon America than non-suicide gun deaths."

Except that we, as a nation, have vastly improved automobile safety over the last fifty years. This article shows some of the highlights. We've tried very hard to make cars safer, and we require training and licensing (and re-licensing!) for anyone who wants to drive a car. We restrict car usage, making it illegal to use without a license or while under the influence of alcohol.

OK, we've called out cars to try to make them safer. Now let's do the same with guns.

Monday, February 5, 2018

Drinking on a budget: Dollar Tree martini glasses!

We had a very nice set of (I think) six martini glasses, some well-known brand, that we bought as a set perhaps somewhere around five years ago. Every year or so, I accidentally break one of the glasses by dropping it, or the dishwasher decides it's time to crack one of them. So now I'm down to one and it was time to restock. But, I'm on a budget here in Miami. The solution: Dollar Tree!

What could be simpler? They look great. They hold as much as our previous martini glasses, though they look a tiny bit smaller. They also seem a bit sturdier as far as glass and stem thickness. They clean up very nice in the dishwasher. And they're only a dollar each. I'm sold!

I think we're not the only ones sold on Dollar Tree martini glasses. We went to a very famous local restaurant recently, one known for crab claws, and they served us a round of cocktails in glasses that looked suspiciously like these ones. Can't say that I blame them, especially if these are sturdier than average.

Thursday, February 1, 2018

Linux: Redirecting or Silencing Script Output

I've been writing shell scripts on *nix systems for more than twenty years. You'd think that by now I'd have this memorized, but I don't. Since I'm tired of looking it up every time, I'll post this here so that it can help jog my memory next time around.

Repeat after me: redirecting stderr and stdout is easy.

To run your script while silencing any and all possible output, execute it like this:
./ > /dev/null 2>&1

To silence it only when it runs via cron, to make it not send you an email after it runs, put it in your crontab like this:
0 5 * * 1 /home/aiverson/ > /dev/null 2>&1
(all on one line)

If you're running a command inside a script and you want to capture both possible errors and standard  output in the same way, so that you can parse it easily, do this:
OUTPUT=`lynx -dump "http://website" 2>&1`
If you don't add the 2>&1, any error message returned by lynx is sent to the active window running your script, instead of into the $OUTPUT variable.

Sunday, January 21, 2018

Linux: Scraping web output with wget

This is probably a tip that smarter folks than me know already, but I just ran into this today and decided I'd write it down for future reference.

I'm writing a simple unix shell script that scans the web interfaces of a bunch of internal servers, looking for a specific error message. Very light touch, fairly simple stuff.

Lots of simple stuff like this:
lynx -source "" | \
grep "error code"

It turns out that the server I need to install this on doesn't have lynx installed. It does have wget, however. But wget defaults to dumping the output into a file instead of to standard output, which is annoying when you don't actually care about saving the output.

Unless you do it like this:
wget -qO - "" | \
grep "error code"

That makes these two bits of sample code (one with lynx, the other with wget) work exactly the same way. The "q" flag is to quiet wget's normally verbose output, and the "O -" flag is telling wget to dump the output to stdout ("-") instead of to a file.

Which one is faster? In my entirely non-scientific testing, lynx seems to be faster. My suggestion is that if you can, test. Or just use lynx if your system has it installed (or if it can be installed), and use wget as a backup only. (And I didn't even really get a chance to test curl. Sorry!)

For now, I've got a solid workaround to get my script to work on a server that doesn't have lynx and where I'm not an administrator.

Thus ends today's lesson in stupid shell script tricks.

Thursday, December 21, 2017

How to block Fox News in Apple News and Google News

If, like me, you prefer not to give clicks and ad revenue to the Fox News website, here's how you can keep their results from showing up in Google News and Apple News.

Blocking Fox News in Google News:
  1. Go to the Google News website at
  2. Click on the "Gear" icon near the top right of the page.
  3. Select "Sources."
  4. In the "Block" section, type "Fox News" and then click on the first website result.
  5. If you want to block all the variants of Fox News (that I know about as of this writing), block the following: Fox News, Fox Business, Fox News Latino, FoxNews, FOX News Radio, FOX News Magazine, Fox News Insider
Extra tip: Also check out the "Preferred Sources" setting on this screen. In my preferences, I added "Washington Post" and "NPR" as preferred sources. That way if Google News has multiple articles on a topic, it will be more likely to recommend an article from one of those two sources. Why? Because I pay for a Washington Post subscription, thus I'm unlikely to run into a paywall versus if the link is to Wall Street Journal or New York Times, and because I trust National Public Radio (NPR).

Blocking Fox News in Apple News:
  1. On your iOS device, open the "News" application.
  2. Find an article published by Fox News.
  3. Don't open the article; just click on the "Share" icon underneath the article. It's the box with an arrow poking up out of it. It's located at the bottom of the article entry, under the headline, over to the right.
  4. A menu pops up. The first choice is "Airdrop" but if you look down below, there are options for "Dislike Story" and "Dislike Channel." Select "Dislike Channel."
  5. That should do it. You should now no longer see any stories from that source.
Note: Depending on your version of iOS, the menu selection might be called "Mute Channel."

Here's more information on liking / disliking channels in Apple News.

Friday, September 8, 2017

On Quick & Dirty Email Attachments in Unix

Need to export a file from Unix/Linux via email? Got uuencode? Do you even remember uuencode? It's how we used to encode files for file sharing, back before you were born.

Here's a handy one-liner that will wrap your file up as a UUEncoded attachment and mail it to the address you specify. The email should come through with a properly formatted attachment that you can then download.

Just do this:
% cat | uuencode | mail [email protected]

Or you can get a bit fancier and add a subject line and a proper from address (if your system doesn't add one already):
% cat | uuencode | mail -s "Export of" -a "From: Me <[email protected]>" [email protected]

Or you can do it as part of a shell script, with bits that look something like this:

FROM="Just Me <[email protected]>"
TO="[email protected]"
cat $FILE | \
uuencode $FILE \
mail -s "Export of $FILE attached" \
-a "From: $FROM" \

I know there's probably some better way to do this, but this simple example has saved me endless amounts of time lately. Hope you find it useful, too.