Skip to content

Instantly share code, notes, and snippets.

View XenHat's full-sized avatar
🛠️

XenHat XenHat

🛠️
  • Quebec, Canada
  • 13:45 (UTC -04:00)
  • X @XenHat
View GitHub Profile
@ChristianSilvermoon
ChristianSilvermoon / web-link-handler.sh
Created October 4, 2024 22:10
A script to open certain kinds of links with certain programs
@v-fox
v-fox / NVMe_tweaks.md
Last active July 3, 2025 01:19
Linux kernel optimizations for NVMe

By default Linux distros are unoptimized in terms of I/O latency. So, here are some tips to improve that.

Most apps still don't do multi-threaded I/O access, so it's a thread-per-app which makes per-app speed always bottlenecked by single-core CPU performance (that's not even accounting for stuttering on contention between multiple processes), so even with NVMe capable of 3-6 GB/s of linear read you may get only 1-2 GB/s with ideal settings and 50-150/100-400 MB/s of un/buffered random read (what apps actually use in real life) is the best you can hope for.

All writes are heavily buffered on 3 layers (OS' RAM cache, device's RAM cache, device's SLC-like on-NAND cache), so it's difficult to get real or stable numbers but writes are largelly irrelevant for system's responsiveness, so they may be sacrificed for better random reads.

The performance can be checked by:

  • `fio --name=read --readonly --rw={read/randread} --ioengine=libaio --iodepth={jobs_per_each_worker's_command} --bs={4k/2M} --direct={0/1} --num
@XenHat
XenHat / install_viewer_dev_env.ps1
Last active September 9, 2022 00:53
Install SL Viewer dev env
# https://gist.github.com/XenHat/fafa4697b51c3279f74967609af03120
#
# Settings
# Needs quotes
GitVersion="2.28.0"
#
#
#
#
# Self-Elevate
@XenHat
XenHat / cloudSettings
Last active January 2, 2022 08:49
Old Visual Studio Code Settings Sync Gist
{"lastUpload":"2022-01-02T08:49:16.852Z","extensionVersion":"v3.4.3"}
@XenHat
XenHat / OEMBIOSFields.md
Last active August 9, 2018 20:57
OEM Fields explanation by Peter M. Dodge

Explanation of the keys

Manufacturer:

This is a string containing the manufacturer. Microsoft encourages system builders to put their name here, if theyre not a company, but you can put what you want.

Model:

A model number string for the computer, ie "Brendr I VTE-001-001 (w/ ASUSTek P5G41C-M)

@Scrumplex
Scrumplex / 50-udisks.rules
Last active June 27, 2025 22:42
Polkit rules for udisks, and udisks2. Compatible with udiskie and Dolphin.
// Original rules: https://github.com/coldfix/udiskie/wiki/Permissions
// Changes: Added org.freedesktop.udisks2.filesystem-mount-system, as this is used by Dolphin.
polkit.addRule(function(action, subject) {
var YES = polkit.Result.YES;
// NOTE: there must be a comma at the end of each line except for the last:
var permission = {
// required for udisks1:
"org.freedesktop.udisks.filesystem-mount": YES,
"org.freedesktop.udisks.luks-unlock": YES,
@samoshkin
samoshkin / toggle_keybindings.tmux.conf
Last active June 28, 2025 14:39
tmux.conf excerpt to toggle on/off session keybindings and prefix handling
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
@XenHat
XenHat / unbloat.ps1
Last active November 5, 2017 22:18
Uninstall Default Windows 8+ Modern Apps
$WMI = get-appxpackage -allusers | Where-Object { $_.name -NotMatch ".NET" <# NEVER DELET DIS #>`
<# System Apps #>`
-And $_.name -NotMatch "1527c705-839a-4832-9118-54d4Bd6a0c89" `
-And $_.name -NotMatch "AccountsControl" `
-And $_.name -NotMatch "BioEnrollment" `
-And $_.name -NotMatch "BrokerPlugin" `
-And $_.name -NotMatch "c5e2524a-ea46-4f67-841f-6a9465d9d515" `
-And $_.name -NotMatch "ChxApp" `
-And $_.name -NotMatch "communication" `
-And $_.name -NotMatch "ContactSupport" `
@Sei-Lisa
Sei-Lisa / include-if-preprocessor-active.lsl
Last active October 15, 2017 16:17
LSL Trick: Do something when the file is run through a preprocessor, and something different otherwise
string dummy="/*\
";
// insert here code that will only be compiled when the preprocessor is active
#include "debug.h"
/*/""; // separator line
// insert here code that will only be compiled when the preprocessor is inactive
debug(string s){llOwnerSay(s);}
@lucario
lucario / reddit.json
Last active February 22, 2020 08:55
Reddit webhook for IFTTT and Discord
{
"username": "Reddit",
"avatar_url": "https://lh3.googleusercontent.com/J41hsV2swVteoeB8pDhqbQR3H83NrEBFv2q_kYdq1xp9vsI1Gz9A9pzjcwX_JrZpPGsa=w300",
"embeds": [{
"color": "16597762",
"author": {
"name": "{{Author}}"
},
"title": "{{Title}}",
"url": "{{PostURL}}",