Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/env python
# run with python generate-domains-blacklist.py > list.txt.tmp && mv -f list.txt.tmp list
import argparse
import re
import sys
try:
import urllib2 as urllib
@eklex
eklex / 80-mount-usb-to-media-by-label.rules
Last active September 14, 2024 11:22
udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory
#
# udev rule
# Mount USB drive to the media directory using the partition name as mount point
#
# Description:
# Created for Home Assistant OS, this rule mounts any USB drives
# into the Hassio media directory (/mnt/data/supervisor/media).
# When a USB drive is connected to the board, the rule creates one directory
# per partition under the media directory. The newly created partition is named
# as the partition name. If the partition does not have a name, then the following
#!/bin/bash
NETGROUP="5ac902e89c29dc0273fb5490"
TMP_DIR="/tmp"
LIST_FILE_PATH="$TMP_DIR/external_ip_block"
LOGGING_DIR="/var/log"
DRY_RUN=0
NOW=`date +"%Y-%m-%d %T"`
START_TIME=`date +"%T"`
SCRIPT_FILE_NAME=`basename "$0"`
@eklex
eklex / dnscrypt-proxy_update_dns_blacklist.sh
Last active September 29, 2022 02:06
Update DNS blacklist for dnscrypt-proxy
#!/bin/bash
DNSCRYPT_DIR="/config/dnscrypt-proxy"
DNSCRYPT_UTILS_DIR="$DNSCRYPT_DIR/utils"
DNSCRYPT_BIN="$DNSCRYPT_DIR/dnscrypt-proxy"
LOGGING_DIR="/var/log"
export PATH=$PATH:/usr/sbin:$DNSCRYPT_DIR
NOW=`date +"%Y-%m-%d %T"`
@eklex
eklex / dnscrypt-proxy_utils_get_latest_version.sh
Last active February 1, 2020 03:09
Get latest version of dnscrypt-proxy utils
#!/bin/bash
NOW=`date +"%Y-%m-%d_%T"`
BASE_LOCAL_DIR="."
LOCAL_DIR="$BASE_LOCAL_DIR/$NOW"
BASE_URL="https://raw.githubusercontent.com/DNSCrypt/dnscrypt-proxy/master/utils/generate-domains-blacklists"
FILES=(
"generate-domains-blacklist.py"
"domains-whitelist.txt"