Skip to content

Instantly share code, notes, and snippets.

View dhensen's full-sized avatar
🎯
Focusing

Dino Hensen dhensen

🎯
Focusing
View GitHub Profile
@emanuele6
emanuele6 / bspdeskjson2dot
Last active August 17, 2023 13:56
bspwm tree visualiser
#!/bin/sh --
# \
exec jq -Crf "$0" -- "$@"
def children:
objects |
.path as $p |
(.firstChild | objects | .path = $p + "/1"),
(.secondChild | objects | .path = $p + "/2") |
select(has("id"));
@ghifarit53
ghifarit53 / README.md
Last active December 16, 2023 01:09
[i3] big sur like polybar style

macOS Big Sur on Linux!

bigsurlinux

to replicate the bar and the blur effect, you'll need

  • polybar
  • fontawesome and sf pro text
  • compton tryone fork (you can use picom too, but i don't know if the config is compatible)

you can adjust the bar opacity by editing the number in the bar background color (0-100)

@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active May 19, 2024 10:44
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@krisleech
krisleech / renew-gpgkey.md
Last active May 20, 2024 08:24
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@muendelezaji
muendelezaji / bash-to-zsh-hist.py
Created October 5, 2016 14:18 — forked from op/bash-history-to-zsh-history.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@azizur
azizur / Creating a static copy of a dynamic website.md
Last active April 27, 2024 06:08
Creating a static copy of a dynamic website

The command line, in short…

wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://website.com/

…and the options explained

  • -k : convert links to relative
  • -K : keep an original versions of files without the conversions made by wget
  • -E : rename html files to .html (if they don’t already have an htm(l) extension)
  • -r : recursive… of course we want to make a recursive copy
  • -l 10 : the maximum level of recursion. if you have a really big website you may need to put a higher number, but 10 levels should be enough.
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active May 12, 2024 13:59
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@thouis
thouis / gist:977370
Created May 17, 2011 20:52
idle time in python
# http://thp.io/2007/09/x11-idle-time-and-focused-window-in.html
# http://www.freedesktop.org/software/ConsoleKit/doc/ConsoleKit.html#Session:idle-hint
import Xlib.display
display = Xlib.display.Display()
focus = display.get_input_focus()
print "WM Class: %s" % ( focus.focus.get_wm_class(), )
print "WM Name: %s" % ( focus.focus.get_wm_name(), )
@IcyMidnight
IcyMidnight / MySQL functions to convert between binary and string uuids
Created July 31, 2009 09:27
MySQL functions to convert between binary and string uuids
DELIMITER |
CREATE FUNCTION uuid_from_bin(b BINARY(16))
RETURNS CHAR(36) DETERMINISTIC
BEGIN
DECLARE hex CHAR(32);
SET hex = HEX(b);
RETURN CONCAT(LEFT(hex, 8), '-', MID(hex, 9,4), '-', MID(hex, 13,4), '-', MID(hex, 17,4), '-', RIGHT(hex, 12));
END
|