Craig Thrall

Page 1 of 13 | Next

Edit Text File in Archive

June 4, 2024, 1:29 p.m.

Do you need to edit a text file in an archive (ZIP , etc.)? You can edit a file in place using Emacs by opening the archive file. Emacs will show you a listing of the contents of the archive using a view similar to the directory view you get when you open a directory in Emacs. Select the file to open it. Saving the file will update the archive.

Rotate Video using ffmpeg

April 30, 2024, 9:22 p.m.

ffmpeg -i input.mp4 -vf "rotate=12*PI/180:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none" output.mp4 If you get the error "width not divisible by 2," add one to ow in the filter formula above.

Get Commandline for Windows Process

April 12, 2024, 2:32 p.m.

Get-WmiObject Win32_Process -Filter "name = 'java.exe'" | Select-Object CommandLine

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.