Skip to content

Instantly share code, notes, and snippets.

View StayPirate's full-sized avatar

Gianluca Gabrielli StayPirate

View GitHub Profile
@michelesr
michelesr / nvidia_off.sh
Created March 19, 2022 21:10
Turn NVIDIA discrete card off on Linux
#!/bin/bash
set -ex
CONTROLLER_BUS_ID=0000:00:01.0
DEVICE_BUS_ID=0000:01:00.0
if sudo lsof /dev/nvidia0 ; then
echo 'Some processes are still using the card, aborting.'
exit 1
fi
@Surendrajat
Surendrajat / config.json
Last active September 28, 2024 12:02
A Clean & Customizable Weather module for Waybar
"custom/weather": {
"exec": "python ~/.config/waybar/scripts/weather.py",
"restart-interval": 300,
"return-type": "json",
"on-click": "xdg-open https://weather.com/en-IN/weather/today/l/$(location_id)"
// "format-alt": "{alt}",
},
@vladak
vladak / varmilo keyboard.md
Last active October 21, 2024 18:42
Varmilo keyboard details
@Informatic
Informatic / domain.xml
Last active August 23, 2024 08:39
How to use Windows 10 OEM license in libvirt VM (<smbios mode='host' /> does not work as Windows seems to verify UUID; apparmor/security configuration changes may be needed)
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>
@Luzifer
Luzifer / README.md
Last active August 25, 2024 10:01
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
@pascalpoitras
pascalpoitras / config.md
Last active October 7, 2024 01:35
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@windytan
windytan / emoji.pl
Last active August 14, 2023 14:50
Visualize SSH public key fingerprints using Unicode emoji
# Oona Räisänen 2013
# http://windytan.com
# ssh-keygen -l -f ~/.ssh/id_rsa.pub | perl emoji.pl
@emoji = qw( 🌀 🌂 🌅 🌈 🌙 🌞 🌟 🌠 🌰 🌱 🌲 🌳 🌴 🌵 🌷 🌸
🌹 🌺 🌻 🌼 🌽 🌾 🌿 🍀 🍁 🍂 🍃 🍄 🍅 🍆 🍇 🍈
🍉 🍊 🍋 🍌 🍍 🍎 🍏 🍐 🍑 🍒 🍓 🍔 🍕 🍖 🍗 🍘
🍜 🍝 🍞 🍟 🍠 🍡 🍢 🍣 🍤 🍥 🍦 🍧 🍨 🍩 🍪 🍫
🍬 🍭 🍮 🍯 🍰 🍱 🍲 🍳 🍴 🍵 🍶 🍷 🍸 🍹 🍺 🍻
@aras-p
aras-p / preprocessor_fun.h
Last active November 15, 2024 09:22
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,