Skip to content

Instantly share code, notes, and snippets.

View ahogen's full-sized avatar

Alex H ahogen

View GitHub Profile
@ahogen
ahogen / get-gcc-arm-none-eabi.py
Last active October 30, 2019 19:23
Download latest GNU GCC compiler from ARM's website (for Cortex-M and Cortex-R processors).
#!/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 June 10, 2019 23:15
Compute a CRC32 of an ELF image and insert it into the
###############################################################################
# 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
#!/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 November 9, 2018 17:27
Parse and filter PyLint exit codes. Useful for Gitlab CI, Jenkins, or other continuous integration scripting which uses PyLint for Python.
#!/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 July 25, 2018 05:54
Automatically scan and print dev list when USB device added or removed.
#!/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 July 12, 2018 17:56
How to enable Linux machines to resolve Windows hostnames

PlantUML Graph [link]

@startuml
INIT_BRIDGE : updateRoleDisabledTree()

ROLE_SELECTION : clearReselectTree()
ROLE_SELECTION : updateRolesTree()
ROLE_SELECTION : setSelectedTree()
#!/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
#####################################################################
#!/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 January 24, 2018 20:32
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.
# 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
#