Skip to content

Instantly share code, notes, and snippets.

Avatar

Vít Šesták v6ak

View GitHub Profile
@v6ak
v6ak / assignments_list-conservative.py
Created May 18, 2021
Conservative adjustment of assignments_list.py
View assignments_list-conservative.py
def assignments_list(self, persistent=None):
'''List assignments for devices which are (or may be) attached to the
vm.
Devices may be attached persistently (so they are included in
:file:`qubes.xml`) or not. Device can also be in :file:`qubes.xml`,
but be temporarily detached.
:param bool persistent: only include devices which are or are not
attached persistently.
View get-sys-net-pcis.py
#!/bin/env python3
from qubesadmin import Qubes
q = Qubes()
d = q.domains['sys-net']
devices = d.devices['pci']
print(list(devices.assignments(persistent=True)))
View gist:30ecc502d1ce7508953eb3d505564668
Linux version 4.14.68-xen-stubdom (user@build-fedora4) (gcc version 6.4.1 20170727 (Red Hat 6.4.1-1) (GCC)) #1 Tue Oct 2 03:34:17 UTC 2018
Command line: debug console=hvc0
x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
Released 0 page(s)
e820: BIOS-provided physical RAM map:
Xen: [mem 0x0000000000000000-0x000000000009ffff] usable
View gist:76f2c089c63b1fe184f3717d5bd5254e
Linux version 4.14.68-xen-stubdom (user@build-fedora4) (gcc version 6.4.1 20170727 (Red Hat 6.4.1-1) (GCC)) #1 Tue Oct 2 03:34:17 UTC 2018
Command line: debug console=hvc0
x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
Released 0 page(s)
e820: BIOS-provided physical RAM map:
Xen: [mem 0x0000000000000000-0x000000000009ffff] usable
View gist:1cb7b172f63f8c20d7c4004f7996de39
This file has been truncated, but you can view the full file.
$ sudo journalctl | grep iwlwifi
(some non-interesting sudo-related logs skipped)
Mar 19 03:28:20 localhost kernel: iwlwifi 0000:00:06.0: Direct firmware load for iwlwifi-cc-a0-52.ucode failed with error -2
Mar 19 03:28:20 localhost kernel: iwlwifi 0000:00:06.0: Direct firmware load for iwlwifi-cc-a0-51.ucode failed with error -2
Mar 19 03:28:20 localhost kernel: iwlwifi 0000:00:06.0: Direct firmware load for iwlwifi-cc-a0-50.ucode failed with error -2
Mar 19 03:28:20 localhost kernel: iwlwifi 0000:00:06.0: Direct firmware load for iwlwifi-cc-a0-49.ucode failed with error -2
Mar 19 03:28:20 localhost kernel: iwlwifi 0000:00:06.0: Direct firmware load for iwlwifi-cc-a0-48.ucode failed with error -2
Mar 19 03:28:20 localhost kernel: iwlwifi 0000:00:06.0: Direct firmware load for iwlwifi-cc-a0-47.ucode failed with error -2
Mar 19 03:28:20 localhost kernel: iwlwifi 0000:00:06.0: loaded firmware version 46.3cfab8da.0 op_mode iwlmvm
View gist:f429774566cca097f51445ed93305136
% cat iwlwifi-processed.log | sed -e 's/^.* \(sys-net\|localhost\) \(kernel\|NetworkManager\[809\]\): /(time + host): /' -e 's/ 0x[0-9A-F]\{8\}/ (0xHEXAHEXA) /' -e 's/\(rfkill\|phy\)[0-9]\+/(\1 + number)/g' -e 's/(time + host): <info> \[[0-9.]\+\] /(time + host): <info> [(timestamp)] /' | sort -u
$ sudo journalctl | grep iwlwifi
(some sudo-related logs)
(time + host): <info> [(timestamp)] (rfkill + number): found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:06.0/ieee80211/(phy + number)/(rfkill + number)) (driver iwlwifi)
(time + host): _iwl_op_mode_start.isra.0+0x42/0x80 [iwlwifi]
(time + host): iwl_req_fw_callback+0x191e/0x1d30 [iwlwifi]
(time + host): iwl_trans_pcie_gen2_send_hcmd+0x3d8/0x3e0 [iwlwifi]
(time + host): ? iwl_trans_send_cmd+0x51/0xb0 [iwlwifi]
(time + host): iwl_trans_send_cmd+0x51/0xb0 [iwlwifi]
(time + host): iwlwifi 0000:00:06.0: (0xHEXAHEXA) | beacon time
View gist:7cdf4d2054739d1868f750ecee8134cb
// CShack for Linux, version 1.1, 2016-03-14
// (C) 2012-2016 Ladislav Matula <ladislav.matula*gmail.com>, www.xakru.com/cshack/
// (C) 2008 Michal Berg <m.berg*centrum.cz>
// (C) 2014-2016 Vít Šesták https://contact.v6ak.com
// Public domain
// CShack - Czech and Slovak 1337 keyboard layout
// - Caps-Lock is a new 'shift', without pressing this new 'shift' it behaves like the standard en_US layout
// - almost every key has two new characters - Caps-Lock + <char> and Shift + Caps-Lock + <char>
// - chars with diacritics are at (or close to) their basic glyph, Caps-Lock + a => á, Shift + Caps-Lock + a => Á, Caps-Lock + t => ť ...
View gist:0a412fe28445a74859b9845b8bf6b270
# yubihsm-shell (auth params) -a put-wrap-key -i 20 -c all --delegated all --informat bin --in wrap.key --verbose=0xff
[LIB - INF 09:50:58.762905] yubihsm.c:4052 (yh_init_connector): Loading http backend
[LIB - INF 09:50:58.768291] yubihsm_curl.c:88 (backend_connect): Trying to connect to http://AAA.BBB.CCC.DDD:12345/connector/status
[LIB - INF 09:50:58.798654] lib_util.c:129 (parse_status_data): response from connector
[LIB - INF 09:50:58.798682] lib_util.c:130 (parse_status_data): has device: yes
[LIB - INF 09:50:58.798691] lib_util.c:132 (parse_status_data): version: 2.0.0
[LIB - INF 09:50:58.798701] lib_util.c:133 (parse_status_data): pid: 17400
[LIB - INF 09:50:58.798706] lib_util.c:134 (parse_status_data): address: 0.0.0.0
[LIB - INF 09:50:58.798710] lib_util.c:135 (parse_status_data): port: 12345
[LIB - INF 09:50:58.798715] yubihsm_curl.c:129 (backend_connect): Found working connector
@v6ak
v6ak / keymap.c
Last active May 14, 2019
Attempt to create an one-handed layout for Ergodox
View keymap.c
#define MIRRORED( \
\
/* left hand, spatial positions */ \
k00,k01,k02,k03,k04,k05,k06, \
k10,k11,k12,k13,k14,k15,k16, \
k20,k21,k22,k23,k24,k25, \
k30,k31,k32,k33,k34,k35,k36, \
k40,k41,k42,k43,k44, \
k55,k56, \
k54, \
View touches-outside-of-the-window.log
EVENT type 22 (RawTouchBegin)
device: 2 (15)
detail: 2082
valuators:
0: 18367.72 (18367.72)
1: 51967.21 (51967.21)
EVENT type 6 (Motion)
device: 15 (15)
detail: 0