Skip to content

Instantly share code, notes, and snippets.

View ndoo's full-sized avatar

Andrew Yong ndoo

View GitHub Profile
sudo sed -i 's+^#baseurl+baseurl+g' /etc/yum.repos.d/fedora*.repo
sudo sed -i 's+^metalink+#metalink+g' /etc/yum.repos.d/fedora*.repo
sudo sed -i 's/download.example\/pub/mirror.0x.sg/g' /etc/yum.repos.d/fedora*.repo
@ndoo
ndoo / Hanover 32x32 Dot Board Fault Repair.md
Last active January 27, 2021 17:48
Hanover 32x32 Dot Board Fault Repair

Hanover 32x32 Dot Board Fault Repair

Applicable only to PCB 7320-20-01 Issue C!

Single Dot Fault or Simultaneous Row and Column Fault

Note on simultaneous row and column fault

@ndoo
ndoo / sp_wholesale_rate.py
Created June 9, 2020 16:22
Quick and dirty script to compute half-hourly kWh pricing on SP Wholesale
import urllib.request, json, re
with urllib.request.urlopen("https://www.emcsg.com/chartserver/blue/ticker") as url:
data = json.loads(url.read().decode())
for section in data["Sections"]:
if section["Name"] == "Energy":
for sectiondata in section["SectionData"]:
if sectiondata["Label"] == "USEP":
usepkwh = float(re.search("\d+.\d+", sectiondata["Value"]).group()) / 1000
@ndoo
ndoo / 99-logitech-c920.rules
Last active February 6, 2021 15:11
udev Rules for Logitech C920 Fixed Focus on Prusa MK3S Z-axis Mount
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTRS{product}=="HD Pro Webcam C920", RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=exposure_auto_priority=0"
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTRS{product}=="HD Pro Webcam C920", RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=focus_auto=0"
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTRS{product}=="HD Pro Webcam C920", RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=focus_absolute=45"
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTRS{product}=="HD Pro Webcam C920", RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=sharpness=160"
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTRS{product}=="HD Pro Webcam C920", RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=saturation=176"
@ndoo
ndoo / AFI-R Boot Log.txt
Last active January 25, 2020 18:29
AFI-R Boot Log
ath>
ath> ?
? - alias for 'help'
base - print or set address offset
boot - boot default, i.e., run 'bootcmd'
bootd - boot default, i.e., run 'bootcmd'
bootm - boot application image from memory
bootp - boot image via network using BootP/TFTP protocol
chpart - change active partition
cmp - memory compare
running for 11285 seconds, 4418 records processed: 0.39 req/sec
Summary:
| count | avg_bytes_sent | 2xx | 3xx | 4xx | 5xx |
|---------+------------------+-------+-------+-------+-------|
| 4418 | 798759.944 | 3961 | 263 | 194 | 0 |
Detailed:
| request_path | count | avg_bytes_sent | 2xx | 3xx | 4xx | 5xx |
|------------------------------------------------------------------------------------------------------------------------------+---------+------------------+-------+-------+-------+-------|
@ndoo
ndoo / ccr1009.rsc
Created March 6, 2015 06:26
CCR1009-1S-1S+ PCC WAN, Teamed LAN Configuration Script
/interface bridge
add name=bridge1
/interface ethernet
set [ find default-name=ether1 ]
set [ find default-name=ether2 ] master-port=ether1
set [ find default-name=ether3 ] master-port=ether1
set [ find default-name=ether4 ] master-port=ether1
set [ find default-name=ether7 ] comment="Zhone GE3"
set [ find default-name=ether8 ] comment="Zhone GE4"
/interface bonding
[andrew@cube2 9481694]$ export LD_LIBRARY_PATH="/opt/fsl/lib:/usr/lib"
[andrew@cube2 9481694]$ export LDFLAGS
[andrew@cube2 9481694]$ makepkg
==> Making package: xf86-video-imx-viv 3.10.17_1.0.0_beta-2 (Sat Mar 15 04:22:00 SGT 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found xserver-xorg-video-imx-viv-3.10.17-1.0.0_beta.tar.gz
-> Found 90-vivante.conf
-> Found fix-hdmi-preferred-mode.patch