Skip to content

Instantly share code, notes, and snippets.

View jlevon's full-sized avatar

John Levon jlevon

View GitHub Profile
@jlevon
jlevon / gist:207b20ebac1ffe597d44d6a7ba53f289
Last active April 15, 2024 08:55
qemu-dma-bh-hang.txt
NB: qemu-6.2.0, so entirely possible this has been subsequently fixed but no obvious fix found so far.
This version does *not* have the fix 7d751201 ("hw/ide: reset: cancel async DMA operation before resetting state")
Most likely, but unclear, there was some ongoing IO issue at the libiscsi server end causing requests
not to complete until eventually libiscsi times them out.
Stuck here with BQL held:
```
#4 0x0000564b03027c3c in aio_poll (ctx=0x564b03ce9070, blocking=blocking@entry=true) at ../util/aio-posix.c:607
@jlevon
jlevon / gerrit-links.js
Created February 12, 2023 13:14
open all gerrit files in a new tab bookmarklet
@jlevon
jlevon / github-cli.yml
Created October 12, 2022 23:05
ansible for github cli updating
---
- name: find latest release
uri:
url: https://api.github.com/repos/cli/cli/releases/latest
register: latest_release
- name: Install Github CLI deb from github
become: true
apt:
deb: >-
[john.levon@john-levon .vim]$ Fri 08 Apr 2022 15:45:13 UTC:["lsp#register_server","server registered","clangd"]
Fri 08 Apr 2022 15:45:13 UTC:["lsp#register_server","server already registered","clangd"]
Fri 08 Apr 2022 15:45:13 UTC:["lsp#register_server","server registered","clangd"]
Fri 08 Apr 2022 15:45:13 UTC:["s:on_text_document_did_open()",1,"c","/home/john.levon/c","file:///home/john.levon/c/a.c"]
Fri 08 Apr 2022 15:45:13 UTC:["Starting server","clangd",["/opt/llvm/bin/clangd"]]
Fri 08 Apr 2022 15:45:13 UTC:[{"response":{"data":{"__data__":"vim-lsp","lsp_id":1,"server_name":"clangd"},"message":"started lsp server successfully"}}]
Fri 08 Apr 2022 15:45:13 UTC:["--->",1,"clangd",{"method":"initialize","params":{"rootUri":"file:///home/john.levon/c","capabilities":{"workspace":{"workspaceFolders":false,"configuration":true,"applyEdit":true},"window":{"workDoneProgress":false},"textDocument":{"semanticHighlightingCapabilities":{"semanticHighlighting":false},"codeAction":{"isPreferredSupport":true,"disabledSu
@jlevon
jlevon / a.md
Created November 16, 2021 21:40
vfio-user bug threads
(gdb) thread apply all bt

Thread 8 (Thread 0x7faffab00700 (LWP 17190)):
#0  0x00007faff677eddd in internal_fallocate () at /lib64/libc.so.6
#1  0x0000000000000000 in  ()

Thread 7 (Thread 0x7faffaa91700 (LWP 17194)):
#0  0x00007faff6a64a35 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x000056154596a7e9 in qemu_cond_wait_impl (cond=<optimized out>, mutex=0x561548080d48, file=0x561545aef797 "ui/vnc-jobs.c", line=214) at util/qemu-thread-posix.c:175
@jlevon
jlevon / mute-procmail.md
Created February 12, 2021 17:41
mute thread in procmail
:0 Wfh: formail.lock
| $HOME/src/procmail-thread/match-thread.sh $HOME/.refs.muted "Procmail-Muted: true"

:0
* Procmail-Muted: true
{
        SWITCHRC=$HOME/.procmailrc.markread
}
@jlevon
jlevon / mincore.c
Created October 1, 2020 13:20
mincore test of memfd
#include <unistd.h>
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <linux/mman.h>
#include <sys/mman.h>
#include <assert.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
int fd = memfd_create("test", 0);
@jlevon
jlevon / omnios-serial.md
Created August 19, 2020 09:44
omnios installer serial setup
kayak-r151034l# cat /mnt/boot/conf.d/serial  
boot_multicons="YES"
boot_serial="YES"
comconsole_speed="115200"
os_console="ttya"
console="ttya,text"
ttya-mode="115200,8,n,1,-"
@jlevon
jlevon / intervals.py
Created July 22, 2020 17:55
interval insertion
#!/usr/bin/python3
def overlaps(i1, i2):
if i1[0] <= i2[1] and i2[0] <= i1[1]:
return True
return False
def insert_interval(intervals, new):
res = []
@jlevon
jlevon / newboot-flagday.md
Last active June 18, 2020 15:51
Flag day: OS-7260 SmartOS should support booting with loader