Skip to content

Instantly share code, notes, and snippets.

@Blackdixxa
Blackdixxa / update_unbound_list.sh
Last active May 20, 2018 15:28
Cron to update unbound_ad_servers. I've setted it up weekly on every sunday at 5am . "0 5 * * 0 /etc/cron.weekly/update_unbound_list.sh"
#!/bin/bash
curl "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=unbound&showintro=1&mimetype=plaintext" > /etc/unbound/unbound_ad_servers
/etc/init.d/unbound restart
@Blackdixxa
Blackdixxa / 10_restore-custom.sh
Last active September 1, 2022 16:52 — forked from LordVeovis/10_restore-custom.sh
Restore custom config into edgerouter
#!/bin/bash
# to be stored into /config/scripts/post-config.d/10_restore-custom.sh
config_root=/config/user-data/root/
cp /config/user-data/root/sbin/dhclient3 /sbin/
dpkg -i /config/user-data/root/unbound_install/*.deb
mkdir /unbound_install
mkdir -p /var/log/vlmcsd
@Blackdixxa
Blackdixxa / install_packages.sh
Last active February 10, 2021 22:58
script you need to create in /config/scripts/post-config.d to retain apps installed on firmware update
#!/bin/bash
doneit='/var/lib/my_packages'
packages='dnsutils unbound vim nano wget'
if [ -e $doneit ]; then
exit 0;
fi
sudo dpkg --configure -a
apt-get update
@Blackdixxa
Blackdixxa / unbound_ad_servers
Last active May 7, 2018 14:39
Fichier anti-pub pour dns unbound.
#
# For more information about this list, see: https://pgl.yoyo.org/adservers/
# ----
# last updated: Sat, 05 May 2018 18:50:23 GMT
# entries: 2651
# format: unbound (unbound -- for use with the Unbound DNS server)
# credits: Peter Lowe - pgl@yoyo.org - https://pgl.yoyo.org/ - https://twitter.com/pgl
# this URL: http://pgl.yoyo.org/adservers/serverlist.php?hostformat=unbound&showintro=0&mimetype=plaintext
# other formats: https://pgl.yoyo.org/adservers/formats.php
# policy: https://pgl.yoyo.org/adservers/policy.php
@Blackdixxa
Blackdixxa / How to install unbound on ERLite-3
Last active September 20, 2021 09:13
How to install unbound on EdgeRouter 3/4
sudo apt-get update
sudo apt-get install wget nano unbound
configure
set system name-server 127.0.0.1
set service dhcp-server shared-network-name LAN1 subnet 10.0.0.0/24 dns-server 10.0.0.1
set service dhcp-server use-dnsmasq disable
set service dns
commit;save
exit
@Blackdixxa
Blackdixxa / unbound.conf
Last active September 20, 2021 09:05
Fichier de conf a placer dans /etc/unbound
# See the unbound.conf(5) man page.
#
# See /usr/share/doc/unbound/examples/unbound.conf for a commented
# reference config file.
server:
auto-trust-anchor-file: "/var/lib/unbound/root.key"
verbosity: 1
interface: 0.0.0.0
interface: ::0
@Blackdixxa
Blackdixxa / 7z-script.bat
Created April 9, 2018 13:50
7z-script.bat
"C:\Program Files\7-Zip\7z.exe" e %1*.rar >> c:\temp\7z-output.txt 2>> c:\temp\7z-errors.txt
@Blackdixxa
Blackdixxa / torrentsync.sh
Last active June 13, 2018 08:26
torrentsync
#!/bin/sh
# remote mono-directional sync v2.4
# note: the first time this script runs, nothing append
# because the script initializes the last exec to now.
# configuration parameters
# remote folder to sync to (the source)
REMOTE_FOLDER=''
# remote host and username to id against