mkdir disk/
cp coreinfo.elf disk/boot.elf
qemu-system-x86_64 \
-enable-kvm -M q35 -cpu host -m 4096 -serial stdout \
-device qemu-xhci \
-drive file=fat:rw:disk/,if=none,id=usbdisk \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import collections | |
from redis.client import StrictRedis | |
import os | |
import time | |
while True: | |
with open('.sai.prom.new', 'w') as f: | |
r = StrictRedis(db=2, decode_responses=True) | |
appldb = StrictRedis(db=0, decode_responses=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
int fd = open(argv[1], O_RDWR); | |
if (fd < 0) { | |
perror("open"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 2625.068487] usb 3-1: new high-speed USB device number 5 using xhci_hcd | |
[ 2625.198966] usb 3-1: New USB device found, idVendor=0bda, idProduct=b812, bcdDevice= 2.10 | |
[ 2625.198971] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 | |
[ 2625.198972] usb 3-1: Product: 802.11ac NIC | |
[ 2625.198974] usb 3-1: Manufacturer: Realtek | |
[ 2625.198975] usb 3-1: SerialNumber: 123456 | |
[ 2625.306462] cfg80211: Loading compiled-in X.509 certificates for regulatory database | |
[ 2625.308354] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' | |
[ 2625.383895] rtw_8822bu 3-1:1.0: Firmware version 27.2.0, H2C version 13 | |
[ 2626.076899] usbcore: registered new interface driver rtw_8822bu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpld: cpld@6,0 { | |
compatible = "n821,cpld", "syscon", "simple-mfd"; | |
reg = <0x06 0x00 0x50>; | |
#address-cells = <1>; | |
#size-cells = <1>; | |
cpldi2c: n821-cpld-i2c@30 { | |
compatible = "n821,cpld-i2c"; | |
reg = <0x30 0x8>; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import pyvisa | |
import subprocess | |
import re | |
import time | |
def optical_data(iface): | |
# no json support in ethtool for eeprom dump yet :( | |
for _ in range(10): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from prometheus_client import start_http_server | |
from prometheus_client.core import GaugeMetricFamily, CounterMetricFamily, REGISTRY | |
import math | |
import re | |
import requests | |
from urllib.parse import urlparse | |
class XpdrCollector(object): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dnsmasq --port 0 --no-daemon --dhcp-range=192.168.1.100,192.168.1.200 --dhcp-leasefile=/dev/null -z --conf-file=/dev/null --interface enp36s0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { | |
if x.len() > y.len() { | |
x | |
} else { | |
y | |
} | |
} | |
fn min_length_string(x: &str) -> &str { | |
// Why does this not violate the lifetime checker? |
NewerOlder