Skip to content

Instantly share code, notes, and snippets.

View flit's full-sized avatar

Chris Reed flit

View GitHub Profile
@flit
flit / readme.md
Created January 20, 2021 17:46
The Most Thoroughly Commented Linker Script in The World
@flit
flit / mcu_unique_id_survey.md
Last active March 5, 2024 08:42
Survey of Arm Cortex-M MCU unique ID support

MCU Unique ID Survey

Having a vendor-programmed unique device ID in microcontrollers is a requirement for numerous use cases. These including firmware update, many security uses, wired and wireless networking, and so on.

This survey attempts to document unique ID capabilities in a number of common (mostly) Arm Cortex-M device families.

@flit
flit / microtime.c
Last active May 8, 2020 17:38
Get the current time in microseconds in C.
#include <sys/time.h>
/**
* Returns the current time in microseconds.
*/
long get_microseconds(){
struct timeval currentTime;
gettimeofday(&currentTime, NULL);
return currentTime.tv_sec * (int)1e6 + currentTime.tv_usec;
}
@flit
flit / disable_mdm.txt
Created March 6, 2020 17:59
Disabling macOS MDM notification on Catalina 10.15
# Restart into recovery
csrutil disable
# Restart into normal user mode
sudo mount -uw /
sudo mkdir /System/Library/LaunchAgentsDisabled
sudo mkdir /System/Library/LaunchDaemonsDisabled
sudo mv /System/Library/LaunchAgents/com.apple.ManagedClientAgent.agent.plist /System/Library/LaunchAgentsDisabled
sudo mv /System/Library/LaunchAgents/com.apple.ManagedClientAgent.enrollagent.plist /System/Library/LaunchAgentsDisabled
sudo mv /System/Library/LaunchDaemons/com.apple.ManagedClient.cloudconfigurationd.plist /System/Library/LaunchDaemonsDisabled
sudo mv /System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist /System/Library/LaunchDaemonsDisabled
@flit
flit / bash.plist
Created October 27, 2018 21:26
Shell script BBEdit codeless language module
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMColorsSyntax</key>
<true/>
<key>BBLMIsCaseSensitive</key>
@flit
flit / eRPC_IDL.plist
Created October 27, 2018 21:25
BBEdit codeless language module for eRPC IDL
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMColorsSyntax</key>
<true/>
<key>BBLMIsCaseSensitive</key>
@flit
flit / GnuLinkerScriptCLM.plist
Last active October 27, 2018 21:24
BBEdit codeless language module for gcc linker scripts
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMColorsSyntax</key>
<true/>
<key>BBLMIsCaseSensitive</key>
@flit
flit / WindowsBatchFile.plist
Created October 27, 2018 21:22
Windows batch file codeless language module for BBEdit
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMColorsSyntax</key>
<true/>
<key>BBLMIsCaseSensitive</key>
@flit
flit / setup-vmware-image-with-static-IP.markdown
Last active October 10, 2018 19:59 — forked from pjkelly/setup-vmware-image-with-static-IP.markdown
VMWare Fusion 10 images with a static IP Address on macOS

How to setup your VMWare Fusion images to use static IP addresses on Mac OS X

Using a static IP address makes it a hell of a lot easier to ssh into your vm.

1. Determine the MAC address of your guest machine

Let's say you have a guest machine with the name foobar and you keep your guest machine images in ~/Documents/Virtual\ Machines/. To determine the MAC address for this VM, you can run:

cat ~/Documents/Virtual\ Machines/foobar.vmwarevm/foobar.vmx | grep ethernet0.generatedAddress