Skip to content

Instantly share code, notes, and snippets.

@agingorange
agingorange / DellXPS15_9560_AHCI_RAID.md
Created May 25, 2023 22:30 — forked from chenxiaolong/DellXPS15_9560_AHCI_RAID.md
Switching between AHCI and RAID on the Dell XPS 15 (9560)

Switching between AHCI and RAID on the Dell XPS 15 (9560)

This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.

Switching from RAID to AHCI

Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.

  1. To set the default boot mode to Safe Mode, use msconfig.exe or open an admin cmd/PowerShell window and run:
@agingorange
agingorange / fixpopclock.sh
Created April 15, 2023 12:24 — forked from GrumpyChunks/fixpopclock.sh
Fix for Pop_OS not correctly using the 24 hour clock when the locale is set to a timezone that should default to a 24 hours clock
#!/bin/bash
sudo sed -i "/\[org\/gnome\/desktop\/interface\]/a\clock-format=\'24h\'" /etc/gdm3/greeter.dconf-defaults
gsettings set org.gtk.Settings.FileChooser clock-format 24h
gsettings set org.gnome.desktop.interface clock-format 24h
@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/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@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 / 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 / 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 / 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/