Skip to content

Instantly share code, notes, and snippets.

Avatar

Clarence "Sparr" Risher sparr

  • San Francisco, CA, USA
View GitHub Profile
@sparr
sparr / Xorg.0.log
Created Jan 4, 2021
computer hard lockup, usually in cpu/gpu intensive activities, this time while video editing
View Xorg.0.log
[ 4.659]
X.Org X Server 1.20.10
X Protocol Version 11, Revision 0
[ 4.659] Build Operating System: Linux Manjaro Linux
[ 4.659] Current Operating System: Linux shaggy 5.8.18-1-MANJARO #1 SMP PREEMPT Sun Nov 1 14:10:04 UTC 2020 x86_64
[ 4.659] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.8-x86_64 root=UUID=fd2098fb-01b7-4272-be32-a908fd3a2eb5 rw quiet resume=UUID=42821bc8-4cb6-4897-8e37-fad6b3492e9e udev.log_priority=3
[ 4.659] Build Date: 03 December 2020 08:59:12AM
[ 4.659]
[ 4.659] Current version of pixman: 0.40.0
[ 4.659] Before reporting problems, check http://wiki.x.org
@sparr
sparr / journalctl -xe
Created Nov 13, 2020
iwlwifi microcode error on arch linux on dell latitude 7390
View journalctl -xe
This is an excerpt showing approximately two cycles, it repeats indefinitely with minor differences as long as wifi is enabled.
Nov 13 07:37:02 shaggy kernel: iwlwifi 0000:02:00.0: Queue 3 is stuck 16 73
Nov 13 07:37:02 shaggy kernel: iwlwifi 0000:02:00.0: Microcode SW error detected. Restarting 0x0.
Nov 13 07:37:02 shaggy kernel: iwlwifi 0000:02:00.0: Start IWL Error Log Dump:
Nov 13 07:37:02 shaggy kernel: iwlwifi 0000:02:00.0: Status: 0x00000040, count: 6
Nov 13 07:37:02 shaggy kernel: iwlwifi 0000:02:00.0: Loaded firmware version: 55.d9698065.0 cc-a0-55.ucode
Nov 13 07:37:02 shaggy kernel: iwlwifi 0000:02:00.0: 0x00000084 | NMI_INTERRUPT_UNKNOWN
Nov 13 07:37:02 shaggy kernel: iwlwifi 0000:02:00.0: 0x000022F0 | trm_hw_status0
Nov 13 07:37:02 shaggy kernel: iwlwifi 0000:02:00.0: 0x00000000 | trm_hw_status1
@sparr
sparr / dice_to_card.pseudocode
Created May 2, 2020
Convert 3d6 to a playing card
View dice_to_card.pseudocode
# original idea and base logic from https://www.reddit.com/r/tinycode/comments/gap2jw/6bit_playing_card_deck/
dice_to_card(a,b,y) {
suits = {2:'H', 3:'C', 4:'D', 5:'S'}
if (y>1 and y<6) {
# number cards
rank = ceil(a/2) + (ceil(b/2)-1)*3
if rank==1 rank = 10
return rank, suits[y]
}
elif ((a==1 or a==6) and (b==1 or b==6)) {
@sparr
sparr / gist:25f14355a291ff1036f21856104a7bb9
Created Feb 14, 2020
Debugging early function exit with gdb
View gist:25f14355a291ff1036f21856104a7bb9
Breakpoint 11 at 0x5555557490ec: file ../src/app/commands/cmd_frame_tag_properties.cpp, line 100.
(gdb) c
Thread 1 "aseprite" hit Breakpoint 10, app::FrameTagPropertiesCommand::onExecute (this=<optimized out>, context=<optimized out>) at ../src/app/commands/cmd_frame_tag_properties.cpp:98
98 tx(new cmd::SetTagName(tag, name));
(gdb) list
93 Tx tx(writer.context(), friendlyName());
94 Tag* tag = const_cast<Tag*>(foundTag);
95
96 std::string name = window.nameValue();
97 if (tag->name() != name)
@sparr
sparr / gist:ae107533d427360d5cca26268378691e
Created Sep 10, 2019
reddit profile post silent failure
View gist:ae107533d427360d5cca26268378691e
Request URL: https://www.reddit.com/api/submit
Request Method: POST
Status Code: 200
Remote Address: 151.101.129.140:443
Referrer Policy: origin
accept-ranges: bytes
cache-control: private, s-maxage=0, max-age=0, must-revalidate, max-age=0, must-revalidate
content-length: 245
content-type: application/json; charset=UTF-8
date: Tue, 10 Sep 2019 19:23:52 GMT
View gist:a05391fe99f1fe3d5c7097637c101679
0eNqlne1umzkOhe/Fv5OFJOqzt7IYDNoZb9dAmgSOs5iiyL2v0zrdxVRvfPjoV9EmPeJLiRRFUkffdp/unvePx8P9affh2+7wx8P90+7DP7/tng6f7z/evf7b6evjfvdhdzjtv+xudvcfv7z+bf/X43H/9HR7On68f3p8OJ5uP+3vTruXm93h/s/9X7sP8eW3m93+/nQ4HfY/EL//5evv989fPu2P51+4hnWze3x4Ov/3h/tXKc6Qt7Hc7L6e/2znYf48HPd//Phhfrn5BT39gv58luv4+fhw/nMTP0/x682bDh6eT4/Pr1/5y3gGvsZ+jNavf03m6H/7ljRBLwA9TWWvE/T6C/rT493hdDr/bBu3/qP8Te7XhXXW/e/npfpwPOOf8Y6Hz/+eTkZDkx+vTP738WfDdaC/KOtvuPQXLh/xd/3NkF9/2a+ngW0kApPvssXH5Ecf8ixEw7Ir6MDAq45eMHoT0F0G3jzrs/nlLrpWgNlmHX1g2QWdJ2S5mTq4FMlw8+1NcRQJmHLSQwNgyqZPTQa6Cv+Dv66cgnY37LVTdasrTGd+Fnokv4lHHbxTcCFoSn4DT7LkFii4ILn5t2HTJU8UXJHcb7lZlzxTcMHnGDHaSv21VT5a94/mt2H9HGedggvHKhtATx1va9lv1V3ed3J0hGGeKCz7LToGOU7KfpMeuk4yBVfO5P6o2nFqzhWjt5cZXnMsj7fT6ewU/mN5S8fwDPZf/VycifFGo16u+I036seFEjH6dLoLiaAvVlumgMYBq5CCIhmu8SbvdfjC4RXpK4DvuvSNwyvSk/xV06UfHF6QvqKjcKzzAa77gUry1lXWVk08La5oyzi8In12JSsvHqwsJXsrOw/blQWwHcbVyrPxig4bT8cr8N01RXFrimbQxNL1PaIxSw9z1Vy39IayXnO/m4XhkmdiLsNkZV6a4cy4gp4xer0eZTdk3di7t7owXPH7kgaMvb0TprWO8RQLJCH37f/tTlf10YPHCIrDCHpcSJn7nUdPCyl
@sparr
sparr / gist:ac4944172d2375cb8fdb38c448f001ee
Created Apr 27, 2019
Factorio universal belt balancer, 4x4 belts, 23x9 tiles
View gist:ac4944172d2375cb8fdb38c448f001ee
0eNqlm+tu2zAMhd/Fv51B1F15laEY2s3rDKRO4DjDiiLvPrdJsWGR68OzX0F6+URRoshj0S/Nw+7UHcZ+mJrtS9N/3Q/HZvv5pTn2j8P97vVn0/Oha7ZNP3VPTdsM90+v37pfh7E7HjfTeD8cD/tx2jx0u6k5t00/fOt+NVs537VNN0z91HcX4tuX5y/D6emhG+c/WGO1zWF/nP99P7xaMSM3pW2e5w83j/KtH7uvl9/5c3sDt3p4usD9OtzRcMByfwM/zQ4dH8f9/LmEz1V8bN/Xbn+aDqfX1bkZLujnEqqOihV41MMjDE+Mo8KKo/phwU9ZPxVXH6sCLzQc8JOYG/rxsOunaf7lLddfjf4UADIRwhYOBLE0HfGK03hFNF7xarsFN1sfrwaHRxYO7HFJarhiNTMLRzaiPjzx6LSGhQM+t6LY5JrIt/rYxLOGdcTJHugMaPXxiicpGxQrcMXaf1dgdvbF/C9znbYfZ/6MG/vHH/X56KM44fNJLNyda7hMLHVmc7jVB3KBY83pA3kj14Nf/lnvGp4vly1Q0VqajtjOBPRGTH2A9XV2ni7QLTAbTUi/V+amEtNv9kMh7SLjwLTiv+Uj0SXNFK/HlvzfFLNmyLDk1RqZr65t7czyhuZJlSfM4no2ODxfVsv6KeipULf1gwqYDBHpgk+GLrYROBPT5o+jVoPYa4JYFgKqajldbCNuKSwcSHOBLraBvBCEhVePhaCPU4/byoSpp/NJ8IqtGJbSSQ0c2NodKFsCE6ELdcT6URboyhqZiia7flCyKGRIoIvtataNhsVVoysySVfMyuIuR0DUR/O7OADOtehoOrB5oqeVjQHogaYjtkdW2CCmJ8J0A9NVFfHFaKgG33Xf63u00NMBViIZVpQBvkqEOs6w5fRlEgJ37B0J4hbPwhHLg16xQUk9RV4QGXXeTYkfTa++UmbVl6yngVR48WWWtNdyTsuGFV/AXLKwcAPALSnszLqAyY7WdXIG7iHZ2yUgonMgtRfilkiyq+VbTqT
@sparr
sparr / xwininfo -tree -root
Created Mar 27, 2019
sublime text windows
View xwininfo -tree -root
Parent window id: 0x0 (none)
203 children:
0xaa005ad "Sublime Text": ("sublime_text" "Sublime_text") 299x480+0+51 +0+51
1 child:
0xaa005ae (has no name): () 1x1+-1+-1 +-1+50
0xaa00001 "Sublime Text": ("sublime_text" "Sublime_text") 10x10+10+10 +10+10
0x1803b2f "[i3 con] container around 0x564385937840": ("i3-frame" "i3-frame") 1920x1028+0+22 +0+22
1 child:
0xaa00003 "~/src/factorio/mods/factorio-mod-belt-overflow/control.lua (factorio) - Sublime Text": ("sublime_text" "Sublime_text") 1920x1028+0+0 +0+22
View $ gcc unxwb.c
/usr/bin/ld: /tmp/ccG0jyX2.o: in function `xma1_header':
unxwb.c:(.text+0xb5c): undefined reference to `xma_le16'
/usr/bin/ld: unxwb.c:(.text+0xb6a): undefined reference to `xma_le16'
/usr/bin/ld: unxwb.c:(.text+0xb78): undefined reference to `xma_le16'
/usr/bin/ld: unxwb.c:(.text+0xb86): undefined reference to `xma_le16'
/usr/bin/ld: unxwb.c:(.text+0xb94): undefined reference to `xma_le16'
/usr/bin/ld: unxwb.c:(.text+0xbaa): undefined reference to `xma_le32'
/usr/bin/ld: unxwb.c:(.text+0xbb7): undefined reference to `xma_le32'
/usr/bin/ld: unxwb.c:(.text+0xbc4): undefined reference to `xma_le32'
/usr/bin/ld: unxwb.c:(.text+0xbd1): undefined reference to `xma_le32'
@sparr
sparr / out
Created Mar 7, 2019
curl outputs first line of stats separately
View out
-> Downloading v25.4.0.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 120 0 120 0 0 330 0 --:--:-- --:--:-- --:--:-- 329
100 5735k 0 5735k 0 0 2567k 0 --:--:-- 0:00:02 --:--:-- 3574k
-> Downloading itch-setup...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 639 100 639 0 0 919 0 --:--:-- --:--:-- --:--:-- 919
100 5905k 100 5905k 0 0 4067k 0 0:00:01 0:00:01 --:--:-- 8297k