What I Do for a Living

I’m often asked, “What’s your job?” The short answer is that I fix things for AT&T. The longer answer is:

I’m like a prosecuting attorney and a judge, for complex computer systems.

For complex IT systems, involving load balancers, web servers, application servers, inter-application communication via sockets/web services/message queues, databases, SANs, proxy servers, security appliances:

  • When everyone says, “My piece is good. Somebody else is broken.”
  • I ensure that we collect evidence.
  • I look at the evidence.
  • I say, “The evidence shows that your piece is doing this and it should be doing that. Fix it.”

The Monte Hall Problem

I was struggling to understand the Monte Hall problem. This explanation helped.

I think the confusion is between dependent and independent probability. Ironically, I dropped my first course in Statistics because the prof was confusing the two.

Here’s the explanation that makes sense to me:

  • If you choose the correct door and you switch, you lose.
  • If you choose incorrect door-a and you switch, you win.
  • If you choose incorrect door-b and you switch, you win.

Ergo, in 2 of 3 cases you win by switching.

Now consider:

  • If you choose the correct door and you don’t switch, you win.
  • If you choose incorrect door-a and you don’t switch, you lose.
  • If you choose incorrect door-b and you don’t switch, you lose.

Ergo, in 2 of 3 cases you lose by not switching. (That’s logically equivalent to saying that in 1 of 3 cases you win by not switching.)

The thing is, this is **dependent **probability, but it is dependent upon whether you picked correctly on the FIRST guess, not on where the win is.

There are two possibilities for your first choice: You picked a winner or you picked a loser.

  • Given that you picked a winner, what is the probability that switching will win? Zero
  • Given that you picked one loser, what is the probability that switching will win? 50%
  • Given that you picked the other loser, what is the probability that switching will win? 50%
  • What is the probability that your initial pick was a loser? 2 in 3.
  • What is the probability that your initial pick was a winner? 1 in 3.

By not switching, you are betting that your initial pick was right, which has only a 1 in 3 probability.

LaTeX Crib Notes

Description Markup Example
newline \\  
exponent ^ \( x^2 \)
union \cup \( \cup \)
intersection \cap \( \cap \)
space ~  
tilde ‘\sim’ \( \sim \)
tilde ~ outside of TeX ~
backslash \backslash \
x over y (division) x \over y \(x \over y \)

My list focuses on things that work in mathematical formulae without using a package, because that’s where I use TeX – for math expressions.

Other web pages:

  • Handy LaTeX math reference
  • Render LaTeX but copy/paste will paste only a black rectangle. Does an unattractive job on my complex example.
  • Render LaTeX VERY SLOW - copy/paste of simple stuff as text works, but copy of image does not. Renders my complex example well.
  • Render LaTeX - Chrome plugin. Renders well

For the copy/paste problem, you can work around it by saving the image to disk, opening with Paint, and copying from Paint.

Equation that is tough to render well:

` X(u) = \sum_{n=0}^{N-1} x(n)e^{-i2\pi un/N} `

\( X(u) = \sum_{n=0}^{N-1} x(n)e^{-i2\pi un/N} \)

Why I Switched to Notepad++

I had a million Notepad files open, with unsaved to-do items, meeting notes, etc.

My employer pushed a mandatory update with a mandatory reboot, while I was out of the room. I lost all those Notepads.

Notepad++ with the auto-save plugin can be configured to restore all those not-yet-saved files.

=====

You can make Notepad++ really replace Notepad (pervasively) by setting up Notepad++ as a debugger for Notepad! See https://mysoftwarenotes.wordpress.com/2012/07/

Use Crashplan on Ubuntu With Encrypted Volume

I use an encrypted volume with LUKS on my Ubuntu server. First, I mount the encrypted volume, then I mount a zfs file system from it.

CrashPlan was getting confused because when CrashPlan started, the /data volume I’m backing up was empty because the volume isn’t mounted until after I login and enter the password. So I needed to delay CrashPlan startup until after the encrypted volume is mounted. (i.e. I need a delayed CrashPlan start.)

  • Run this to remove crashplan from init:
    • sudo update-rc.d -f crashplan remove
  • Append this to the script where I mount my zfs volume (~/bin/mount-zfs.sh on my machine)
    • sudo /etc/init.d/crashplan start
    • /etc/init.d/crashplan status

FoldingText Cheat Sheet

My cheat sheet for using the Atom editor with the FoldingText package. See official doc at https://jessegrosjean.gitbooks.io/foldingtext-for-atom-user-s-guide/content/editing.html

Must-do:

  • Must choose File » New Outline and save as .ftml, to create an outline.

