Skip to content

Instantly share code, notes, and snippets.

View flit's full-sized avatar

Chris Reed flit

View GitHub Profile
@elfmimi
elfmimi / nuvoton.py
Last active May 27, 2023 14:00
pyOCD user script for Nuvoton ARM MCUs
# How to invoke:
# pyocd cmd --script nuvoton.py -c "ident"
# pyocd cmd --script nuvoton.py -c "read_config_regs"
# pyocd cmd --script nuvoton.py -c "write_config_regs 0xFFFFFFFF 0xFFFFFFFF"
# pyocd cmd --script nuvoton.py -c "chip_erase"
#
# and for the commander prompt, invoke it like this:
# pyocd cmd --script nuvoton.py
from pyocd.core.exceptions import TransferFaultError, TransferTimeoutError
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@paul-krohn
paul-krohn / docker_x11_macOS.md
Last active March 23, 2024 09:30
Docker X11 macOS

Preamble

There is a longstanding issue/missing feature/bug with sockets on Docker on macOS; it may never work; you'll need to use a network connection between Docker containers and X11 on macOS for the foreseeable future.

I started from this gist and made some adjustments:

  • the volume mappings aren't relevant/used, due to the socket issue above.
  • this method only allows X11 connections from your Mac, not the entire local network, which would include everyone on the café/airport WiFi.
  • updated to include using the host.docker.internal name for the the container host, instead.
  • you have to restart XQuartz after the config change.
@geky
geky / newlib-pico.bash
Last active January 9, 2020 16:34
Build newlib-nano with -Os and -DPREFER_SIZE_OVER_SPEED (defaults to -O2)
#!/bin/bash
mkdir newlib-pico
PREFIX=$(pwd)/newlib-pico
cd newlib-pico
echo "Created $(pwd)"
git clone git://sourceware.org/git/newlib-cygwin.git newlib-source
cd newlib-source
echo "Created $(pwd)"
@aronskaya
aronskaya / FDA.md
Created July 7, 2019 18:24
Notes on File System Protection on macOS on 10.14.5 (Mojave)

List of paths, protected by Full Disk Access, on 10.14.5 (Mojave):

/.Spotlight-V100
/Library/Application Support/com.apple.TCC
~/Library/Application Support/MobileSync
~Library/Application Support/CallHistoryTransactions
~Library/Application Support/com.apple.TCC
~Library/Application Support/AddressBook
~Library/Application Support/CallHistoryDB
@OhMeadhbh
OhMeadhbh / 00_readme.txt
Last active June 17, 2024 12:30
Efficiently Calculating the Parity of a 32 Bit Integer
Read this file first.
Then read the comments at the top of parity_test.c
Then read the comments above each algorithm implementation in parity.c
So there I was talking about efficient implemetation of fundamental functions
with Palmer over at SiFive. Back in the day, I used to participate in informal
contests on rec.games.programmer to see who could craft the most efficient
implementations for population count or bit reversal or bit-blitting. For
programmer types, it's great fun.
@ErikAugust
ErikAugust / spectre.c
Last active May 22, 2024 23:07
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@vidavidorra
vidavidorra / auto-deploy_documentation.md
Last active June 5, 2024 19:20
Auto-deploying Doxygen documentation to gh-pages with Travis CI

Auto-deploying Doxygen documentation to gh-pages with Travis CI

This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages branch using Travis CI. This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.

Sign up for Travis CI and add your project

Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.

Create a clean gh-pages branch

To create a clean gh-pages branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th

; ___ _ __ ___ __ ___
; / __|_ _ __ _| |_____ / /| __|/ \_ )
; \__ \ ' \/ _` | / / -_) _ \__ \ () / /
; |___/_||_\__,_|_\_\___\___/___/\__/___|
; An annotated version of the snake example from Nick Morgan's 6502 assembly tutorial
; on http://skilldrick.github.io/easy6502/ that I created as an exercise for myself
; to learn a little bit about assembly. I **think** I understood everything, but I may
; also be completely wrong :-)
@L422Y
L422Y / osx_automount_nfs.md
Last active May 10, 2024 09:06
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service