Skip to content

Instantly share code, notes, and snippets.

@Thermionix
Thermionix / userDefineLang_Groovy.xml
Last active January 18, 2024 21:20
Groovy user defined language for notepad++
<NotepadPlus>
<UserLang name="Groovy" ext="groovy" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">03/* 04*/ 00// 01 02</Keywords>
<Keywords name="Keywords1">abstract break case catch continue default do else extends final finally for if implements instanceof native new private protected public return static switch synchronized throw throws transient try volatile while strictfp package import false null super this true</Keywords>
<Keywords name="Keywords2">as assert def mixin property test using in it</Keywords>
@Thermionix
Thermionix / local.rules
Created May 17, 2012 01:58
usb hdd sync via udev & rsync
# /etc/udev/rules.d/local.rules
# ADD rule: if we have a valid ID_FS_LABEL_ENC, and it's USB, mkdir and mount
ENV{ID_FS_LABEL_ENC}=="?*", ACTION=="add", SUBSYSTEMS=="usb", \
RUN+="/usr/local/sbin/udev-automounter.sh %k"
@Thermionix
Thermionix / gist:2715786
Created May 17, 2012 02:35
APC SC1000 UPS apcupsd usb serial adapter configuration
# use lsusb to find the details of the serial adapter to create a udev rule
~$ lsusb | grep Serial
Bus 003 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
# based on the output from lsusb add a rule to /etc/udev/rules.d/local.rules
~$ cat /etc/udev/rules.d/local.rules
#Bus 004 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port"
@Thermionix
Thermionix / mount.iso.psm1
Last active November 15, 2022 10:39
powershell mount/unmount iso for all versions of windows
# Uses http://www.ltr-data.se/opencode.html/#ImDisk virtual disk driver for windows 7 or less
# Tries to use chocolatey to install imdisk
# Sample use case:
# Import-Module ".\mount.iso.psm1"
# Invoke-IsoExe "C:\test.iso" "setup.exe" "/passive"
function Mount-Iso([string] $isoPath)
{
if ( -not (Test-Path $isoPath)) { throw "$isoPath does not exist" }
@Thermionix
Thermionix / fedora.citrix.workspace.sh
Last active November 9, 2022 06:57
Install Citrix Workspace App on Fedora 32
#!/bin/sh
#Install Citrix Workspace App on Fedora 32
#Download Client From https://www.citrix.com/en-au/downloads/workspace-app/linux/workspace-app-for-linux-latest.html
sudo dnf install -y ICAClientWeb-rhel-20.04.0.21-0.x86_64.rpm
sudo dnf install -y compat-openssl10.x86_64
# Update libcrypto reference in desktop file
sudo sed -i '/Exec=/d' /usr/share/applications/wfica.desktop
@Thermionix
Thermionix / fedora.post.install.sh
Last active January 19, 2022 09:39
Fedora post install script
#!/bin/sh
## fix touchpad rightclick and middle click
gsettings set org.gnome.desktop.peripherals.touchpad click-method 'areas'
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
#/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding '<Primary><Alt>t'
#/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command 'gnome-terminal &'
#/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name 'Launch Terminal'
@Thermionix
Thermionix / auth-basic.conf
Last active November 4, 2021 00:56
nginx reverse proxy for sickbeard, couchpotato etc.
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
@Thermionix
Thermionix / grub.cfg
Last active June 7, 2021 17:47
grub2 loopback multiboot flash drive
moved to https://github.com/Thermionix/multipass-usb
@Thermionix
Thermionix / purge-old-kernels
Last active April 19, 2018 17:22
cron script for ubuntu servers to automatically purge old kernels, quickly insert with; curl https://gist.github.com/Thermionix/7797652/raw/purge-old-kernels | bash
#!/bin/bash
cat <<-'EOF' | sudo tee /usr/local/sbin/purge-old-kernels
#!/bin/sh
#This script will keep the currently running kernel and 2 latest
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
if [ "$(id -u)" != 0 ]; then
echo "ERROR: This script must run as root." 1>&2
@Thermionix
Thermionix / dnscrypt-setup.sh
Last active November 20, 2017 03:26
quick setup for dnscrypt + dnsmasq on arch
#!/bin/bash
## chose a provider from;
# less /usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv
sudo pacman -Sy --noconfirm dnscrypt-proxy dnsmasq dnsutils
cat <<-'EOF' | sudo SYSTEMD_EDITOR=tee systemctl edit dnscrypt-proxy.service
[Service]
ExecStart=