Skip to content

Instantly share code, notes, and snippets.

View kjkent's full-sized avatar
:shipit:

Kristopher James Kent kjkent

:shipit:
View GitHub Profile
@MaxLaumeister
MaxLaumeister / Grub_Powerup.md
Last active February 7, 2025 17:53
Grub Init Tune: Mario Bros. Mushroom Powerup

Grub Init Tune - Mario Bros. Mushroom Powerup

This Grub Init Tune will make your computer sound like a Super Mushroom every time you turn it on! This only works for the Grub bootloader - this generally means you need to have Linux (or other Grub-based OS) installed.

Here's the code, which goes in your /etc/default/grub file:

GRUB_INIT_TUNE="1750 523 1 392 1 523 1 659 1 784 1 1047 1 784 1 415 1 523 1 622 1 831 1 622 1 831 1 1046 1 1244 1 1661 1 1244 1 466 1 587 1 698 1 932 1 1195 1 1397 1 1865 1 1397 1"

Installation Instructions

@uglide
uglide / chroot.sh
Last active May 5, 2025 16:35
Chroot to Installed system on LVM
#!/bin/bash
fdisk -lu
pvscan
vgscan
vgchange -a y
lvscan
mount /dev/ubuntu-vg/root /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
@carlessanagustin
carlessanagustin / Nginx_Cheat_Sheet.md
Last active April 21, 2025 02:32
Nginx Cheat Sheet
@newvertex
newvertex / KeyPressEvent.js
Created September 17, 2016 10:24
Example: Detect keypress event in Node.js console app
var readline = require('readline');
readline.emitKeypressEvents(process.stdin);
if (process.stdin.isTTY)
process.stdin.setRawMode(true);
process.stdin.on('keypress', (chunk, key) => {
if (key && key.name == 'q')
process.exit();
@mwilliammyers
mwilliammyers / updatedb.conf
Last active June 2, 2024 21:35
/etc/updatedb.conf
# locate --regex '.*\/(\w+[^\.]\w+$)+'
PRUNE_BIND_MOUNTS="yes"
PRUNENAMES=".git .bzr .hg .svn Trash Cache cache .cache logs fonts font Frameworks atom .atom apm .apm .ansible .idea libreoffice node_modules .node-gyp .npm ipynb_checkpoints dist-packages site-packages .eggs build help icons modules samples Template Templates template templates snapd locale .pycharm_helpers pycharm_helpers .google-chrome google-chrome __pycache__ pack generated_completions .cargo"
PRUNEPATHS="/tmp /var/spool /media /var/lib/os-prober /var/lib/ceph /home/.ecryptfs /var/lib/schroot /usr/share/man /usr/share/perl5 /usr/share/perl /usr/share/doc /usr/share/sound /opt/pycharm-professional"
PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs devtmpfs fuse.mfs shfs sysfs cifs lustre tmpfs usbfs udf fuse.glusterfs fuse.sshfs curlftpfs ceph fuse.ceph fuse.rozofs ecryptfs fusesmb"
@patrickmslatteryvt
patrickmslatteryvt / gist:d531c5ae4598fd4c9d508833bde6c7c0
Last active July 24, 2023 07:05
Install/update SOPS to latest on Fedora
# Install/update SOPS to latest on Fedora - https://github.com/getsops/sops
# This script requires jq installed to parse the API return from GitHub
echo "[+] Install/upgrade SOPS"
which jq | grep -o jq > /dev/null && : || dnf install -y jq
SOPS_VERSION=$(curl -s https://api.github.com/repos/getsops/sops/releases/latest | jq .tag_name | tr -d '"')
dnf install -y https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION:1}-1.x86_64.rpm
sops --version
# sops 3.7.3 (latest)
@artizirk
artizirk / gnupg_scdaemon.md
Last active April 22, 2025 18:10
OpenPGP SSH access with Yubikey and GnuPG

NB: This document describles a 'Old-School' way of using Yubikey with SSH

Modern OpenSSH has native support for FIDO Authentication. Its much simpler and should also be more stable with less moving parts. OpenSSH also now has support for signing arbitary files witch can be used as replacement of gnupg. Git also supports signing commits/tags with ssh keys.

Pros of FIDO

  • Simpler stack / less moving parts
  • Works directly with ssh, ssh-add and ssh-keygen on most computers
  • Simpler
  • Private key can never leave the FIDO device

Cons of FIDO

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 12, 2025 13:07
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@fjpalacios
fjpalacios / arch-i3gaps-install.md
Last active May 11, 2025 19:08
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps
@gresan-gits
gresan-gits / code.ino
Created February 14, 2020 10:23
ESP32 ADC Arduino
#include "esp_system.h"
#include "esp_adc_cal.h"
#include "driver/adc.h"
#define ADC_BAT_PIN 34
#define NO_OF_SAMPLES 64 //Multisampling
#define REF_VOLTAGE 1100
#define LIN_COEFF_A_SCALE 65536