Craig Thrall

Page 1 of 13 | Next

Apply Commit from Other Repo in Git

Dec. 9, 2022, 10:19 a.m.

Yes, it is possible to cherry pick a commit from another repo in Git. You can use Git to format a patch from the commit in the source repo and merge it into the destination repo by running this command in the directory containing the destination repo: git --git-dir=../<some_other_repo>/.git format-patch -k -1 --stdout <commit SHA> | git am -3 -k Stack Overflow article: https://stackoverflow.com/questions/5120038/is-it-possible-to-cherry-pick-a-commit-from-another-git-repository

How to Pretty Print JSON (and handle non-serializable types)

Jan. 4, 2021, 2:31 p.m.

Use json.dumps(obj, indent=4, default=str) to pretty print (indent), and render non-serializable content by calling str() (default).

GitHub SSH Keys

Dec. 29, 2020, 11:41 p.m.

When you browse to "Settings...SSH and GPG keys" in GitHub, you'll see a list of key names, and the hex MD5 of the fingerprint for the public key. To view the fingerprint for a local public key in the same format, run "ssh-keygen -l -E md5 -f <public_key.pub>".

XCode Command Line Tools and Python

Sept. 21, 2020, 10:58 a.m.

Installing the XCode command-line tools broke my virtualenvwrapper installation. The virtualenvwrapper script was running the Python 3 binary in the command-line tools, instead of the binary I had configured by setting VIRTUALENVWRAPPER_PYTHON. I'm still not sure how that binary is used, since that location is not referenced by any of my environment. I got virtualenvwrapper working again by running sudo xcrun pip3 install virtualenv and sudo xcrun pip3 install virtualenvwrapper to install those two packages in the Python 3 binary in the command-line tools directory.

Python on Mac OS

Aug. 15, 2020, 10:10 a.m.

brew install pyenv sudo pip3 install virtualenvwrapper pyenv install 3.8.5

Mac OS Power Optimizations

May 18, 2020, 10:28 a.m.

Don't run Docker all the time (9.5 average energy impact). Switch from the official Slack and Discord clients to Ripcord (5-10 average energy impact each). Don't send video in Microsoft Teams. Optionally turn off incoming video in Teams.

MySQL Client on Mac OS

April 9, 2020, 9:59 p.m.

First, run brew install [email protected] to install the MySQL 5.7 client, which includes the mysql command you are used to. Then, run export PATH=$PATH:/usr/local/opt/mysql-client\@5.7/bin to add the executables from the newly installed package to your path.

Windows 10 Power Management and Connected Standby

Dec. 14, 2016, 7:02 p.m.

We've been piloting the Microsoft Surface Book, which runs Windows 10. By default, these devices are running Microsoft's Connected Standby feature for power management. Connected Standby allows devices to remain running at a reduced power level while sleeping and still process data. The tradeoff is you lose advanced power management features, such as the ability to configure the wifi adapter to always maximize power. I also believe I've found an issue with either the way Connected Standby manages wifi adapter power, or the Cisco AnyConnect VPN client's ability to handle the wifi adapter going up and down. We ran into an issue where multiple versions where the Cisco VPN client will think it is connected, but the device will not be able to connect to any internal or external computers, including the VPN gateway. We resolved this issue by making the following changes: * Disabled "Connected Standby" by setting HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power to 0 in the registry, and rebooting the Surface device. * Open "Device Manager" and browse to the Marvell wifi adapter properties. You'll now find an additional tab named "Power Management." * Uncheck "Allow the computer to turn off this device to save power."

usbip

Feb. 29, 2016, 5:49 p.m.

To get usbip to run on Ubuntu 14.04, use the script found here: https://launchpadlibrarian.net/106481975/make-usbip-userspace.sh

bokeh, matplotlib, and twinx

Feb. 9, 2016, 11:53 p.m.

The best way to have multiple Y ranges on a plot, and use Bokeh, is to not use matplotlib. The library that Bokeh uses does not translate the multiple ranges correctly. I found others with this issue. What worked for me is to skip matplotlib (I was lucky, this is new code), and "extra_y_ranges" to add additional Y ranges to my plot.