Skip to content

Instantly share code, notes, and snippets.

View ahogen's full-sized avatar

Alex H ahogen

View GitHub Profile
@ahogen
ahogen / build-sys-img.jl
Created November 14, 2017 17:21
Build system-specific Julia image
# From: #7 http://www.stochasticlifestyle.com/7-julia-gotchas-handle/
Pkg.update()
if is_windows()
Pkg.add("WinRPM");
using WinRPM
WinRPM.install("gcc", yes=true)
WinRPM.install("winpthreads-devel", yes=true)
end

CHOCOLATE CHIP COOKIES

From back of Ambrosia Semi Sweet Chocolate Chip bag, which used to be sold at Costco. Translated from a blurry image on Pinterest to this text file by Alex Hogen.

INGREDIENTS:

Amount Ingredient
1 cup Butter
3/4 packed Brown sugar
#!/usr/bin/env python3
"""
The idea here is to have one demo of each common argparse format
type. This is useful for me to be able to copy/paste into a new
script and have something to quickly edit and trim down to get
the functionality I need.
Expect this file to grow/change as I need new options.
This is, however, a working example. I hate examples that don't
@ahogen
ahogen / wireshark-avb-capture.md
Created September 5, 2017 21:20
Commands to start Wireshark captures for AVB packets

Simple AVDECC (1722.1) only capture on selected interface.

tshark -f "ether proto 0x22f0" -i "AVB NIC" -w outfile.pcap
#!/bin/bash
###############################################################################
# File: pull_all_git_branches.sh
# Author: Alex Hogen (@ahogen on Github)
#
# Iterate through all cloned git repositories in this directory and update
# (pull) all their branches to sync with their remote counterparts.
#
# In diagram below, if this script is executed from <this dir>, then all repositories
#!/bin/bash
###############################################################################
# Installs "libftdi" and its dependancies for Ubuntu 12.04/14.0.4 variants of
# Linux.
#
# This is just a copy of the Adafruit script in their tutorial. Go check them
# out over here:
# https://learn.adafruit.com/adafruit-ft232h-breakout/linux-setup
###############################################################################
@ahogen
ahogen / julia_busy_dots.jl
Last active November 12, 2017 02:27
Julia busy indicator with ADCII dots
###############################################################################
# File: julia_busy_dots.jl
# Author: Alex Hogen (@ahogen on Github)
#
# Print a little busy/waiting indicator to the screen.
#
# Start:
# $ julia julia_busy_dots.jl
# Stop:
# $ Ctrl+C

Just wanted to make a note that I'm running Linux Mint 18.1 (Mate desktop) in VirtualBox with xTIMEcomposer 14.3.0 and I was able to get the xTAG drivers working by simply running the provided driver install script. My Google searches only turned up results like the "Enable USB drivers on Linux" article, which is old. The solution listed there by XMOS does probably work for xTAG 2 devices, however, all of the new xTAG devices from XMOS are not shown in that tutorial, but are included in the new distrobution of xTIMEcomposer. For that reason, and the fact that it's probably just a better idea to use the tools that come with

@ahogen
ahogen / julia_async_tasks_semaphore_demo.jl
Last active August 2, 2017 21:21
A [Julia](https://julialang.org/) script, demonstrating the use of a semaphore to protect asyncronous data accesses.
###############################################################################
# File: julia_async_tasks_semaphore_demo.jl
# Author: Alex Hogen (@ahogen on Github)
#
# This is a demo script I made for myself just to see how Julia's
# syntax for semaphores looks. This script is a basic demonstration
# of a producer and consumer task using a semaphore to protect the
# code sections where the global data variable is accessed.
#
# I built and ran this script with Julia 0.6.0.