Skip to content

Instantly share code, notes, and snippets.

View snizovtsev's full-sized avatar

Sergey Nizovtsev snizovtsev

View GitHub Profile
DefinitionBlock ("", "SSDT", 1, "BOCHS ", "BATTERY", 0x00000001)
{
// TODO: declare area size here?
// Handle reconnects?
External (BPTR, IntObj)
Device (\_SB.BRES)
{
Name (_HID, "PNP0A06")
Name (_UID, "Battery resources")
#!/usr/bin/env python3
import mmap
import struct
import array
import socket
import time
import os
import ctypes
from pprint import pprint
#!/bin/bash
# This script is based on https://unix.stackexchange.com/revisions/480191/9 .
# The following changes proved to be necessary to make it work on CentOS 7:
# * removed disk info (model, size) - not very useful, might not work in many cases.
# * using "bw" instead of "bw_bytes" to support fio version 3.1 (those availible through yum @base)
# * escaping exclamation mark in sed command
# * the ".fiomark.txt" is not auto-removed
LOOPS=1 # How many times to run each test
@snizovtsev
snizovtsev / cdm_fio.sh
Last active February 5, 2024 22:35 — forked from i3v/cdm_fio.sh
Reproducing CrystalDiskMark tests with fio - fixes for https://unix.stackexchange.com/revisions/480191/9
#!/bin/bash
# This script is based on https://unix.stackexchange.com/revisions/480191/9 .
# The following changes proved to be necessary to make it work on CentOS 7:
# * removed disk info (model, size) - not very useful, might not work in many cases.
# * using "bw" instead of "bw_bytes" to support fio version 3.1 (those availible through yum @base)
# * escaping exclamation mark in sed command
# * the ".fiomark.txt" is not auto-removed
LOOPS=5 #How many times to run each test
@snizovtsev
snizovtsev / Vagrantfile
Last active April 9, 2020 15:25
TRex traffic generator in Vagrant
#!/usr/bin/env ruby
ENV["PYTHONUNBUFFERED"] = "1"
Vagrant.configure("2") do |config|
# Better defaults
config.vm.provider :libvirt do |libvirt|
libvirt.qemu_use_session = false
libvirt.cpu_mode = 'host-passthrough' # Prefer performance to reproducibility here
@snizovtsev
snizovtsev / tar2sfs.go
Last active April 26, 2019 07:26
Tar to squashfs using pseudo file
// $ go run tar2sfs.go distro.tar > INDEX
// $ mksquashfs ./sysroot distro.img -pf INDEX -noappend
package main
import (
"archive/tar"
"flag"
"fmt"
"io"