Skip to content

Instantly share code, notes, and snippets.

View tycho's full-sized avatar

Steven Noonan tycho

  • Bellevue, WA, USA
View GitHub Profile
@tycho
tycho / hddtemp.py
Created November 4, 2020 08:10
simple implementation of hddtemp using smartctl and Python
#!/usr/bin/python3
#
# hddtemp server implemented with smartctl and Python
#
# Copyright (c) 2020 Steven Noonan
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
@tycho
tycho / 82574.patch
Last active March 9, 2024 17:55
bugfix for 82754 adapter emulation
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index d5676871fa..3e42e0edf5 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -677,7 +677,9 @@ e1000e_on_tx_done_update_stats(E1000ECore *core, struct NetTxPkt *tx_pkt)
e1000x_increase_size_stats(core->mac, PTCregs, tot_len);
e1000x_inc_reg_if_not_full(core->mac, TPT);
+ e1000x_inc_reg_if_not_full(core->mac, GPTC);
e1000x_grow_8reg_if_not_full(core->mac, TOTL, tot_len);
diff --git a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp
index 3a20c50..9836038 100644
--- a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp
+++ b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp
@@ -231,7 +231,7 @@ COMPILE_TIME_ASSERT( 2000000000000ll < k_nInitialTimestampMin );
COMPILE_TIME_ASSERT( k_nInitialTimestampMin < k_nInitialTimestamp );
static std::atomic<long long> s_usecTimeOffset( k_nInitialTimestamp );
-static volatile int s_nLowLevelSupportRefCount;
+static std::atomic<int> s_nLowLevelSupportRefCount(0);
@tycho
tycho / colortest.pl
Created September 26, 2019 04:33
color test for console emulators
#!/usr/bin/perl
# Author: Todd Larason <jtl@molehill.org>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
# first the system ones:
print "System colors:\n";
for ($color = 0; $color < 8; $color++) {
print "\x1b[48;5;${color}m ";
}
print "\x1b[0m\n";
@tycho
tycho / generate.py
Created March 11, 2019 14:23
Hatari config generator
#!/usr/bin/python
import copy
import os
import re
from pprint import pprint
def script_dir():
return os.path.dirname(os.path.realpath(__file__))
@tycho
tycho / lastpass-demangle.py
Last active February 19, 2021 22:45
Demangle the LastPass CSV export format
#!/usr/bin/python3
#
# Usage: ./lastpass-demangle.py lastpass-export.csv > fixed-lastpass-export.csv
#
import csv
import html
import fileinput
import sys
@tycho
tycho / angle.patch
Last active March 23, 2018 04:41
Windows 10 ARM64 - ANGLE build
This is my patch for building ANGLE on Windows 10 ARM64. It's not ready for upstream because it breaks
the x86/x86_64 builds -- this isn't out of necessity but rather expedience. I just wanted to get ANGLE
built for the platform quickly.
I did have to copy a bunch of blobs out of C:\Windows\WinSXS to fill some Windows SDK directories (which
aren't present in the actual Windows SDK for some reason):
C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\arm64
C:\Program Files (x86)\Windows Kits\10\Redist\D3D\arm64
@tycho
tycho / conemu-arm64-premake.patch
Last active March 22, 2018 23:19
WIP: ConEmu ARM64 target premake5.lua
diff --git a/premake5.lua b/premake5.lua
index a47c6ac35..bfee57b34 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -1,6 +1,6 @@
workspace "CE"
configurations { "Release", "Debug", "Remote" }
- platforms { "Win32", "x64" }
+ platforms { "Win32", "x64", "ARM64" }
-- Where *.vcxproj files would be placed
@tycho
tycho / python36-win-arm64.patch
Created March 22, 2018 18:23
Windows 10 ARM64 - Python 3.6
These are the deltas required for the python.props file to build for ARM64 on Windows. You still need to add
the ARM64 platform definitions to the solution/project files before you can build, though.
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 16a7672315..d865c86211 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -74,7 +74,8 @@
-->
<_RegistryVersion>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</_RegistryVersion>
@tycho
tycho / qt.patch
Last active October 19, 2023 12:36
Diff for Qt 5.10.1 for Windows 10 ARM64
This patch implements numerous changes to make the Qt 5.10.1 build work for the new ARM64 target in
Visual Studio 2017. This change also includes a couple of new batch scripts, in case you want to build
on the target machine itself (very slow) or build on an x86/x86_64 host (much faster).
You can build with something like this:
> configure_src_on_x86_host.bat
> jom -f Makefile Debug Release
diff --git a/configure_src_on_target.bat b/configure_src_on_target.bat
new file mode 100644