Skip to content

Instantly share code, notes, and snippets.

View Binary-Eater's full-sized avatar

Rahul Rameshbabu Binary-Eater

View GitHub Profile
@Binary-Eater
Binary-Eater / encryptedNixos.md
Last active December 7, 2020 07:05 — forked from whoizit/encryptedNixos.md
NixOS install with encrypted /boot /root with single password unlock

Requirements

  1. Encrypt everthing including /boot and /root
  2. Enter password once

Installation media setup

Download unstable NixOS graphical live iso (cause vim on graphical live iso and easier to read this guide in browser) and write to USB stick.

lsblk
umount /dev/sdX1
dd if=path/to/nixos-graphical-unstable-x86_64-linux.iso of=/dev/sdX bs=10M oflag=direct status=progress
@Binary-Eater
Binary-Eater / pingpong.go
Last active December 15, 2021 06:50
Go ping pong with timeout context
package main
import (
"context"
"fmt"
"sync"
"time"
)
func pingPong(ctx context.Context, player string, wg *sync.WaitGroup, in <-chan struct{}, out chan<- struct{}) {
@Binary-Eater
Binary-Eater / composite_type_read_test.c
Last active August 23, 2022 22:30
Snippet for testing Coverity Scan of composite type reads
enum test_union_type {
NONE,
SHORT,
INTEGER
};
union test_union {
struct {};
short s;
int i;
@Binary-Eater
Binary-Eater / default.nix
Created July 29, 2023 17:58
Nix shell for linux kernel development
{ pkgs ? import <nixpkgs> {}, unstable ? import <nixos-unstable> {} }:
let
binutils = unstable.binutils; # need binutils >=2.39 for DWARF5 debuginfo
llvmPackages_14 = unstable.llvmPackages_14;
sphinx = unstable.sphinx; # need sphinx >=5.x.x due to https://github.com/sphinx-doc/sphinx/issues/10495
in
pkgs.mkShell {
SPHINXBUILD = "${pkgs.sphinx}/bin/sphinx-build";
@Binary-Eater
Binary-Eater / .dir-locals.el
Created July 29, 2023 18:00
Emacs directory local settings for kernel development
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((c++-mode . ((clang-format-style . "file")
(tab-width . 8)
(c-basic-offset . 8)
(indent-tabs-mode . t)))
(c-mode . ((clang-format-style . "file")
(tab-width . 8)
(c-basic-offset . 8)
@Binary-Eater
Binary-Eater / .mailrc
Created July 29, 2023 21:40
Mail alias file for kernel dev
alias input linux-input@vger.kernel.org
alias jkosina "Jiri Kosina <jikos@kernel.org>"
alias btissoires "Benjamin Tissoires <benjamin.tissoires@redhat.com>"
alias kernel linux-kernel@vger.kernel.org
@Binary-Eater
Binary-Eater / rpi3_freebsd_buildworld.log
Created September 24, 2023 16:39
FreeBSD aarch64 build failure related to fp support for 32-bit compat
This file has been truncated, but you can view the full file.
--- buildworld ---
make[1]: "/usr/src/Makefile.inc1" line 337: SYSTEM_COMPILER: Determined that CC=cc matches the source tree. Not bootstrapping a cross-compiler.
make[1]: "/usr/src/Makefile.inc1" line 342: SYSTEM_LINKER: Determined that LD=ld matches the source tree. Not bootstrapping a cross-linker.
--- buildworld_prologue ---
--------------------------------------------------------------
>>> World build started on Sat Sep 23 14:49:18 PDT 2023
--------------------------------------------------------------
--- _cleanworldtmp ---
--------------------------------------------------------------
Script started on Wed Oct 18 20:33:11 2023
binary-eater@BINARY-EATER-DEV:~ $
exit
kk
cd work/
lsblk
sudo /bin/sh crochet.sh -v -b RaspberryPi3
cd ..
rg 'mount\.freebsd' | less
cd ..
@Binary-Eater
Binary-Eater / nouveau_kernel_dump.txt
Last active November 27, 2023 17:10
nouveau X prime setup multimonitor dump
kernel: nouveau 0000:01:00.0: gr: TRAP ch 1 [017fd40000 X[1850]]
kernel: nouveau 0000:01:00.0: gr: DISPATCH 80000001 [INJECTED_BUNDLE_ERROR]
kernel: nouveau 0000:01:00.0: gr: TRAP ch 1 [017fd40000 X[1850]]
kernel: nouveau 0000:01:00.0: gr: DISPATCH 80000001 [INJECTED_BUNDLE_ERROR]
kernel: nouveau 0000:01:00.0: gr: TRAP ch 1 [017fd40000 X[1850]]
kernel: nouveau 0000:01:00.0: gr: DISPATCH 80000001 [INJECTED_BUNDLE_ERROR]
wireplumber[1714]: <WpPortalPermissionStorePlugin:0x19d97b0> Failed to call Lookup: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknow>
wireplumber[1714]: <WpPortalPermissionStorePlugin:0x19d97b0> Failed to call Lookup: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknow>
wireplumber[1714]: <WpPortalPermissionStorePlugin:0x19d97b0> Failed to call Lookup: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknow>
wireplumber[1714]: <WpPortalPermissionStorePlugin:0x19d97b0> Failed to call Lookup: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknow>
@Binary-Eater
Binary-Eater / b43_no_qos.log
Last active December 30, 2023 02:50
b43 no qos kernel log
[ +5.112651] ------------[ cut here ]------------
[ +0.000005] WARNING: CPU: 7 PID: 25513 at net/mac80211/util.c:449 __ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000067] Modules linked in: b43(O) snd_seq_dummy snd_hrtimer snd_seq snd_seq_device nft_chain_nat xt_MASQUERADE nf_nat xfrm_user xfrm_algo xt_addrtype overlay ccm af_packet amdgpu snd_hda_codec_cirrus snd_hda_codec_generic ledtrig_audio drm_exec amdxcp gpu_sched xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6t_rpfilter ipt_rpfilter xt_pkttype xt_LOG nf_log_syslog xt_tcpudp nft_compat nf_tables nfnetlink sch_fq_codel btusb uinput iTCO_wdt ctr btrtl intel_pmc_bxt i915 intel_rapl_msr mei_hdcp mei_pxp joydev at24 watchdog btintel atkbd libps2 serio radeon btbcm vivaldi_fmap btmtk intel_rapl_common snd_hda_codec_hdmi bluetooth uvcvideo nls_iso8859_1 applesmc nls_cp437 x86_pkg_temp_thermal snd_hda_intel intel_powerclamp vfat videobuf2_vmalloc coretemp fat snd_intel_dspcfg crc32_pclmul uvc polyval_clmulni snd_intel_sdw_acpi loop videobuf2