Skip to content

Instantly share code, notes, and snippets.

@agingorange
agingorange / multi_pihole.md
Created April 5, 2022 21:49 — forked from 0xmachos/multi_pihole.md
How to configure two Pi-holes on the same network

Multiple Pi-holes

In this scenario we are configuring two Pi-holes running on the same network. pihole0 is the main DNS server while pihole1 is the secondary.

  • pihole0
    • 192.168.1.4
    • http://pi.hole0/admin/
  • pihole1
    • 192.168.1.5
  • http://pi.hole1/admin/
@agingorange
agingorange / README.md
Created April 11, 2022 08:24 — forked from yorickdowne/README.md
Ubuntu Desktop 20.04 with mirrored ZFS boot drive

Overview

Ubuntu Desktop 20.04 supports a single ZFS boot drive out of the box. I wanted a ZFS mirror, without going through an entirely manual setup of Ubuntu as described by OpenZFS

This adds a mirror to an existing Ubuntu ZFS boot drive after the fact.

ZFS requires native encryption to be added at pool / dataset creation. Ubuntu 21.04 supports this during installation. Whether these instructions are suitable for mirroring such a setup has not been tested. For Ubuntu 20.04, these instructions are not suitable for creating an encrypted ZFS boot disk, please use the full instructions linked above for that. You can, however, add an encrypted dataset after the fact: You could encrypt just the portion of your file system that holds secrets.

Note: If your use case is running docker instances, and not a full-fledged Ubuntu install, then take a look at TrueNAS SCALE

@agingorange
agingorange / cloudflare-ddns-updater.service
Created April 12, 2022 03:35
Systemd service file for Cloudflare DDNS updater
# https://github.com/K0p1-Git/cloudflare-ddns-updater
[Unit]
Description=Cloudflare DDNS updater
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/cloudflare-ddns-updater.sh
@agingorange
agingorange / cloudflare-ddns-updater.timer
Created April 12, 2022 03:37
Systemd timer file for Cloudflare DDNS updater
[Unit]
Description=Timer for Cloudflare DDNS updater
[Timer]
OnCalendar=*:0/5
Persistent=true
[Install]
WantedBy=timers.target
@agingorange
agingorange / userChrome.css
Created July 19, 2022 17:41
Firefox script to move tabs, address bar, etc to the bottom.
@-moz-document url(chrome://browser/content/browser.xhtml) {
/* tabs on bottom of window */
/* requires that you set
* toolkit.legacyUserProfileCustomizations.stylesheets = true
* in about:config
*/
#mainPopupSet ~ box { -moz-box-ordinal-group: 10; }
#titlebar { -moz-box-ordinal-group: 10; }
#urlbar {
top: unset !important;
@agingorange
agingorange / no-file-name
Created July 25, 2022 06:18
Make JetBrains apps work under a WM
---
For the window manager (here in bspwmrc):
# For java apps (Jetbrains)
export _JAVA_AWT_WM_NONREPARENTING=1
wmname LG3D &
---
In idea.properties of the JetBrains app (see URL):
@agingorange
agingorange / tmux-256color
Created July 26, 2022 19:51
tmux-256color terminfo for macOS
# /usr/bin/tic -x <this_file>
# Reconstructed via infocmp from file: /usr/share/terminfo/t/tmux-256color
tmux-256color|tmux with 256 colors,
OTbs, OTpt, am, hs, km, mir, msgr, xenl, AX, G0,
colors#256, cols#80, it#8, lines#24, pairs#32767, U8#1,
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
@agingorange
agingorange / add_capslock_ctrl.sh
Created August 4, 2022 07:21 — forked from zw963/add_capslock_ctrl.sh
A script which change Capslock to Ctrl, and change rightAlt to Capslock for GNOME + Wayland for Arch linux.
#! /bin/bash
if ! fgrep -qs 'ctrl:new_ctrl = +new_ctrl(new_ctrl)' /usr/share/X11/xkb/rules/evdev; then
sudo sed -i.bak '/ctrl:nocaps[[:blank:]]*=[[:blank:]]*+ctrl(nocaps)/a\
ctrl:new_ctrl = +new_ctrl(new_ctrl)
' /usr/share/X11/xkb/rules/evdev
fi
cat <<'HEREDOC' |sudo tee /usr/share/X11/xkb/symbols/new_ctrl
partial modifier_keys
@agingorange
agingorange / alacritty-tmux-vim_truecolor.md
Created August 4, 2022 15:49 — forked from andersevenrud/alacritty-tmux-vim_truecolor.md
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
@agingorange
agingorange / obsidian-web-clipper.js
Created January 15, 2023 10:55 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */