Space Reality Check

Gee, this guy is even more brutally honest than I am:
5 Horrifying Facts You Didn’t Know About the Space Shuttle

Also, an EASA administrator was roasted for his answer that reusable spacecraft would reduce jobs, but it looks like SpaceX is doomed financially because there aren’t enough missions to make low-cost launches financially viable for its 5,000+ staff.

Which is why SpaceX is polluting the sky with microsatellites now.

Around 1998, I had a chance to talk to a de Havilland aircraft engineer. It went like this:

Me: “Since we lose money on every airplane built, why not just close the Toronto factory and do design work?”
de Havilland Engineer: “because without a jobs scheme, there won’t be any budget for design work.”

Of course, then Bombardier (a Quebec jobs scheme) gave the A220 design to Airbus in 2017/2018, so who was right? 🙂

The State of Galileo as seen by an outsider

From my studies of the X-planes program, that was the USA’s most successful and cost-efficient aeronautics program. The research ended up in every civilian and military airplane built.

The pause in the X-planes program in favor of the rocket program was a huge mistake that set back hypersonic flight by decades. You could make a list of 100 advancements due to the X program that essentially cost nothing.

Posted in Tech | Leave a comment

Major Accident Outside Stonestown Galleria Mall

Late Friday nite (Oct. 25), I happened to be looking towards the 19th Avenue and Winston Drive intersection outside the Stonestown, Galleria Mall, SF, when a major accident occurred.

A car at high speed ran into another car doing a turn in the intersection. There was a loud bang and an orange fireball (just like a Hollywood movie) appeared over one car. The cars moved about 10 yards, and one car remained in the road while the other stopped on the sidewalk. I noticed a police car stopped before the intersection immediately (ie. instantaneously) after the accident. There was a lot of smoke drifting over the road.

The collision was intense and violent. It happened so fast that very few details beyond that were apparent. I remember thinking, “I hope the people in the 2 cars are ok” and “I don’t need to see something like this.”

Cars continued to drive and turn through the unblocked lane next to the accident. I remember the distinct crunching of plastic and metal parts that were on the road.

Several more police cars arrived within a minute or two while one policeman emptied a small fire extinguisher at the car. I was impressed with the speedy arrival of so many police cars, and also the heroism that several policemen quickly approached the smoking car on a street full of traffic.

(According to the skid marks I saw the next day, it was the high-speed car that ended up on the sidewalk. It applied brakes heavily but briefly, then veered at a 45 degree angle from its lane, over a small median island, onto the sidewalk, and dug into the grass, which stopped it.)


Map
Map of accident at 19th Avenue and Winston, SF

I guess the questions I have now are:

  1. if a car explodes, does that mean all the gasoline has been consumed and it’s safe to approach?
  2. how are the occupants doing?
  3. the police did a great job – after all, this was like a war zone on a busy street. I wonder if there should be more procedure to always carry fire extinguishers towards a burning car, or carry gloves, but they’re not firemen.
  4. Was this a police chase? That would explain the high rate of speed and proximity of so many police cars.
Posted in San Jose Bay Area | Leave a comment

Migrating SQLite Databases to MySQL

Recently I had to migrate a relatively simple (no FKs or views) Grafana 4 database of about 20 tables and 80,000 rows from sqlite3 to mysql5.6. Below are some notes I made on the 3 methods I tried.

  1. First up was MySQL Workbench on Mac OS. This required first finding and installing a working ODBC driver for sqlite3, which was a hassle. (The Devart one worked.) Then configuring it in the Mac’s ODBC Manager. After clicking a few UI buttons, the import failed with an error message for each table and Workbench crashed, like usual for the past 2 decades. Tried again with another crash. Moving on …
  2. Next up was Navicat Premium Trial Edition. It was able to create a sql file that was syntactically valid with MySQL but had 3 major problems:
    1. it applied the TEXT cast to most of the string and date values
    2. which then meant it thought it had to declare most of the character and date columns as LONGTEXT and LONGBLOB
    3. which meant the index definitions using those columns were invalid because of length. In other words, a mess.
  3. Finally I used a bash script that enumerated the table names using .tables and did a sql dump using .mode insert on each table of individual INSERT statements. That worked fine.

Some other ideas to consider for more complex migrations are:

  • Use the Amazon database migration tools. There’s at least 3 that I’m aware of.
  • Use the professional-grade pgloader to migrate to Postgresql, then use another tool to pivot to MySQL.

The MySQL grants you need for grafana are:

GRANT USAGE ON grafana.* TO 'grafana'@'%' IDENTIFIED BY 'mypw';
GRANT ALL PRIVILEGES ON grafana.* TO 'grafana'@'%';

