Skip to content

Instantly share code, notes, and snippets.

@JamesHagerman
JamesHagerman / .bashrc-modifications
Created December 6, 2016 19:46
LDAP/AD oh-my-zsh init and colors setup
# My edits:
alias ip='ip -c'
# Set some colors up:
# Oops! We have moved on to dconf:
echo "setting FUNK colors"
# This should be "Default"
profile_id=b1dcc9dd-5262-4d8d-a863-c897e6d979b9
#profile_id=$(gsettings get org.gnome.Terminal.ProfilesList default)
dconf write /org/gnome/terminal/legacy/profiles:/:$profile_id/bold-color-same-as-fg "true"
@JamesHagerman
JamesHagerman / skull.zsh-theme
Created December 6, 2016 19:45
A slight modification of the cloud theme
if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
ZSH_THEME_CLOUD_PREFIX='☠'
fi
PROMPT='%{$fg_bold[yellow]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
@JamesHagerman
JamesHagerman / setTermColors.sh
Last active November 22, 2016 09:18
Just the script I use to set colors on the gnome-terminal
#!/bin/bash
#gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_theme_background --type bool false
#gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_theme_colors --type bool false
#gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/background_color '#41414d4d3d3d'
#gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/foreground_color '#d3d3cfcfcdcd'
#echo 'setting funk colors'
#gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/palette '#3c3c2d2d2626:#f7f700007c7c:#7c7cf7f70000:#f7f77c7c0000:#00007c7cf7f7:#7c7c0000f7f7:#0000f7f77c7c:#b6b6a7a79f9f:#7c7c6d6d6565:#ffff5454a9a9:#a9a9ffff5454:#ffffa9a95454:#5454a9a9ffff:#a9a95454ffff:#5454ffffa9a9:#f4f4e5e5dddd'
# Oops! We have moved on to dconf:

How to get firmware onto mutable modules

I had the best luck with the Black Magic Probe and gdb.

Install compiler

First install the arm compiler:

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
@JamesHagerman
JamesHagerman / CMakeLists.txt
Created October 4, 2016 07:43 — forked from eugene-babichenko/CMakeLists.txt
CMakeLists.txt and toolchain file for building STM32 HAL-based projects generated with STM32CubeMX with arm-none-eabi-gcc. STM32CubeMX settings. Toolchain: SW4STM32. ☑ Generate under root.
set(PRJ_NAME CLion_STM_LED)
set(MCU_FAMILY STM32F1xx)
set(MCU_LINE STM32F103xB)
set(MCU_LINKER_SCRIPT STM32F103RBTx_FLASH.ld)
cmake_minimum_required(VERSION 3.6)
project(${PRJ_NAME} C ASM)
add_definitions(-D${MCU_LINE})
@JamesHagerman
JamesHagerman / dump.txt
Created August 17, 2016 05:18
another dump
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.102-b14 mixed mode):
"Thread-2" #23 prio=5 os_prio=0 tid=0x00007f21001c1000 nid=0x1457 in Object.wait() [0x00007f21050ca000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at com.sun.media.sound.DirectAudioDevice$DirectDL.write(DirectAudioDevice.java:771)
- locked <0x00000000d8f26790> (a java.lang.Object)
at ddf.minim.javasound.JSAudioOutput.run(JSAudioOutput.java:91)
"Java Sound Event Dispatcher" #21 daemon prio=5 os_prio=0 tid=0x00007f21001a7000 nid=0x1451 in Object.wait() [0x00007f21059cc000]
@JamesHagerman
JamesHagerman / dump.txt
Created August 17, 2016 05:09
sensatron dump
sensatron@sensatron-desktop:~/dev/Sensatron/2016/sensatron-server$ mvn jetty:run
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.pnf:sensatron-server:war:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for org.pnf:TotalControl:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/TotalControl.jar will be unresolvable by dependent projects @ line 57, column 18
[WARNING] 'dependencies.dependency.systemPath' for ddf.minim:minim:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/minim.jar will be unresolvable by dependent projects @ line 64, column 18
[WARNING] 'dependencies.dependency.systemPath' for ddf.minim:jsminim:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/jsminim.jar will be unresolvable by dependent projects @ line 71, column 18
[WARNING]
[WARNING] It is highly recommend
console.log('%c +++ app got config +++ ', 'font-size: 18px; color: rgb(0,128,0)');
@JamesHagerman
JamesHagerman / noflo-list-components.js
Last active April 21, 2016 00:31 — forked from jonnor/noflo-list-components.js
NoFlo list components and metadata
var rootdir = './';
var loader = new noflo.ComponentLoader(rootdir);
loader.listComponents(function() {
console.log(loader.components);
Object.keys(loader.components).forEach(function(name) {
loader.load(name, function(derp, component) {
console.log(name);
console.log(component.description);
@JamesHagerman
JamesHagerman / Noflow-app-and-runtime.md
Last active April 8, 2016 22:09
Setting up noflo webapp and runtime

Noflo with a front end UI component builder

You'll need two repos running for this to work. The webapp, and the noflo runtime.

And you'll need to do some wonky config as well...

NOTE: To complete this, you'll need access to GitHub for some reason! Otherwise
you will not be able to log in to the web app and manually add your runtime's