Skip to content

Instantly share code, notes, and snippets.

View bbigras's full-sized avatar

Bruno Bigras bbigras

  • Laval, Québec
  • 08:27 (UTC -04:00)
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 28, 2024 12:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sbyx
sbyx / low-battery-level-detection-notification-for-all-battery-sensors.yaml
Last active April 27, 2024 18:33
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
name: Low battery level detection & notification for all battery sensors
description: Regularly test all sensors with 'battery' device-class for crossing
a certain battery level threshold and if so execute an action.
domain: automation
input:
threshold:
name: Battery warning level threshold
description: Battery sensors below threshold are assumed to be low-battery (as
well as binary battery sensors with value 'on').
@sharunkumar
sharunkumar / adb-dns.bat
Created February 7, 2020 07:08
Enabling / Disabling private DNS in android via ADB
rem to disable private dns
adb shell settings put global private_dns_mode off
rem to enable private dns with hostname (example with dns.adguard.com)
adb shell settings put global private_dns_mode hostname
adb shell settings put global private_dns_specifier dns.adguard.com
@shamil
shamil / mount_qcow2.md
Last active April 25, 2024 09:25
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
@Blackshome
Blackshome / bathroom-humidity-exhaust-fan.yaml
Last active April 18, 2024 21:19
bathroom-humidity-exhaust-fan.yaml
blueprint:
name: Bathroom Humidity Exhaust Fan
description: >
# 🚿 Bathroom Humidity Exhaust Fan
**Version: 2.3**
Step into the future of freshness - customize it your way and let the automated fan system handle the humidity control for you! 🌿🚿
@MateusRodCosta
MateusRodCosta / Improved Microphone (Male voices, with Noise Reduction).json
Last active April 13, 2024 19:53
An EasyEffects preset created for input devices (intended for Microphones). Please read the README.md.
{
"input": {
"blocklist": [],
"compressor": {
"attack": 20.0,
"boost-amount": 6.0,
"boost-threshold": -72.0,
"hpf-frequency": 10.0,
"hpf-mode": "off",
"input-gain": 0.0,
@chrisboulton
chrisboulton / ip_blacklist.lua
Last active April 2, 2024 10:43
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
--
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
--
-- block an ip:
-- redis-cli SADD ip_blacklist 10.1.1.1
-- remove an ip:
@vedang
vedang / hey_notmuch!
Last active March 29, 2024 17:48
Notmuch configuration for Hey.com Style workflows.
- Specific Notmuch filters (and saved-searches) for:
+ The Feed (newsletters, blogs)
+ The Paper trail (receipts, ledger)
+ Screened Inbox (mail from folks you actually want to read)
+ Previously Seen (important mail that you've already read)
+ Unscreened Inbox (potential spam / stuff you don't want)
- Elisp Functions to move / categorize emails from a particular sender.
+ Adds tags needed by filters defined above to all email sent by a particular sender
+ Creates an entry in a DB file, which is used by the Notmuch post-new script when indexing new email, to auto-add the relevant tags.
@fabian-thomas
fabian-thomas / orgzly-sync.sh
Last active February 24, 2024 20:59
Orgzly auto syncronisation for sync tools like syncthing. See orgzly/orgzly-android#8.
#!/data/data/com.termux/files/usr/bin/bash
# https://github.com/orgzly/orgzly-android/issues/8
orgzly_sync() {
# if you are using orgzly-revived use the following instead:
# am broadcast -n com.orgzlyrevived/com.orgzly.android.ActionReceiver -a com.orgzly.intent.action.SYNC_START
am broadcast -n com.orgzly/com.orgzly.android.ActionReceiver -a com.orgzly.intent.action.SYNC_START
}