Skip to content

Instantly share code, notes, and snippets.

@E14
E14 / stop-lghub.ps1
Created February 17, 2024 14:48
Fix logitech lghub
# Run as administrator!
Get-Process | Where Name -Like 'lghub_*' | Select Id | Kill -Force
@E14
E14 / conversion-status.lua
Created August 27, 2021 10:11
Display OSX disk conversion status
-- Display OSX disk conversion status
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
@E14
E14 / eclipse-code-templates.java
Created April 13, 2021 09:39
Eclipse Java code templates
/// SLF4J class logger
${a:import(org.slf4j.Logger)
}${b:importStatic(org.slf4j.LoggerFactory.getLogger)
}private static final Logger LOG = getLogger(${enclosing_type}.class);
@E14
E14 / Module-Users.md
Created October 14, 2019 14:30
Generate lists of Modules use-ing a module
@E14
E14 / Generator2.lua
Last active September 26, 2019 09:43
Cuberite - protocol upgrade template generator
-- lib/lunajson/src/ is not in default Lua package paths
package.path = 'lib/lunajson/src/?.lua;' .. package.path;
---
-- Put in blockstates to ignore:
local ignore = {
["minecraft:redstone_wire"] = {
east = "none", -- fix property to value
north = "none",
south = "none",
[Desktop Entry]
Type=Application
Name=URL Handler
MimeType=application/x-mswinurl;
Exec=bash -c "python3 -c 'import configparser,sys; c=configparser.ConfigParser(); d=c.read(sys.argv[1]); print(c[\"InternetShortcut\"][\"URL\"])' %f | xargs xdg-open"
@E14
E14 / Default (Linux).sublime-keymap
Last active August 27, 2021 10:22
Sublime text user config
[
{ "keys": ["alt+m"], "command": "toggle_menu"},
{ "keys": ["ctrl+e"], "command": "find_under_expand" },
{ "keys": ["ctrl+shift+e"], "command": "find_under_expand_skip" },
{ "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
]
@E14
E14 / .bashrc
Last active July 26, 2019 22:22
rc
# Appended to end
if [ -d ~/.rc.d ]; then
for i in ~/.rc.d/*.{sh,bash}; do
if [ -r "$i" ]; then
. "$i"
fi
done
unset i
fi
@E14
E14 / ephemeral.service
Last active June 19, 2019 01:21
AWS Ephemeral drives automount
[Unit]
Description=Mount and format ephemeral drives on AWS instances
Before=network.target
[Service]
Type=oneshot
Exec=/opt/bin/prepare-ephemeral
[Install]
WantedBy=network.target
@E14
E14 / app.lua
Created April 23, 2019 23:35
Minimal C-Lua callback
local foo = "INNER";
register(function() print(foo) end);