Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / zot_rm_empty_folders.py
Last active February 1, 2023 07:44
remove empty folders in `storage`
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
import configparser
import re
import shutil
import sys
@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 / periodic_table.py
Last active December 1, 2023 11:20
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 / zot_rm_unmaintained_files.py
Last active March 11, 2024 11:05
remove files not maintained by zotero
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
import configparser
import re
import shutil
import sqlite3
import sys