Skip to content

Instantly share code, notes, and snippets.

View zultron's full-sized avatar

John Morris zultron

View GitHub Profile
modified build.sh
@@ -110,10 +110,10 @@ case $1 in
"install")
echo "install"
fname=/media/$USER/BPI-BOOT/bananapi/bpi-r2/linux/uImage_${kernver}-main
- if [ -e $fname ];then
- cp $fname $fname.bak
- fi
- cp uImage $fname
+ # if [ -e $fname ];then
@zultron
zultron / bootlog.txt
Last active July 30, 2020 11:50
BPi-R2 boot log and dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.189-bpi-r2-main (jman@bpi-r2) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP Wed Jul 29 18:50:53 UTC 2020
[ 0.000000] CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Bananapi BPI-R2
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] [WMT-CONSYS-HW][W]reserve_memory_consys_fn: name: consys-reserve-memory, base: 0xffe00000, size: 0x100000
[ 0.000000] OF: reserved mem: initialized node consys-reserve-memory, compatible id mediatek,consys-reserve-memory
[ 0.000000] cma: Reserved 64 MiB at 0xfb800000
@zultron
zultron / low_latency.c
Created July 3, 2019 18:20
Disable CPU idle states using PM QoS framework
// Disable CPU idle states using PM QoS framework
//
// Directly related:
// https://github.com/torvalds/linux/blob/master/Documentation/power/pm_qos_interface.txt
// https://lwn.net/Articles/465195/
// https://access.redhat.com/articles/65410
//
// Network:
// https://elinux.org/images/f/f9/Elc2008_pm_qos_slides.pdf
//
@zultron
zultron / entrypoint.sh
Created February 4, 2019 02:25
Docker entrypoint script to edit `/etc/hosts` and `/etc/passwd` at container init time
#!/bin/bash -e
# add hostname to hosts
sh -c 'echo "127.0.2.1 `hostname`" >> /etc/hosts'
# Start rsyslog for MK logging
service rsyslog start
# Add user and group to system
echo "${USER}:x:${UID}:${GID}::${HOME}:/bin/bash" >>/etc/passwd
@zultron
zultron / ipareplica-install.log
Created July 24, 2017 21:13
freeipa logs: hang at `[29/44]: setting up initial replication`; 2017-07-24 #2
2017-07-24T21:06:31Z DEBUG Logging to /var/log/ipareplica-install.log
2017-07-24T21:06:31Z DEBUG ipa-replica-install was invoked with arguments [] and options: {'no_dns_sshfp': None, 'skip_schema_check': None, 'setup_kra': None, 'ip_addresses': None, 'mkhomedir': None, 'http_cert_files': None, 'ssh_trust_dns': None, 'reverse_zones': None, 'no_forwarders': True, 'keytab': None, 'no_ntp': True, 'domain_name': 'example.com', 'http_cert_name': None, 'dirsrv_cert_files': None, 'no_dnssec_validation': None, 'no_reverse': None, 'unattended': True, 'auto_reverse': True, 'auto_forwarders': None, 'no_host_dns': True, 'no_sshd': None, 'no_ui_redirect': True, 'dirsrv_config_file': None, 'forwarders': None, 'verbose': False, 'setup_ca': True, 'realm_name': 'EXAMPLE.COM', 'skip_conncheck': True, 'no_ssh': None, 'forward_policy': None, 'dirsrv_cert_name': None, 'quiet': False, 'server': 'h01.example.com', 'setup_dns': True, 'host_name': 'h11.example.com', 'log_file': None, 'allow_zone_overlap': True}
2017-07-24T21:06:31Z DE
@zultron
zultron / ipa-server-configure-first.log
Created July 24, 2017 17:50
freeipa logs: fail at `[29/44]: setting up initial replication`; 2017-07-24
Configuring client side components
Warning: skipping DNS resolution of host h11.example.com
Warning: skipping DNS resolution of host h01.example.com
Configuring directory server (dirsrv). Estimated time: 1 minute
[1/44]: creating directory server user
[2/44]: creating directory server instance
[3/44]: updating configuration in dse.ldif
[4/44]: restarting directory server
#!/usr/bin/python
import hal, time
h = hal.component("tr1openclose")
h.newpin("open_close", hal.HAL_BIT, hal.HAL_IN)
h.newpin("rev_prox", hal.HAL_BIT, hal.HAL_IN)
h.newpin("fwd_prox", hal.HAL_BIT, hal.HAL_IN)
h.newpin("ev_fwd", hal.HAL_BIT, hal.HAL_OUT)
h.newpin("ev_rev", hal.HAL_BIT, hal.HAL_OUT)
h.ready()
try:
@zultron
zultron / Machinekit_DA_repo_update_tests_0_intro.md
Last active December 13, 2015 05:06
@zultron's Dovetail Automata repo update tests

Machinekit: Simulate and test new DA package repo upgrades

This procedure simulates the Machinekit package upgrade flow when the deb.dovetail-automata.com APT repository is switched from the old to the new. The goal is a smooth upgrade with no changes to existing APT configurations.

See below for step-by-step instructions:

  • [x86][1]
  • [Beaglebone][2]
@zultron
zultron / gist:d8230d1ce18e7d3df44d
Last active August 29, 2015 14:14
arm-linux-gnueabihf-gcc-4.8 cross-build

Trusty x86_64, building Machinekit armhf as foreign arch, in Docker container.

Doesn't complete ./configure yet, and the package list might be hard to reproduce.

root@3f6f68866cb6:/usr/src/machinekit/src# ./autogen.sh && CC=arm-linux-gnueabihf-gcc-4.8 CXX=arm-linux-gnueabihf-g++-4.8 ./configure --with-platform-beaglebone --host=arm-linux-gnueabihf --with-xenomai --disable-gtk --without-libusb-1.0
 --host=arm-linux-gnueabihf --with-xenomai --disable-gtk --without-libusb-1.0
checking if cython is usable... checking for cython... no
@zultron
zultron / mealy-coroutine.py
Last active October 2, 2016 12:58
Mealy FSM implemented with Python coroutines in a ZMQ IOLoop
#!/usr/bin/python
'''
Copyright (c) 2014 John Morris <john@zultron.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: