Find files of a particular type in a web search

Snippet

Works on the googs, and duckduckgo, use the option filetype:<type> in the search box to filter results to only that file type.

Useful when you need documents for testing, and don't particularly care about the content, but you do care about the format.

Example: https://duckduckgo.com/?q=filetype%3Adoc+beagle&t=h_&ia=web

filetype:doc beagle

View Git Stash Contents Without Applying to Codebase

Snippet

Use git stash list to view all stashes

Use git stash show with options to view a stash without applying it to the codebase.

# see a "git diff" of what's in the first stash 
git stash show -p stash@{0}

And, a shell script to view these. Save this into a file, chmod +x the file, and run in the terminal.

#!/bin/bash
 
readonly STASH="$1"
 
if [[ "xx${STASH}" != "xx" ]]; then
    git stash show -p stash@{${STASH}}
else
    git stash list
fi

Local Mail Server During Development

Snippet

Sometimes, you need to send email during software development, and you need to be able to receive the email, even if the addresses are fake (say, to @example.org) and what have you.

The node package, fake-smtp-server is a handy tool for providing a server to receive the mail, and an interface for viewing the email that was sent.

https://www.npmjs.com/package/fake-smtp-server

Install globally on a system with:

npm install -g fake-smtp-server

Start it up:

fake-smtp-server

If you want to have it on port 25 as most mail servers expect, run as root:

sudo fake-smtp-server -s 25

View the emails received (by default) at

http://localhost:1080

You can change that port, too:

sudo fake-smtp-server -h 8888

A few other configurations, and an API. Great little tool.

Usage:
  fake-smtp-server [OPTIONS] [ARGS]
 
Options:
  -s, --smtp-port [NUMBER] SMTP port to listen on (Default is 1025)
      --smtp-ip [IP]       IP Address to bind SMTP service to (Default is 0.0.0.0)
  -h, --http-port [NUMBER] HTTP port to listen on (Default is 1080)
      --http-ip [IP]       IP Address to bind HTTP service to (Default is 0.0.0.0)
  -w, --whitelist STRING   Only accept e-mails from these adresses. Accepts
                           multiple e-mails comma-separated
  -m, --max [NUMBER]       Max number of e-mails to keep (Default is 100)
  -a, --auth STRING        Enable Authentication
      --headers            Enable headers in responses
  -k, --no-color           Omit color from output
      --debug              Show debug information

The Big Sleep

Book Notes

I added this book to my reading list some time after reading a ranking of Chandler's Marlowe books in order of "good," and this one wasn't first, but it is the first book of the series.

After checking this book out from the library, I found a nicely bound hardcover in a bookstore. Instead of reading the library version, I've been reading the paper version. Turns out, I've seen the movie, and recall much of it. The first 25% of the book matches the film well. We'll see if it stays that way, I'll be watching the movie again shortly.

I really enjoyed this book. Helps that I've lived in Los Angeles. While my residency was not in the late thirties, the world that Chandler describes is vivid enough, and based on real enough places, that I could visualize the story very well.

Unsurprisingly, most of the supporting characters are one-dimensional, Silver-Wig loves her man, until she realizes he's a killer, for example. Mars is a tough guy, willing to do most things for a dollar, and smart enough to have someone else do those things.

Marlowe, however, has more character. He's the hero of the story, we follow him around, we see more of his motivations, so unsurprisingly we understand him better. Seems reasonable that someone who wants to solve puzzles and understands a bit about human character would become a private investigator.

Unrelated, there is a lot of "kissing people you just met" in this book, but no actual sex. I didn't realize that people kissed so much in Los Angeles. I clearly did L.A. wrong.

I enjoyed the book. I enjoyed all the one-line and otherwise short zingers, and the snappy dialog. I'll likely continue reading the series.

"If I sound a little sinister as a parent, Mr. Marlowe, it is because my hold on life is too slight to include any Victorian hypocrisy."
Page 13

“I need not add that a man who indulges in parenthood for the first time at the age of fifty-four deserves all he gets.”
Page 13

Dead men are heavier than broken hearts.
Page 42

"Sure you can’t help me on this?"

I liked his putting it that way. It let me say no without actually lying.
Page 62

Not being bullet proof is an idea I had had to get used to.
Page 73

He was afraid of the police, of course, being what he is, and he probably thought it a good idea to have the body hidden until he had removed his effects from the house.
Page 110

"Being what he is," which would be gay. I appreciate the progress we have made as a culture, in many ways. We have further to go.

Cops get very large and emphatic when an outsider tries to hide anything, but they do the same things themselves every other day, to oblige their friends or anybody with a little pull.
Page 114

"You’ll hear from him."

"Too late will be too soon," I said,
Page 116

I read all three of the morning papers over my eggs and bacon the next morning. Their accounts of the affair came as close to the truth as newspaper stories usually come—as close as Mars is to Saturn.
Page 118

“What makes you think I’m doing anything for him?”

I didn’t answer that.
Page 120

Then my eyes adjusted themselves more to the darkness and I saw there was something across the floor in front of me that shouldn’t have been there. I backed, reached the wall switch with my thumb and flicked the light on.

The bed was down.
Page 153

HUH. Marlowe has a Murphy bed, too!

I’m your friend. I won’t let you down—in spite of yourself.
Page 155

I threw my cigarette on the floor and stamped on it.
Page 156

A significantly different world. There are many references to cigar and cigarette ash being allowed to fall into the rug.

It seemed a little too pat. It had the austere simplicity of fiction rather than the tangled woof of fact.
Page 169

There was a tarnished and well-missed spittoon on a gnawed rubber mat.
Page 170

Again, different world.

“It’s very funny,” she said breathlessly. “Very funny, because, you see—I still love him. Women—” She began to laugh again.
Page 196

One dimensional.

What did it matter where you lay once you were dead? In a dirty sump or in a marble tower on top of a high hill? You were dead, you were sleeping the big sleep, you were not bothered by things like that. Oil and water were the same as wind and air to you. You just slept the big sleep, not caring about the nastiness of how you died or where you fell.
Page 230

Overheard

Blog

Today.

"The teacher words the question different so we get it wrong!"

No, Kid, she words it differently so that you can demonstrate your mastery of the material. If wording a question differently causes you to answer incorrectly, you don't understand the material.

Related.

"You're near failing."

"But I'm not actually failing."

Way to embrace the razor's edge, Kid. How about doing the work so that you're not anywhere near failing?

Pages