Skip to content

Instantly share code, notes, and snippets.

@berkus
berkus / pijularize.sh
Created January 21, 2022 08:18
Pijularize a Git repository with all branches
#!/bin/sh
set -e
set -x
reponame=`basename $(pwd)`
echo "#######################################################################################"
echo "# Script to import all local branches from current repository (${reponame}) into pijul"
echo "# Will create a bunch of temp repos for import, so have sufficient disk space"
echo "#######################################################################################"
@tommyip
tommyip / venv.fish
Last active February 23, 2024 20:00
venv.fish - Automatically activate/deactivate virtualenv in fish shell
# Based on https://gist.github.com/bastibe/c0950e463ffdfdfada7adf149ae77c6f
# Changes:
# * Instead of overriding cd, we detect directory change. This allows the script to work
# for other means of cd, such as z.
# * Update syntax to work with new versions of fish.
# * Handle virtualenvs that are not located in the root of a git directory.
function __auto_source_venv --on-variable PWD --description "Activate/Deactivate virtualenv on directory change"
status --is-command-substitution; and return

scenario: you have a windows vm failing to boot with INACCESSIBLE_BOOT_DEVICE and changing the disk type to ide or something else causes another bsod. how to you get it to boot up again without a physical machine?

download the stable virtio drivers from here, in iso form: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso

add the iso to your qemu/virt manager config as a cd/dvd drive

windows should send you to the recovery mode screen, but if it doesn't you might have to run a windows install iso to get to it.

@bradleyharden
bradleyharden / typelevel.md
Last active May 3, 2021 13:13
Type-level programming documentation

Module supporting type-level programming

Introduction

Embedded software is often difficult to debug, so there is a strong motivation to catch as many bugs as possible at compile-time. However, the performance requirements of embedded software also make it difficult to justify changes that impose additional overhead in terms of size or speed. Ideally, we would like to add as many compile-time checks as possible while also producing the minimum possible assembly.

@genofire
genofire / config
Created June 4, 2020 12:30
Waybar style
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
// "height": 14, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode"],
// "modules-center": ["sway/window"],
"modules-right": ["custom/arch_update", "custom/disk_home", "custom/disk_root","temperature", "cpu", "memory", "custom/mail", "network", "backlight", "pulseaudio", "clock", "battery", "idle_inhibitor", "tray"],
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active April 28, 2024 12:48
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@bdeshi
bdeshi / layout.test
Last active April 16, 2024 01:09
multiling o keyboard config.
{
"title":"DIY-untitled",
"onScreen":{
"main":[
"1234567890",
"qwertyuiop",
"asdfghjkl",
"[SHIFT][XK:z[UNDO]][XK:x[CUT]][XK:c[COPY]][XK:v[PASTE]]bnm[DEL]",
"[TOOL][ALTGR:,][SPACE][][][SYM:.][ENTER]"
],
@paulhandy
paulhandy / cleanup-zfs-snapshots
Created September 18, 2017 19:19
Clean up old zfs snapshots
https://serverfault.com/questions/340837/how-to-delete-all-but-last-n-zfs-snapshots#340846
You may find something like this a little simpler
zfs list -t snapshot -o name | grep ^tank@Auto | tac | tail -n +16 | xargs -n 1 zfs destroy -r
output the list of snapshot (names only) with zfs list -t snaphot -o name
filter to keep only the ones that match tank@Auto with grep ^tank@Auto
reverse the list (previously sorted from oldest to newest) with tac
limit output to the 16th oldest result and following with tail -n +16
@ViktorNova
ViktorNova / rotate-video.sh
Created August 8, 2016 21:33
Rotate a video with FFmpeg (100% lossless, and quick)
$INPUTVIDEO='input.mp4'
$OUTPUTVIDEO='output.mp4'
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO