Skip to content

Instantly share code, notes, and snippets.

@WillianTomaz
WillianTomaz / wsl2-with-1password-info.md
Last active May 2, 2025 13:52
Instructions for using 1Password SSH Agent with WSL2 (on Windows 11)

LinkedIn

Saturday, April 22, 2023

How to Use 1Password SSH Agent with WSL2 (on Windows 11)

  • Note:

    • Always look for the official documentation, this tutorial may not suit you as there are new updates to the installation process.
    • References are at the end of the document.
  • Was used:

@JanDeDobbeleer
JanDeDobbeleer / cleanup.sh
Created November 24, 2022 13:22
Matodon cleanup scripts
#!/bin/bash
cd /home/mastodon/live
bin/tootctl media remove --days=7
bin/tootctl preview-cards remove --days=7
bin/tootctl statuses remove --days=3
bin/tootctl media remove-orphans
@nolanlawson
nolanlawson / scaling_mastodon_down.md
Last active November 17, 2024 16:12
Scaling Mastodon down

Scaling Mastodon down

There is already a guide on scaling your Mastodon server up. This is a short guide on scaling your Mastodon server down.

I.e., maybe you want to run a small instance of <100 active users, and you want to keep your cloud costs reasonable. So you might be running everything on a single machine, with limited memory and CPU. (In my case, I was using a t3.medium instance with 2 vCPUs and 4GB of RAM.) How do you do this?

Note that I'm not a Ruby or Sidekiq expert, and most of this stuff I figured out through trial and error.

@quanhua92
quanhua92 / whitelist_bunny.sh
Created August 10, 2022 06:55
Add Bunny.net Edge Server IP Address to UFW firewall
#!/bin/sh
curl -s https://bunnycdn.com/api/system/edgeserverlist -H "Accept: application/json" | jq -r .[] > /tmp/bunny_ips
echo "" >> /tmp/bunny_ips
curl -s https://bunnycdn.com/api/system/edgeserverlist/ipv6 -H "Accept: application/json" | jq -r .[] >> /tmp/bunny_ips
for ip in `cat /tmp/bunny_ips`; do ufw allow proto tcp from $ip comment 'Bunny IP'; done;
@sbyx
sbyx / low-battery-level-detection-notification-for-all-battery-sensors.yaml
Last active May 8, 2025 18:18
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').
@l3nz
l3nz / README.md
Last active August 8, 2023 05:54
NOT Fixed: accountsd using 400% CPU on MacOS Catalina 10.15.7 (19H2)

accountsd using 400% CPU on MacOS Catalina 10.15.7 (19H2)

TL;DR: Still open - see below.

This morning I woke up to some not-so-nice surprise - my 2018 MPB 13" would be kind of totally unusable. The accountsd process was stable at 400%, battery was going like ice-cream in the Sahara, and opening up LibreOffice was like a major achievement.

I did check the logs (that were growing at like 500 lines per second) and I saw a lot of lines at FAULT level:

fault 07:54:04.271342+0200 accountsd Unentitled access by client 'CallHistoryPlugi' (selector: accountsWithAccountType:handler:)

@8bitbuddhist
8bitbuddhist / create-android-display.sh
Last active April 26, 2025 13:12
Bash script to use an Android device as a second monitor for Linux. See https://blog.8bitbuddhism.com/2019/12/01/how-to-use-your-android-tablet-as-second-monitor/ for detailed instructions.
#!/bin/bash
# Make sure your Android device is plugged in and accessible over adb.
#### Remember to enable virtual displays in xorg by adding the following to your configuration (e.g. /usr/share/X11/xorg.conf.d/20-virtual.conf)
# Section "Device"
# Identifier "intelgpu0"
# Driver "intel"
# Option "VirtualHeads" "1"
#EndSection
@xirixiz
xirixiz / pihole-macvlan-synology-docker.txt
Last active December 2, 2024 19:32
Add a PiHole instance on a macvlan enabled Docker network (Synology eth0 example)
#!/bin/bash
# NAS IP: 192.168.1.10 in this example
# DHCP scope reservation for macvlan: 192.168.1.210/28 (Details below)
## Network: 192.168.1.210/28
## HostMin: 192.168.1.211
## HostMax: 192.168.1.224
## Hosts/Net: 14
# Create a Synology macvlan0 bridge network attached to the physical eth0, and add the ip range scope (sudo)
@wderuijter
wderuijter / config.gateway.json
Last active January 24, 2022 10:21
Force internal DNS
{
"service": {
"nat": {
"rule": {
"1": {
"description": "Redirect DNS requests",
"destination": {
"port": "53"
},
"inbound-interface": "eth1",
@pamolloy
pamolloy / README.md
Last active October 16, 2024 20:40
Ubiquiti USG configuration for Wireguard

Download the latest ugw3 package from https://github.com/Lochnair/vyatta-wireguard/releases and install it on your USG using dpkg -i wireguard-ugw3-<version>.deb.

cd /config/auth
umask 077
mkdir wireguard
cd wireguard
wg genkey > wg_private.key
wg pubkey < wg_private.key > wg_public.key