Skip to content

Instantly share code, notes, and snippets.

@nabijaczleweli
nabijaczleweli / maker.awk
Last active April 6, 2024 08:33
Conversion script
#!/usr/bin/awk -f
BEGIN {
place = 1
}
/{/ {
sub(/[\[ ] { /, "")
sub(/ ]/, "")
gsub(/},/, "")
@nabijaczleweli
nabijaczleweli / kcm-sample.c
Last active December 20, 2023 18:55 — forked from dhowells/kcm-sample.c
A sample program of KCM
/*
* A sample program of KCM.
*
* $ cc $(pkgconf --cflags --libs libbcc) kcm-sample.c -okcm-sample -Wall
* $ ./kcm-sample 10000
*/
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@nabijaczleweli
nabijaczleweli / README.md
Last active July 19, 2021 14:05
Do not dumb here, not dumb area

Warning: Do Not Dumb Here – Not Dumb Area

Overall design stolen from this video, Japanese stolen from this comment.

On transparency

A5 size.

@nabijaczleweli
nabijaczleweli / variadic-template-iterate.hpp
Last active June 13, 2021 21:35
Iterate over all elements of variadic template
#include <cstddef>
#include <utility>
template<class T, class... TT>
struct over_all {
using next = over_all<TT...>;
static const constexpr std::size_t size = 1 + next::size;
template<class C>
@nabijaczleweli
nabijaczleweli / 00-entry-directory.install
Last active May 5, 2021 20:23
Fedora 34 all available /usr/lib/kernel/install.ds
#!/usr/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
klapki(8) klapki.8.ronn
SHA1(3ssl) https://manpages.debian.org/buster/libssl-doc/SHA1.3ssl.en.html
efibootmgr(8) https://manpages.debian.org/buster/efibootmgr/efibootmgr.8.en.html
efivar(1) https://manpages.debian.org/buster/efivar/efivar.1.en.html
execl(3) https://manpages.debian.org/buster/manpages-dev/execl.3.en.html
gethostname(2) https://manpages.debian.org/buster/manpages-dev/gethostname.2.en.html
memfd_create(2) https://manpages.debian.org/buster/manpages-dev/memfd_create.2.en.html
kernel-install(8) https://www.freedesktop.org/software/systemd/man/kernel-install.html
@nabijaczleweli
nabijaczleweli / deploy.sh
Last active May 14, 2020 14:28
Rust project documentation deployment script for TravisCI, insert into after_success section
if ( [ "$TRAVIS_BRANCH" = "master" ] || [ "$TRAVIS_BRANCH" = "trunk" ] || [ "$TRAVIS_BRANCH" = "develop" ] ) && [ "$TRAVIS_SECURE_ENV_VARS" = "true" ] && [ "$TRAVIS_RUST_VERSION" = "stable" ] && [ "$TRAVIS_COMMIT_RANGE" ] && ! [ "$TRAVIS_TAG" ]; then
(
echo "Update docs for commits $TRAVIS_COMMIT_RANGE";
echo;
git log "$TRAVIS_COMMIT_RANGE" --pretty=oneline;
) >> "$TRAVIS_BUILD_DIR/../DOC_UPDATE_MSG";
mkdir -p ~/.ssh && cp gh_rsa ~/.ssh/id_rsa && chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa;
git clone -b doc "git@github.com:$TRAVIS_REPO_SLUG.git" "$TRAVIS_BUILD_DIR-doc";
mkdir -p target;
cargo doc;
@nabijaczleweli
nabijaczleweli / journal-working.acpi
Last active April 23, 2020 19:13
Journals and reduced diff between szarotka's acpi=off noapic boot and normal, wherein the former detects PCI Slots and NICs are named ens2f[01] and the latter does not and they get named enp32s0f[01]; https://twitter.com/nabijaczleweli/status/1252437039175229440
-- Logs begin at Fri 2019-11-29 17:32:36 CET, end at Tue 2020-04-21 03:43:25 CEST. --
Apr 21 03:36:47 szarotka kernel: Linux version 5.5.0-1-amd64 (debian-kernel@lists.debian.org) (gcc version 9.3.0 (Debian 9.3.0-10)) #1 SMP Debian 5.5.13-2.1~szarotka2 (2020-04-15)
Apr 21 03:36:47 szarotka kernel: Command line: BOOT_IMAGE=/vmlinuz-5.5.0-1-amd64 root=UUID=d9e8441a-1a97-47af-b002-d764ac46121b ro syscall.x32=y pci_hotplug.debug=Y pci_hotplug.debug_acpi=Y pciehp.pciehp_poll_mode=Y pciehp.pciehp_poll_time=1
Apr 21 03:36:47 szarotka kernel: x86/fpu: x87 FPU will use FXSAVE
Apr 21 03:36:47 szarotka kernel: BIOS-provided physical RAM map:
Apr 21 03:36:47 szarotka kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
Apr 21 03:36:47 szarotka kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
Apr 21 03:36:47 szarotka kernel: BIOS-e820: [mem 0x00000000000e4000-0x00000000000fffff] reserved
Apr 21 03:36:47 szarotka kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000df7b1cff] usable
A
@nabijaczleweli
nabijaczleweli / EnVar_plugin.zip
Last active March 11, 2020 22:23
EnvVarUpdate.nsh with patches
// The MIT License (MIT)
// Copyright (c) 2019 nabijaczleweli
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions: