Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Hogen ahogen

  • United States
View GitHub Profile
@ahogen
ahogen / get-gcc-arm-none-eabi.py
Last active Oct 30, 2019
Download latest GNU GCC compiler from ARM's website (for Cortex-M and Cortex-R processors).
View get-gcc-arm-none-eabi.py
#!/usr/bin/env python3
"""Download latest GNU Toolchain from ARM's website
Author: Alex Hogen (code.ahogen@outlook.com)
MIT License
Copyright (c) 2019 Alexander Hogen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ahogen
ahogen / inject_crc32_lpc_boot_block.gdb
Last active Jun 10, 2019
Compute a CRC32 of an ELF image and insert it into the
View inject_crc32_lpc_boot_block.gdb
###############################################################################
# Date: 2019-06-06
# Author: Alexander Hogen
# code.ahogen@outlook.com
# https://github.com/ahogen
#
# !! NOTE: This is currently just a scratchpad for my work. THIS IS NOT DONE YET!
#
# The NXP LPC(546xx) microcontroller's bootloader supports verifying the
# image by checking a CRC32 value before starting to execute it. This
View anybadge_vs_shieldsio.py
#!/usr/env python3
"""
Alex Hogen (code.ahogen@outlook.com)
Compare Anybadge to Sheilds.io SVG badges.
"""
import os
import sys
import shutil
@ahogen
ahogen / pylint-exit-handler.sh
Created Nov 9, 2018
Parse and filter PyLint exit codes. Useful for Gitlab CI, Jenkins, or other continuous integration scripting which uses PyLint for Python.
View pylint-exit-handler.sh
#!/bin/bash
################################################################################
# Alex Hogen (code.ahogen@outlook.com)
# https://github.com/ahogen
#
# A basic script to inspect the return code from pylint, filter it based on our
# needs, and return with a non-zero exit code when appropriate.
#
# PyLint returns non-zero exit codes for things that aren't errors. For example,
# if a warning message was issued, 0x4 is OR'd into the exit code.
@ahogen
ahogen / usb-rescan-print.sh
Created Jul 25, 2018
Automatically scan and print dev list when USB device added or removed.
View usb-rescan-print.sh
#!/bin/bash
###############################################################################
# Author: Alex Hogen <code.ahogen@outlook.com>
# https://github.com/ahogen
# Date Created: 2018-07-19
#
# Copyright (c) 2018, Alexander Hogen.
#
# Usage:
@ahogen
ahogen / win-hostnames-on-linux.md
Created Jul 12, 2018
How to enable Linux machines to resolve Windows hostnames
View win-hostnames-on-linux.md
View state-machine-gptp-port-role-selection.md

PlantUML Graph [link]

@startuml
INIT_BRIDGE : updateRoleDisabledTree()

ROLE_SELECTION : clearReselectTree()
ROLE_SELECTION : updateRolesTree()
ROLE_SELECTION : setSelectedTree()
View install_icarus_verilog.sh
#!/bin/bash
#####################################################################
# Download and install Icarus Verilog 10.2 on a Debian-based system.
# I wrote and executed this script on Linux Mint 18.3, which is based
# on Ubuntu 16.4.
#
# Author: Alex Hogen <https://github.com/ahogen>
# Created: 2017-12-12
#####################################################################
View spipe.sh
#!/bin/bash
#####################################################################
# Alex Hogen (https://github.com/ahogen)
#
# Run the command provided, redirecting STDERR to STDOUT, effectivly
# reducing all output to a single output pipe, hence the name "spipe".
# This script is also capable of capturing some common kill codes
# and forwarding them to the child process.
#
@ahogen
ahogen / julia-install-pyplot-windows.jl
Last active Jan 24, 2018
Install and setup Plots with PyPlot backend using system Python in for Julia. Then builds system-specific Julia image for faster performance in the future.
View julia-install-pyplot-windows.jl
# Note: Both Julia and Python must be of the same architecture type. If Julia
# is 64-bit, so must your Python distribution.
#
# I tested this with a clean Julia install, by installing Julia and
# deleting "C:\Users\<username>\.julia".
#
# Julia: v6.1
# Python: v3.6.3 for Windows
#