Skip to content

Instantly share code, notes, and snippets.

@specter119
specter119 / 90-wsl-shortcuts-control.hook
Last active July 2, 2025 03:35
/usr/share/libalpm/hooks/90-wsl-shortcuts-control.hook for proventing wsl add too much desktop entry into host windows, /etc/wsl.d/desktop_whitelist is the file list, without .desktop suffix
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/share/applications/*.desktop
[Action]
Description = Control WSL application shortcuts by setting Terminal=true
When = PostTransaction
Exec = /bin/bash -c 'for f in /usr/share/applications/*.desktop; do app=$(basename "$f" .desktop); while read -r w; do [ "$w" = "$app" ] && continue 2; done < /etc/wsl.d/desktop_whitelist 2>/dev/null; sed -i "/^Terminal=false$/ s//Terminal=true/" "$f"; done'
@specter119
specter119 / flex.grub
Created March 6, 2023 13:15 — forked from DennisLfromGA/flex.grub
Script for ChromeOS Flex to add cros_debug / dev mode option in grub.cfg
### Script to add cros_debug / dev mode option in grub.cfg
### ( Each Flex update removes cros_debug / dev mode option
### Be sure to run this script AFTER each update and BEFORE rebooting )
ANS=
ROOTDEVICE=
ROOTDEVICEPREFIX=
P12MOUNTPOINT=/var/p12
GRUBCFGPATH=$P12MOUNTPOINT/efi/boot
GRUBCFGFILE=grub.cfg
@specter119
specter119 / export-ble-infos.py
Created September 29, 2020 11:30 — forked from 5shekel/export-ble-infos.py
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Export your Windows Bluetooth LE keys into Linux! (arch edition)
Thanks to: http://console.systems/2014/09/how-to-pair-low-energy-le-bluetooth.html
discussed here: https://unix.stackexchange.com/questions/402488/dual-boot-bluetooth-device-pairing
Usage:
$ ./export-ble-infos.py <args>
$ sudo bash -c 'cp -r ./bluetooth /var/lib'
@specter119
specter119 / papirus-icon-kde.hook
Last active November 11, 2019 11:12
papirus-icon-kde.hook should put in /usr/share/libalpm/hooks/, fix "gnome" not found.
[Trigger]
Operation = Install
Operation = Upgrade
Type = Path
Target = usr/share/icons/*Papirus*/index.theme
[Action]
Description = Remove unused theme name from papirus-icon-theme
When = PostTransaction
Exec = /bin/sh -c "/usr/bin/sed -i.orig '/Inherits/ s/gnome,\?//g' /usr/share/icons/{ePapirus,Papirus,Papirus-Light,Papirus-Dark}/index.theme"
@specter119
specter119 / PKGBUILD
Created November 11, 2019 06:12
ttf-ms-win10 with more chinese fonts
# Maintainer: Michael Lass <[email protected]>
# Maintainer: Doug Newgard <scimmia at archlinux dot info>
# Contributor: reflexing <[email protected]>
# Instructions were copied from ttf-ms-win8 and slightly modified:
#
# BUILD INSTRUCTIONS:
# -------------------
#
# Please note, that usage of Microsoft fonts outside running Windows
@specter119
specter119 / aur-matlab.patch
Last active May 13, 2019 04:49
patch for AUR Matlab to enable login installation
diff --git a/PKGBUILD b/PKGBUILD
index a97c0b9..7b37fba 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -40,6 +40,7 @@
# partial install
_partialinstall=false
+_logininstall=true
@specter119
specter119 / periodic_table.py
Last active October 30, 2024 14:53
Plot periodic table with Pymatgen and Matplotlib
import re
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.collections import PatchCollection
from pymatgen.core.periodic_table import Element
class PeriodicTablePlotter(object):
@specter119
specter119 / Microsoft_Office_2019_VL_Serializer.pkg
Created February 8, 2019 12:49 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file
This file has been truncated, but you can view the full file.
@specter119
specter119 / fix_csl_gbt7714.vb
Last active January 6, 2021 03:15
Fix multiple locale et al in GB/T 7714 bibliography generated by Zotero(csl) for MS-Word
Sub deng2etal()
'
' deng2etal macro
' English等 -> english, et al
'
With Selection.Find
.Forward = True
.ClearFormatting
.Text = "(<[A-z]@)等"
With .Replacement
@specter119
specter119 / PKGBUILD
Created September 29, 2018 12:51
aur-suitesparse-mkl
# Maintainer: Israel Herraiz <[email protected]>
pkgname=suitesparse-mkl
pkgver=5.2.0
pkgrel=1
pkgdesc="A collection of sparse matrix libraries (compiled with the Intel MKL lib)"
url="http://faculty.cse.tamu.edu/davis/suitesparse.html"
arch=('i686' 'x86_64')
conflicts=('umfpack' 'suitesparse')
provides=('umfpack' 'suitesparse=${pkgver}')