Block ads, tracking and other garbage with dnsmasq

There is an automatically updated, moderated and optimized list available on GitHub for blocking ads, trackers and other online garbage:

The list is designed for use with dnsmasq. There is also a validation script available at You can configure automatic update of the list by following these steps:

    1. Install Node.JS that is a requirement for the notracking validate script:
      $ curl -sL | sudo -E bash -
      $ sudo apt-get install -y nodejs
    2. Clone the notracking repository:
      $ cd /opt/
      $ git clone git://
    3. Configure crontab to download updated lists on a daily basis by creating the file /etc/cron.d/notracking with the following content:
      0 6 * * * root cd /opt/notracking;./update;mv /opt/notracking/*.txt /etc/dnsmasq.d/;/usr/sbin/service dnsmasq restart
    4. Disable the CONFIG_DIR option in /etc/default/dnsmasq by comment out the following row:
    5. Add these two lines to the file /etc/dnsmasq.conf:

To get the configuration running immediately you can manually execute the commands from the cronjob or you can wait for it to run by it self at 06:00 the morning after you configured dnsmasq.


Securing Ubiquiti UniFi Cloud Key with Let’s Encrypt SSL and automatic dns-01 challenge with Cloudflare

I was trying to find out how to use Let’s Encrypt SSL to secure a internal unifi controller. Google gave me a link to the following excellent blogpost which describes how to use automatic dns-01 challenge to request and update the certificate from Let’s Encrypt:

Follow these steps to configure SSL/TLS-certificate for your internal unifi controller including automatic update of the certificate using Let’s encrypt and Cloudflare DNS:

1. Log in as root on your controller.

2. Install via the online installer:
curl | sh

3. Exit the terminal and reopen it again.

4. Enable auto-upgrade, just remember to change the email-address before executing the command: --upgrade --auto-upgrade --accountemail ""

5. Create the file /root/
# Renew-hook for ACME / Let's encrypt
echo "** Configuring new Let's Encrypt certs"
cd /etc/ssl/private
rm -f /etc/ssl/private/cert.tar /etc/ssl/private/unifi.keystore.jks /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/private/fullchain.pem

openssl pkcs12 -export -in /etc/ssl/private/cloudkey.crt -inkey /etc/ssl/private/cloudkey.key -out /etc/ssl/private/cloudkey.p12 -name unifi -password pass:aircontrolenterprise

keytool -delete -alias unifi -keystore /usr/lib/unifi/data/keystore
-deststorepass aircontrolenterprise

keytool -importkeystore -deststorepass aircontrolenterprise -destkeypass aircontrolenterprise -destkeystore /usr/lib/unifi/data/keystore -srckeystore /etc/ssl/private/cloudkey.p12 -srcstoretype PKCS12 -srcstorepass aircontrolenterprise -alias unifi

rm -f /etc/ssl/private/cloudkey.p12
tar -cvf cert.tar *
chown root:root /etc/ssl/private/*
chmod 640 /etc/ssl/private/*

echo "** Testing Nginx and restarting"
/usr/sbin/nginx -t
/etc/init.d/nginx restart ; /etc/init.d/unifi restart

6. Log in to your Clodflare account and get the Global API Code.

7. Configure exports for your DNS API:

8. Now it is time to get the new certificate. The following command will backup your existing certificate, contact Let’s encrypt to issue the new certificate, install the certificate and restart the controller. Remember to change the hostname in the parameter -d before running the command: --force --issue --dns dns_cf -d --pre-hook "touch /etc/ssl/private/cert.tar; tar -zcvf /root/`date +%Y-%m-%d_%H.%M.%S`.tgz /etc/ssl/private/*" --fullchainpath /etc/ssl/private/cloudkey.crt --keypath /etc/ssl/private/cloudkey.key --reloadcmd "sh /root/"

9. Log in to the controller and ensure that the hostname is configured.

10. Verify that a cronjob has been configured to enable automatic renewal of the certificate:
crontab -e
The line for should look like the one below:
0 0 * * * "/root/"/ --cron --home "/root/" >> /var/log/letsencrypt.log

via Securing Ubiquiti UniFi Cloud Key with Let’s Encrypt SSL and automatic dns-01 challenge |

Getting Started with VMware vSphere PowerCLI

VMware are providing vSphere PowerCLI to make it possible to administer vSphere and vCloud Director using PowerShell.

A good startingpoint is the VMware vSphere PowerCLI Documentation page that is available at:

If you´re in a hurry you could follow my quick starting guide below:

Step 1. Download and install VMware vShere PowerCLI:
VMware vSphere PowerCLI is available for download from
Select the release you want to download from the drop-down list and click on the download-link.
Double-click on the downloaded installation-package and follow the instructions to install PowerCLI.

Step 2. Start PowerCLI and connect to a vCenter Server:
Double-click on the “VMware PowerCLI” icon to start PowerCLI.


Use the CmdLet ‘Connect-VIServer’ as shown below to connect to the vCenter Server:

Connect-VIServer -Server <server-IP> -Protocol https -Username '<Username>' -Password '<Password>'

Now you are ready to explore and manage the VMware vCenter environment using PowerShell. Start by executing the following CmdLet to list all available commands.