Skip to content

Instantly share code, notes, and snippets.

@aki-hp
aki-hp / modorganizer2-nxm-broker.sh
Last active May 12, 2024 08:35
Edited MO2 Broker for rockerbacon's script suite so that even if the NXMHandler fails, the download will still proceed. Might be useful for Steam Deck users (or Flatpak Protontricks users in general).
#!/usr/bin/env bash
# SUPPLY YOUR PERSONAL NEXUS API KEY HERE (nexus_apikey="yourNexusAPIKeyInsideDoubleQuotes")
nexus_apikey="yourNexusAPIKeyInsideDoubleQuotes"
### PARSE POSITIONAL ARGS ###
nxm_link=$1; shift
if [ -z "$nxm_link" ]; then
zenity --ok-label=Exit --ellipsize --error --text \
@davidedmundson
davidedmundson / PlasmaNested.sh
Last active July 15, 2024 02:34
Run plasma from within gamescope
#!/bin/sh
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
## Shadow kwin_wayland_wrapper so that we can pass args to kwin wrapper
## whilst being launched by plasma-session
mkdir $XDG_RUNTIME_DIR/nested_plasma -p
cat <<EOF > $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
#!/bin/sh
@ariankordi
ariankordi / backup.sh
Last active February 10, 2024 00:29
script that automatically backs up my iphone over wifi using idevicebackup2, avahi-daemon, and netmuxd running as usbmuxd i'm too lazy to explain the rest rn (it's more complex because my jailbreak makes it not work when doing it the correct way)
#!/bin/sh
# udid of device that is already paired and wifi enabled on
udid=""
# todo replace with reverse lookup of the mac address??? but it wouldn't be
# the wifi mac address we know it would have to be the anonymized one
# ip neighbor | grep 02:21:21:21:21:21 | awk '{split($0, a, " dev"); printf a[1]}'
ip="192.168.2.21"
# 24 hours
@kfur
kfur / darkreader.js
Last active June 11, 2024 07:35
Dark Reader userscript for Safari browser
// ==UserScript==
// @name DarkReader
// @match *://*/*
// @grant none
// @run-at document-start
// ==/UserScript==
// MIT License
// Copyright (c) 2019 Alexander Shutau
@Darkhogg
Darkhogg / !RebootToOs.md
Last active July 25, 2024 10:49
"Reboot to {OS}" scripts for rEFInd Next Boot selection

Reboot to {OS}

This a collection of notes and files used in my quest to create "Reboot to Windows" and "Reboot to Linux" scripts (and desktop shortcuts) for Linux and Windows respectively that automatically reboot my system and instruct rEFInd to auto-select the appropriate OS entry.

General Information

The key for achieving this is to modify the EFI Variable PreviousBoot with GUID 36d08fa7-cf0b-42f5-8f14-68df73ed3740, which rEFInd uses to store the last entry selected in the menu and, if using the + default entry, will be used to select the default OS. By doing this, we trick rEFInd into booting the OS we choose without having to be physically there to press the keyboard.

@ctechols
ctechols / compinit.zsh
Last active July 12, 2024 18:35
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit