Skip to content

Instantly share code, notes, and snippets.

View slmingol's full-sized avatar
:octocat:
codz

Sam Mingo slmingol

:octocat:
codz
View GitHub Profile
@slmingol
slmingol / repair-dualboot-bootloader.sh
Created April 14, 2024 22:47 — forked from tobikris/repair-dualboot-bootloader.sh
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ # http://dadadom.de/2020/04/11/fix-fedora-uefi-boot-with-encrypted-partitions/
$ udiskctl unlock -b /dev/nvme0n1p6 # unlock root luks partition
$ mount /dev/mapper/fedora_fedora-root /mnt # mount root partition
$ mount /dev/mapper/fedora_fedora-var /mnt/var
$ mount /dev/nvme0n1p5 /mnt/boot # mount boot partition
@qrkourier
qrkourier / krun
Last active April 15, 2023 21:33
run any command in any container image in any Kubernetes namespace
# krun busybox whoami
krun(){
local NAMESPACE=default
local PRIVILEGED=false
while getopts 'n:pu:' OPT; do
case $OPT in
n) NAMESPACE=$OPTARG
;;
p) PRIVILEGED=true

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@fungiboletus
fungiboletus / anyconnect.lua
Last active April 9, 2024 14:44
Prefill Cisco AnnyConnect SSO login email using HammerSpoon
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "v", function()
-- Change your email
local email = "firstname.lastname@sintef.no"
local ciscoName = "Cisco AnyConnect Secure Mobility Client"
local loginWindowName = "login"
if hs.application.launchOrFocus(ciscoName) then
local ciscoApplication = hs.application.get(ciscoName)
local mainWindow = ciscoApplication:mainWindow()
@tobikris
tobikris / repair-dualboot-bootloader.sh
Last active April 14, 2024 22:47 — forked from Tamal/set-chroot.sh
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ # http://dadadom.de/2020/04/11/fix-fedora-uefi-boot-with-encrypted-partitions/
$ udiskctl unlock -b /dev/nvme0n1p6 # unlock root luks partition
$ mount /dev/mapper/fedora_fedora-root /mnt # mount root partition
$ mount /dev/mapper/fedora_fedora-var /mnt/var
$ mount /dev/nvme0n1p5 /mnt/boot # mount boot partition
@slmingol
slmingol / TrueColour.md
Created May 30, 2021 05:32 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@slmingol
slmingol / version-up.sh
Created May 8, 2021 12:42 — forked from OleksandrKucherenko/version-up.sh
Calculate Next Suitable Version Tag for Your Git based project
#!/usr/bin/env bash
## Copyright (C) 2017, Oleksandr Kucherenko
## Last revisit: 2017-09-29
# For help:
# ./versionip.sh --help
# For developer / references:
# https://ryanstutorials.net/bash-scripting-tutorial/bash-functions.php
# http://tldp.org/LDP/abs/html/comparison-ops.html
@scottrigby
scottrigby / demo.md
Last active February 3, 2023 20:13
Helm Users! What Flux 2 Can Do For You - KubeCon CLoudNativeCon EU 2021 - Scott Rigby & Kingdon Barrett, Weaveworks

Helm Users! What Flux 2 Can Do For You

This is the gist promised in our our KubeCon EU 2021 talk.

Go to https://github.com/kingdonb/kccnceu2021 for the full experience! 💖🤩

  • Check out the main branch for the full talk experience (warts and all)
  • Check out the present branch for the solutions according to the presenter
  • Check out the terminal branch for risky root shell fun
  • Check out the features branch for additional features as we incorporate them throughout the week based on your suggestions!
@kwilczynski
kwilczynski / script.sh
Created March 23, 2021 10:35
Dump ad list (ad blocking list), whitelist and blacklist from Sqlite database on Pi Hole
sqlite3 gravity.db.backup -header -csv 'select * from adlist' > adlist.csv
sqlite3 gravity.db.backup -header -csv 'select * from vw_whitelist' > whitelist.csv
sqlite3 gravity.db.backup -header -csv 'select * from vw_blacklist' > blacklist.csv