How-to:

  • Hyperlink: Cmd-Shift-K
  • All sorts of formatting: Cmd-Shift-P “Outline Editor: Toggle”
  • Edit tags: t (or Cmd-Shift-t in Text Mode)
  • Fold all to a given level: Edit » Folding
  • Toggle fold: Cmd-period (or just period, if not in Text Mode)
  • Toggle “complete” tag: Ctrl-space (or just Space, if not in Text Mode)
  • Toggle priority: digits 1-9
  • Indent: Tab
  • Outdent: Shift-tab
  • New line: Enter
  • Fold: Click the triangle
  • Unfold: Click the triangle
  • Move: Drag the triangle (hold Option to copy instead of move). Hold Ctrl while dropping (not dragging) to copy a hyperlink back to the original. (Can link across files.)
  • Enter Text Mode: press i or a or left/right arrow key or click where you want.
  • Exit Text Mode: press Esc.
  • Get full list of commands: Cmd-shift-P and type “outline editor”
  • Focus on children: Cmd-Opt-Down
  • Unfocus: Cmd-Opt-Up
  • Filter by text: Cmd-F, then type string to match. Search syntax is at https://jessegrosjean.gitbooks.io/foldingtext-for-atom-user-s-guide/content/appendix_a_search_syntax.html
  • Filter by tag: Click on a tag or use Cmd-F and search for the tag text (e.g. #mytag)

Formatting:

  • Command-B to bold text.
  • Command-I to italicize text.
  • Command-U to underline text.
  • Command-Shift-K to insert and edit links.
  • Control-C to clear text formatting.

Concepts:

  • Text mode: When a line is selected, you can’t change the text. You enter “text mode” to get an i-beam cursor.
  • Focus: Show me just the children of this row.
  • Filter levels is funky. This shows up most often if you put a “complete” status on a parent and filter for “not @status = complete”, and it will show you the complete parent if a child is incomplete.

Windows Not Hibernating / Windows Not Sleeping

I have a Windows 10 computer that was failing to hibernate after inactivity and it was waking immediately after hibernating AND the mouse would wake it up, even though I’d told Device Manager that the mouse should NOT wake the computer. It seems to behave better now. Here are some changes I made and techniques I tried.

The mouse was waking the computer even though I disabled “Allow this device to wake the computer” in Device Manager for the mouse device. It turns out that my mouse also thinks it is a keyboard. I had two Keyboard devices listed. Dis-allowing one of them prevented the keyboard from waking the computer (as expected). Re-enabling that Keyboard and dis-allowing the other Keyboard prevented the MOUSE from waking the computer.

  • From an Administrator command prompt:
    • powercfg /lastwake
      • This is supposed to tell you why the computer last woke. It might do that sometimes, but it didn’t help in this case.
    • powercfg /requests
      • This is actually pretty helpful. It tells you what programs are running RIGHT NOW that would prevent sleep. I found that Google Chrome was playing a YouTube video in the background. On this particular computer, I want it to sleep unless someone is actively using the mouse/keyboard.
    • powercfg /requestsoverride PROCESS chrome.exe AWAYMODE DISPLAY SYSTEM
      • This tells Windows to ignore chrome.exe, when deciding whether the computer is busy.
    • powercfg /requestsoverride PROCESS javaw.exe AWAYMODE DISPLAY SYSTEM
      • This tells Windows to ignore javaw.exe, when deciding whether the computer is busy. This is what it takes to prevent Minecraft from preventing sleep.
    • powercfg /requestsoverride
      • This shows you what overrides you have previously created.
    • powercfg /requestsoverride PROCESS chrome.exe
      • This will REMOVE your override for chrome.exe

There’s one more related item of interest.

  • Create a registry key: HKLM\Software\Policies\Microsoft\Power\PowerSettings\A4B195F5-8225-47D8-8012-9D41369786E2
    • (Yes, use that number. It isn’t something that changes from PC to PC.)
  • Create a DWORD ACSettingIndex
    • This applies to when running on AC power. If you want it to apply when running on battery, use DCSettingIndex.
  • Set the value to 0 to ignore applications when deciding whether busy.
  • Set the value to 1 to respect applications when deciding whether busy.

If you set it one way and it doesn’t work, you might try the other way. I’m not certain that the doc doesn’t have the values backwards.

Black Screen and Lock-up Booting Ubuntu 16.04 Xenial Xerus

At some point, I started having trouble getting the Black Screen and Lock-up Booting Ubuntu 16.04 Xenial Xerus GUI to boot if there was no monitor attached. Then it seemed to start happening even if I had a monitor attached. I’d get a black, text-mode screen with a cursor blinking in the upper-left corner and nothing else. This fixed my black-screen-mid-boot problem:

  • sudo vi /etc/default/grub
  • Adding “vmalloc=256MB video=LVDS-1:d” to the GRUB_CMDLINE_LINUX_DEFAULT
  • sudo update-grub

Turn Off the Alarms On a Casio Illuminator Five Alarms W213

Casio makes inscrutable watches. I suppose there’s only so much U.I. you can do with 4 buttons. My Casio Illuminator Five Alarms W-213 started alarming at midnight.

In the course of pushing buttons, it is easy to accidentally enable an alarm. (e.g. If you get the digits flashing to set an alarm, it auto-enables the alarm, even if you don’t change the time.)

It is much harder to disable the alarm. Here’s how:

  • Poke the Select button until you reach the alarm screen.
  • Look at the wheel indicator in the upper-left corner. It is marked with digits 1-5. If any of these indicators is dark, that alarm is on.
  • Press the Start/Stop button until the desired alarm is displayed.
  • Press the Reset button until the wheel-indicator for that alarm number AND the SNZ indicator to the right of the wheel are off.

Human Factors comment: Making the default alarm time for your product be midnight is inconsiderate. Yeah, I know – you defaulted to zero. That’s a very programmer thing to do. But when I accidentally enable an alarm, I really, really do not want it to wake me at midnight.