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/[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/" */
@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 / 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 / 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 / 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 / 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 / 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