Skip to content

Instantly share code, notes, and snippets.

@ErikFontanel
ErikFontanel / filter-youtube-domains.sh
Last active February 18, 2025 09:33
Pi-hole Youtube ad blocking
#!/bin/sh
# This script will fetch the Googlevideo ad domains and append them to the Pi-hole block list.
# Run this script daily with a cron job (don't forget to chmod +x)
# More info here: https://discourse.pi-hole.net/t/how-do-i-block-ads-on-youtube/253/136
# File to store the YT ad domains
FILE=/etc/pihole/youtube.hosts
# Fetch the list of domains, remove the ip's and save them
curl 'https://api.hackertarget.com/hostsearch/?q=googlevideo.com' \
@roycewilliams
roycewilliams / pwnedpasswords-v2-top20k.txt
Last active January 4, 2025 03:16
pwnedpasswords-v2-top20k.txt
#------------------------------------------------------------------------------
# Top 20K hashes from the Troy Hunt / haveibeenpwned Pwned Passwords list v2 (2018-02-21)
# with frequency count and cracked plaintext passwords
#
# The latest version of this file can be found here:
# https://gist.github.com/roycewilliams/281ce539915a947a23db17137d91aeb7
#
# NOTE: THIS FILE IS DEPRECATED.
# The equivalent of this file, but based on v6 of the Pwned Passwords, is here:
# https://gist.github.com/roycewilliams/226886fd01572964e1431ac8afc999ce
@calebporzio
calebporzio / fa.sublime_snippet
Last active April 8, 2018 01:34
Font Awesome sublime snippet for creating icon tags
<snippet>
<content><![CDATA[
<i class="fa fa-fw fa-${1}"></i>&nbsp;
]]></content>
<tabTrigger>fa</tabTrigger>
<description>Font Awesome Icon</description>
<scope>text.blade, text.html.blade, text.html</scope>
</snippet>
parameters:
file_upload_mime_types:
- application/pdf
- application/x-pdf
- text/plain
- application/rtf
- image/*
- application/msword
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
@sephii
sephii / certcheck.py
Last active February 3, 2020 07:39
Check for letsencrypt/certbot certificates expiry date. Can be run in a cron
#!/usr/bin/env python3
"""
Usage: certcheck.py host1 host2 hostN. Will exit with status code 1 if any of the hosts is about to expire (see
WARNING_DAYS below).
"""
from datetime import datetime
import socket
import ssl
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active June 20, 2025 07:25
Hyperlinks in Terminal Emulators
PHP Extensions Tutorial
The best way to learn about writing extensions is - to write an
extension! If you want to "code along", you'll need to be set up to
compile PHP 7 extensions, have a checkout of the example code we'll be
using, and have the C library we'll be "wrapping" available on your
system.
All the code we'll be working with is available from
https://github.com/auroraeosrose/php-extensions-code
<?php
/**
* This is the clock interface. It's really simple, you write it once, use it anywhere.
* Cool extra things you can do:
* - have it return custom value objects
* - separate method for currentDate() without time part
*/
interface Clock
{
@sleepyfox
sleepyfox / net-negative-producers.md
Last active November 11, 2024 13:23
A blog post from @sleepyfox in 2012 on developer productivity and net-negative producers

Net-negative producers

author: @sleepyfox date: 13-May-2012

How on earth could a set-top-box app software development team (basically a simple Linux UI app to parse a programme and stream some video?) have 20 people on it, when surely 4 or 5 should be more than enough?' a friend asked.

In answer I told him the story of when I started on an assignment for Hutchinson 3G in their new posh glass building in Maidenhead, working in the new 3G products division in early 2002 producing what were essentially a bunch of web apps. I asked my boss how many people were working on the project: "350" was his reply. My jaw dropped to the floor. "Don't worry," he said with a smile on his face "all the real work is being done by nine guys working in a back room of the pub over the road. This new glass building is just a decoy to confuse Vodafone and Orange!"

How on earth could it possibly take 350 people (DBAs, Product Managers, Proect Managers, Architects, BAs, QAs, Developers) to produce a bunch of simple web apps? I si