Skip to content

Instantly share code, notes, and snippets.

@aserranoni
aserranoni / gist:3ff260f52a61180036e63181fc87cd77
Created October 19, 2023 01:58
A life without yabai window borders
# I've been using a combination of yabai, skhd (with modal keybindings), and sketchybar.
## Recently, with the deprecation of the window border in yabai. I had to find a way to
## keep track of the skhd current mode.
# Add the following lines to sketchybarrc:
sketchybar --add item mode_indicator left
sketchybar --set mode_indicator drawing_method=separator
sketchybar --set mode_indicator label="default-mode | "
@lorenzleutgeb
lorenzleutgeb / committer-progress.sh
Last active December 7, 2023 01:42
Nixpkgs Committer Progress
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash gh
set -eu
# Will exit non-zero if not authenticated.
gh auth status
if [ $# == 1 ]
then
# Pass GitHub username as commandline argument.
@marcopaganini
marcopaganini / how-to-remove-git-crypt.md
Last active October 17, 2023 16:46
How to remove git-crypt from your repo (maintaining history).

How to remove git-crypt and maintain your history

I've been successfully using git-crypt to provide provide partial encryption to some of my repos. It's a great program and I'd definitely recommend it for your git repository encryption needs.

However, while installation is quite simple, I couldn't find good instructions on how to uninstall git-crypt and maintain history intact.

This guide provides simple instructions on how to accomplish that. In the end,

@felipou
felipou / decrypt_dbeaver.py
Last active March 18, 2024 18:46
DBeaver password decryption script - for newer versions of DBeaver
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection
# requires pycryptodome lib (pip install pycryptodome)
import sys
import base64
import os
import json
from Crypto.Cipher import AES
@adrianlzt
adrianlzt / sharescreen
Last active January 7, 2022 07:14
Scripts to share only a portion of the screen
#!/bin/bash
# Modified version of https://github.com/Ashark/hliss/blob/master/vlc-hangouts
# Script to share a portion of the screen in VLC to be used by Chrome/Firefox to share the screen
# By default, when run, it asks to click in some window. The area of that window is what is going to be shared.
# If executed with "sharescreen area", it asks for a portion of the screen to be shared.
unset x y w h
# Old code to choose a monitor
@kylebrandt
kylebrandt / i3hangout.md
Last active June 27, 2023 15:50
i3 Hangout / Meet VLC screensharing workaround mutli-monitor

Share an area of your screen by using vlc screen capture, and then sharing the vlc capture window

Make sure the VLC window floats

In i3 config:

for_window [window_role="vlc-video"] floating enable move down 100px;

We float it so the tiling window manager doesn't resize the window and mess up the scale. We also move the window placement down at launch so it easy to drag somewhere mostly offscreen.

# Split the logs in separate files
echo Splitting...
csplit r-ryantm '/2018-..-..T..:..:.. .* [^ ]* -> [^ ]*/' '{*}' 1>/dev/null
# rename xx* to xx*-package-name
echo Renaming...
parallel -j30 "mv {} {}-\$(head -n1 {} | cut -d' ' -f2)" ::: xx*
echo Separating...
@cheater
cheater / sleep-countdown
Created November 18, 2018 17:33
sleep with countdown in bash
#!/bin/bash
sleep_time="$(( $1 - 1 ))" # subtract 1, since we wait on the 0th second.
start_s="$(date +%s)"
start_ns="$(date +%N)"
div_whole() {
# whole-number division of integers.
a="$1"
@tazjin
tazjin / thoughts.md
Last active February 28, 2024 12:05
Nix builder for Kubernetes
@edolstra
edolstra / nix-lang.md
Last active February 22, 2024 06:19
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to