Skip to content

Instantly share code, notes, and snippets.

View siddhpant's full-sized avatar
😵‍💫
brain: too many context switches

Siddh Raman Pant siddhpant

😵‍💫
brain: too many context switches
View GitHub Profile
import asyncio
import contextlib
import sys
from shutil import rmtree
import time
from pathlib import Path
from uuid import uuid4
from aiofile import AIOFile
from aiofiles import open as aio_open
@siddhpant
siddhpant / custom_ps1.bash
Created January 23, 2025 10:03
Custom bash theme
# SPDX-License-Identifier: MIT
# Copyright (c) 2025 Siddh Raman Pant <@siddhpant on GitHub>
# Design skeletal inspired from Kali Linux theme PS1: https://superuser.com/a/1781707
# -----------------------------------------------------------------------------
# Check add_starting_line() and add_ending_line()
____custom_ps1_separator="─"
@siddhpant
siddhpant / setup.sh
Last active April 5, 2025 14:40 — forked from giannello/setup.sh
Install fprintd-tod with support for Broadcom readers on Debian testing
#!/usr/bin/env sh
# ONLY FOR DEBIAN, NOT FOR UBUNTU!
# ONLY FOR DEBIAN, NOT FOR UBUNTU!
# ONLY FOR DEBIAN, NOT FOR UBUNTU!
# ONLY FOR DEBIAN, NOT FOR UBUNTU!
# ONLY FOR DEBIAN, NOT FOR UBUNTU!
set -eux pipefail
@siddhpant
siddhpant / 40_custom
Created December 9, 2023 11:22
Grub Reboot and Shutdown menu entry
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
submenu "Reboot / Shutdown" --class restart {
menuentry "Reboot" --class restart {
reboot
@siddhpant
siddhpant / keybase.md
Created September 5, 2023 10:38
Keybase identity proof

Keybase proof

I hereby claim:

  • I am siddhpant on github.
  • I am siddhpant (https://keybase.io/siddhpant) on keybase.
  • I have a public key ASDmk_dNxLBn4NwJ0Xj7jtrPMyHaErfTMz0I7xKtPonQaQo

To claim this, I am signing this object:

@siddhpant
siddhpant / .bash_aliases
Last active April 26, 2023 07:08
Some helpers for using connection via proxy in bash, when you don't want to save your credentials in standard locations (for eg. in shared PCs).
myproxy()
{
read -p "Username: " USER
read -s -p "Password: " PW
echo
hostname="proxy.example.com"
port="3128"
PROXY="$(jq -rn --arg x $USER '$x|@uri'):$(jq -rn --arg x $PW '$x|@uri')@$hostname:$port"
[ 186.842598] fmc: loading out-of-tree module taints kernel.
[ 186.842635] fmc: module verification failed: signature and/or required key missing - tainting kernel
[ 186.857994] spec 0000:01:00.0: probe for device 0001:0000
[ 186.858002] spec 0000:01:00.0: enabling device (0000 -> 0002)
[ 186.888160] spec 0000:01:00.0: got file "fmc/spec-init.bin", 1484404 (0x16a674) bytes
[ 187.079632] spec 0000:01:00.0: FPGA programming successful
[ 187.427747] spec 0000:01:00.0: mezzanine 0
[ 187.427749] Manufacturer: CERN
[ 187.427750] Product name: FmcDio5cha
[ 187.443343] spec 0000:01:00.0: got file "fmc/wr_nic_dio.bin", 1484960 (0x16a8a0) bytes
@siddhpant
siddhpant / .bash_aliases
Last active November 12, 2023 15:41
Bash aliases to aid in kernel dev
kgit-config() {
git config user.name "Your name"
git config user.email "[email protected]"
git config commit.gpgsign false
git config pull.rebase true
git config sendemail.smtpServer "smtp.email.com"
git config sendemail.smtpEncryption tls
git config sendemail.smtpServerPort 587
git config sendemail.smtpUser "[email protected]"
#Slimbook battery maximo rendimiento
# ------------------------------------------------------------------------------
# /etc/tlp.conf - TLP user configuration
# See full explanation: https://linrunner.de/en/tlp/docs/tlp-configuration.html
#
# New configuration scheme (TLP 1.3). Settings are read in the following order:
# 1. Intrinsic defaults
# 2. /etc/tlp.d/*.conf - Drop-in customization snippets
# 3. /etc/tlp.conf - User configuration (this file)
@siddhpant
siddhpant / dkms_sign.md
Last active May 12, 2023 12:55
DKMS auto-signing modules on install. Helpful when secure boot is on. Also contains v3 instructions.

Requirements

  • Bash
  • DKMS
  • keyring (install using pip as root)
  • MOK signing key
  • # touch /etc/dkms/framework.conf.d/signing.conf