Skip to content

Instantly share code, notes, and snippets.

View anthony-wang's full-sized avatar
💭
👨‍🔬🖥

Anthony Wang anthony-wang

💭
👨‍🔬🖥
View GitHub Profile
@shawwn
shawwn / syncscroll
Created April 1, 2021 03:24
Synchronized scrolling (and zooming) across browser tabs
javascript:(function()%7Bwindow.addEventListener(%20'scroll'%2C%20(e)%20%3D%3E%20%7B%20localStorage.setItem('scrollY'%2C%20scrollY)%3B%20localStorage.setItem('zoom'%2C%20document.body.style.zoom)%3B%20%7D%20)%3Bwindow.addEventListener(%20'storage'%2C%20(e)%20%3D%3E%20%7B%20if%20(e.key%20%3D%3D%3D%20%22scrollY%22)%20%7B%20y%3DparseInt(e.newValue)%3B%20window.scrollTo(0%2C%20y)%3B%20%7D%3B%20if%20(e.key%20%3D%3D%3D%20%22zoom%22)%20%7B%20document.body.style.zoom%3De.newValue%3B%20%7D%3B%20%7D%20)%7D)()
@sbyx
sbyx / wake-up-light-alarm-with-sunrise-effect.yaml
Last active April 24, 2024 05:37
Home Assistant Blueprint: Wake-up light alarm with sunrise effect
blueprint:
name: Wake-up light alarm with sunrise effect
description: 'A wake-up light alarm with a brightness and color temperature sunrise
effect. Note: Requires date_time_iso sensor in configuration, not manually executable!'
domain: automation
input:
light_entity:
name: Wake-up light entity
description: The light to control. Turning it off during the sunrise will keep
it off. Color temperature range is auto-detected.
@zottelbeyer
zottelbeyer / setup.sh
Last active April 3, 2024 20:08
ipv6 on docker-pihole
# enable ipv6 in dockerd conf:
# cat /etc/docker/daemon.json
{
"ipv6": true,
"fixed-cidr-v6": "2003::/64" # your ipv6. not sure if this is even necessary
}
# reload daemon conf:
sudo systemctl reload docker.service
@tsrivishnu
tsrivishnu / docker-increase-inotify-max-user-watches.md
Last active April 8, 2024 12:15
Increase inotify watchers in Docker images during build

Increasing fs.inotify.max_user_watches for Docker images

TL;DR You can't set those for an image during build time becasue Docker takes the sysctl configuration from the Host. So, set the config on your host machine.

As in this link, to increase the maximum watchers, we need set fs.inotify.max_user_watches to a higher number in /etc/sysctl.conf.

@zoilomora
zoilomora / README.md
Last active April 24, 2024 12:42
How to disable cloud-init in Ubuntu

How to disable cloud-init in Ubuntu

Prevent start

  • Create an empty file to prevent the service from starting

      sudo touch /etc/cloud/cloud-init.disabled
    

Uninstall

@zoilomora
zoilomora / README.md
Last active April 25, 2024 08:17
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@Overbryd
Overbryd / unbound.conf
Created March 29, 2019 14:54
A pretty good unbound.conf, DNSSEC, caching and local forwarding
remote-control:
control-enable: yes
server:
do-ip6: no
do-ip4: yes
do-udp: yes
tls-cert-bundle: /etc/ssl/certs/ca-certificates.crt
num-threads: 4
# Enable logs
verbosity: 1
@vinayak-mehta
vinayak-mehta / disease_outbreaks_camelot.ipynb
Last active November 5, 2023 18:54
A jupyter notebook showing how Camelot can be used to extract tables from PDFs scraped from the IDSP website.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anthony-wang
anthony-wang / spotify-hosts.txt
Last active March 20, 2024 02:12
The hosts file entries to block Spotify ad servers
# Use this to block Spotify ad servers
# sources:
# https://www.reddit.com/r/Piracy/comments/4kn6rq/comprehensive_guide_to_blocking_ads_on_spotify/
# https://gist.github.com/teomaragakis/cb187d880c9a3ca2c8a2
# https://gist.github.com/Shujito/b7a8f8f971b22f49b4313d7d3e8e6931
# https://gist.github.com/rifkyekayama/f7c43e470f23878b20416e68f73829dc
# https://gist.github.com/shokoylele/8f4160a102480471cb946fbd800bc86a
############## Begin manual list
# 127.0.0.1 spclient.wg.spotify.com # might block the entire Spotify app from working too
@deergod1
deergod1 / pfSense config.md
Last active April 5, 2023 10:39
pfSense Easy Configuration Guide for HP t620 Plus

pfSense Simple Home Configuration - 2.4.3 / 2.4.4

Starting from Scratch

This is my personal guide for installing pfSense. Hope you find it useful. I made these notes to capture the details of my "install from scratch" to ensure I didn't miss important details. Also, I'm trying build my network with discrete "disposable" components that make the system mutable and less rigid. It does not cover installing any packages like Squid or Suricata as that's way beyond the scope of a basic, functional install.

I migrated from an environment that was at various times running Tomato Toastman 1.28 or Asuswrt-Merlin on Netgear and ASUS routers across four "access points" (one always acting as the firewall/gateway, the rest as APs). It was OK pre-gigabit, but had roaming problems, and I was using large Wifi routers with most of the features disabled. Also, I found that I could easily swamp the network and tank VOIP and Wifi Calling without even trying. The only fix was to throttle everything by using Bandwidth Limit