Skip to content

Instantly share code, notes, and snippets.

@jlpouffier
jlpouffier / configuration.yaml
Created August 5, 2023 20:41
Home Assistant Hot Tip of the Day: Home Occupancy Sensor
# https://www.home-assistant.io/integrations/template/
template:
- binary_sensor:
- name: home_occupied
unique_id: home_occupied
state: "{{states('zone.home')|int > 0}}"
device_class: occupancy
attributes:
is_home_full: "{{states('zone.home')|int == expand(states.person)|list|count}}"
@bwbaugh
bwbaugh / server-name-wordlist-mnemonic.txt
Last active July 12, 2024 21:03
Server name wordlist (mnemonic)
# Original blog post: <https://mnx.io/blog/a-proper-server-naming-scheme/>
# Original word list: <http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt>
# Sample usage: `curl <gist> | tail --lines +4 | shuf | head --lines 1`
acrobat
africa
alaska
albert
albino
album
alcohol
@kyledrake
kyledrake / ferengi-plan.txt
Last active July 10, 2024 18:51
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@brwyatt
brwyatt / LinkShortener.pl
Last active December 29, 2015 21:19
An irssi script to shorten long links using brwyatt.net (my personal site)
#!/usr/bin/perl -w
use strict;
use Irssi;
require LWP::UserAgent;
use vars qw($VERSION %IRSSI);
$VERSION = "0.1";
%IRSSI = (
@millisami
millisami / gist:3798773
Created September 28, 2012 09:04 — forked from juanje/gist:3797297
Mount apt cache of a Vagrant box in the host to spin up the packages installation

This is a little trick I use to spin up the packages instalation on Debian/Ubuntu boxes in Vagrant.

I add a simple function that checks if a directory named something similar to ~/.vagrant.d/cache/apt/opscode-ubuntu-12.04/partial (it may have another path in Windows or MacOS) and create the directory if it doesn't already exist.

def local_cache(box_name)
  cache_dir = File.join(File.expand_path(Vagrant::Environment::DEFAULT_HOME),
                        'cache',
                        'apt',
                        box_name)