Skip to content

Instantly share code, notes, and snippets.

@limon
limon / pymods.nix
Last active September 18, 2022 11:16
merge python.withPackages
{
config,
pkgs,
lib,
...
}:
with lib; let
pymodsType = mkOptionType {
name = "pymods";
merge = _: defs:

利用 NGINX 的 Stream 模塊 sni_preread 功能,可以做到讓 Trojan 和其他網站在同一台機器上共享 443 端口。

@limon
limon / spotify-ad-restart.sh
Created December 31, 2021 15:37 — forked from 1ttric/spotify-ad-restart.sh
A script to restart Spotify every time an ad is detected as playing
#!/bin/bash
set -e
function spotstop {
killall spotify
echo "[Sent kill signal]"
# Wait for signs of spotify exiting on DBus
grep -m 1 spotify <( exec dbus-monitor "member='RemoveMatch'" ) >/dev/null
kill $! 2>/dev/null
@limon
limon / syntax.s
Created October 14, 2021 14:35 — forked from DmitrySoshnikov/syntax.s
AT&T assembly syntax and IA-32 instructions
# --------
# Hardware
# --------
# Opcode - operational code
# Assebly mnemonic - abbreviation for an operation
# Instruction Code Format (IA-32)
# - Optional instruction prefix
# - Operational code
@limon
limon / com.ubuntu.desktop.pkla
Created July 21, 2021 03:57 — forked from kafene/com.ubuntu.desktop.pkla
/var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla (see: policykit-desktop-privileges)
[Mounting, checking, etc. of internal drives]
Identity=unix-group:admin;unix-group:sudo
Action=org.freedesktop.udisks.filesystem-*;org.freedesktop.udisks.drive-ata-smart*;org.freedesktop.udisks2.filesystem-mount-system;org.freedesktop.udisks2.encrypted-unlock-system;org.freedesktop.udisks2.filesystem-fstab;
ResultActive=yes
[Change CPU Frequency scaling]
Identity=unix-group:admin;unix-group:sudo
Action=org.gnome.cpufreqselector
ResultActive=yes
@limon
limon / default-net.xml
Last active June 7, 2020 02:48
kvm_win10.xml
<network>
<name>default</name>
<uuid>eade2870-423f-4b62-8dfb-0accc02cd73c</uuid>
<forward mode='bridge'/>
<bridge name='br0'/>
</network>
@limon
limon / passthrough.patch
Created May 28, 2020 05:52
AMD Ryzen IOMMU Patch
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 766f5779db92..dc19079dad1b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -52,6 +52,9 @@ unsigned int pci_pm_d3_delay;
static void pci_pme_list_scan(struct work_struct *work);
+static void pci_dev_save_and_disable(struct pci_dev *dev);
+static void pci_dev_restore(struct pci_dev *dev);
@limon
limon / iommu.sh
Created May 28, 2020 05:31 — forked from Roliga/iommu.sh
#!/bin/bash
useColors=true
usePager=true
usage() {
echo "\
Usage: $(basename $0) [OPTIONS]
Shows information about IOMMU groups relevant for working with PCI-passthrough
@limon
limon / PKGBUILD
Created May 9, 2020 02:44 — forked from EHfive/PKGBUILD
给VLC打补丁, 使flac网络文件/流的Content-Type始终为"audio/flac", 以"修复"网易云音乐获取的flac网络文件Content-Type为"audio/mpeg"而导致VLC不能正确识别文件而播放失败的问题
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>
# Contributor: Martin Sandsmark <martin.sandsmark@kde.org>
pkgname=vlc
_vlcver=3.0.6
# optional fixup version including hyphen
_vlcfixupver=
pkgver=${_vlcver}${_vlcfixupver//-/.r}