There is problem with the Grafana initial table creation script: it uses CREATE IF NOT EXISTS for the tables, but not the indexes, so you see this:

CREATE UNIQUE INDEX `UQE_user_login` ON `user` (`login`);

Posted in MySQL, Open Source, Tech | Leave a comment

Very Good Article on Boeing 737 MAX Fiasco

New Republic has a very good recent article on the Boeing 737 MAX, titled “Crash Course.”

Overall, the article appeared to be written by a non-expert journalist. For example, airline accidents in Indonesia are in fact very common. But overall the collection of facts rings true and is a good summary to date.

It’s the first time I’ve seen the $1 million per airplane penalty mentioned that Boeing would owe to Southwest if sim training would be needed.

Essentially, that perverse incentive is likely the root cause for everything that followed.

It would be interesting to interview the people involved in negotiating that. Because airliner accidents often end airlines.

It’s also interesting that FAA staff didn’t want to work on the certification. The only other time I’ve heard of misgivings like that is for high-risk warbird and amphibious checkrides.

Indonesia Report: Pilots, Ground Crew Share Blame With Boeing For Lion Air Crash

US Congressional Hearings, Oct. 29-30, 2019

Boeing employee raised concern over Max sensor three years before crashes, email shows
Boeing CEO Pleads Initial Ignorance of MCAS Message Details

Posted in Tech | Leave a comment

PSA: Running Mac OS X csrutil Without a Recovery OS Partition

This blog post contains my notes for advanced users (Mac OS software developers and IT staff), not end-users.

Starting with Mac OS X El Capitan (10.11), some low-level system operations, like setting the NVRAM, are restricted by default by System Integrity Protection (SIP), which is controlled by the csrutil command.

However, the csrutil disable (or enable) command can only be run in a terminal after booting into a recovery OS partition (officially) or an installer (works for me, see below.)

Machines with a cloned OS often don’t have a recovery partition, or if they do, it doesn’t show up in the Startup Manager interfaces.

Even when there is a hidden recovery OS partition, versions of software starting with El Capitan have removed the Disk Util menu option to enable the recovery OS partition with Debug (apparently to hide the EFI partitions) when hidden. (Leave a note if you’ve used an older version of Diskutil to enable it. 🙂 )

You have 5 options of varying difficulty to choose from if you don’t want to do a full re-install of Mac OS X:

1) not that ez – install (ie. fix) your recovery partition, as recommended in most Internet How-to’s. Good luck, since most of the How to’s are incoherent. A suggestion would be to find one that talks only about one OS, preferably yours, instead of 4 or 5 versions.
2) ez – boot into a USB Mac OS El Capitan (or higher) installer, but don’t install. Just open the OS X Utilities ... Terminal menu and try csrutil disable. This worked for me, but if not, #5 below also worked for me.
3) didn’t try – install the recover partition to an external drive. My understanding is that this is intended for the Mac mini. Supposed to be ez.
4) didn’t try – try booting into a Lion installer and use the old Diskutil with debug mode to enable the hidden recovery HD partition. If you want to try that, boot into a Lion installer then open Terminal and type the following command, then open Diskutil last:

$ defaults write com.apple.DiskUtility DUDebugMenuEnabled 1​

5) super ez – boot into a USB installer, use Utilities … Diskutil … resize your original drive for a new 25 GB OS partition and install to it. Since you’re doing a fresh install, a recovery hd partition will be automatically created. boot into that with Option+R and run csrutil disable and reboot again to activate. This sounds kind of round-about, but is really easy, idiot-proof, and worked for me.

You’ll end up with something like this:

$ diskutil list
/dev/disk0 (internal, physical):
#:                  TYPE NAME         SIZE     IDENTIFIER
0: GUID_partition_scheme             *500.1 GB disk0
1:                   EFI EFI          209.7 MB disk0s1
2:             Apple_HFS HardDisk     474.6 GB disk0s2
3:            Apple_Boot Recovery HD  650.0 MB disk0s3 # can't see
4:             Apple_HFS Untitled      24.0 GB disk0s4
5:            Apple_Boot Recovery HD  650.0 MB disk0s5 # from option #5
$ csrutil disable
Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.
$ csrutil status
System Integrity Protection status: disabled.

Of course, when you’re done, run csrutil enable because that’s the default, and it protects the NVRAM from malware.

Terminology: “recovery OS partition” and “recovery HD partition” refer to the same thing, but the first is conceptual and the second is an actual disk partition intended for recovery and contains the recovery OS.

Also “Disk Util” is the Mac OS app, “Diskutil” is the on-boot menu option and “diskutil” is the CLI program. Again, the names vary but they all do the same thing, but available in different environments.

developer.apple.com: Configuring System Integrity Protection
W: System Integrity Protection

Posted in Tech | Leave a comment