Time based access control with iptables, cron and at

Until today I handled scheduled internet access for my daughters devices via my Apple AirPort Extreme that is configured as a bridge between my wired and my wireless network at home.

This setup has worked flawlessly for quite some time. There is one catch to this set up though. Each time I want to make an exception to the time based internet access rules I need to reconfigure and restart the AirPort Extreme. The restart takes a minute or two during which there is no wireless network for anyone at home. I guess that you can relate to the sheer panic that occurs in our home during that time.

The router/firewall/server/etc that I run at home is a Ubuntu 16.04 box running on a physical machine with two network cards. This machine now handles the time based internet access.

I decided to use iptables, cron and at in a small shell script, that you can find at the end of this article, since they are all proven tools that I am familiar with.
Continue reading “Time based access control with iptables, cron and at”

How to block unwanted ads and malware in all applications

*update: Wednesday, 2 March 2016. Switched back to the hosts file from http://someonewhocares.org/ because that one has a more adequate size and therefore much better performance. The file from hosts-file.net uses to much memory if you run a local resolver on your machine.

*update: Wednesday, 17 February 2016 rewrote the script with additional error checks after comment from Peter. Now there is only one script with the hosts file from http://hosts-file.net

*update: Tuesday, 16 February 2016 added another script that also cleans OS X 10.11 DNS caches and uses an even more extensive hosts file from http://hosts-file.net

Recently I compared adblock+, ghostery and a bunch of other ad blocking software in the browsers that I normally use. Most of them blocked ads really well but unfortunately all of them added quite a lot of additional CPU and memory overhead. So, despite the fact that these programs help me to speed up my browsing experience by eliminating advertisements they still slow down my browsing experience. Continue reading “How to block unwanted ads and malware in all applications”

Disk check script

It has been a while since my last update to this site. Now the time has come for another post. 🙂

A few days ago I visited UDS-r in Copenhagen Denmark. I met a lot of nice people and got the chance to hear about the plans for the next release of Ubuntu.

The trip to UDS was fantastic but on my way home i got mail from my server telling me that one disk had failed. Bummer! That ruined the day for me. Lost a few files because i had not taken a backup for a couple of weeks.

Continue reading “Disk check script”

Time Machine for Linux – Bash and Rsync

Recently i made “the switch”! Not in the way you might imagine though. Ever since 2003 i have been a passionate mac user. I still use macs at home and work and am still passionate about them.

Before 2003 i was playing a lot of games. Linux was and is something that i have been working/playing around with since 1996. To make a long story short: I wanted to use Linux and also play games (read dual boot linux/windows). The price tags on new macs ware also something that got me thinking about building a new shiny i7 based PC.

I am now back on a PC with Ubuntu Linux 9.04 and Windows 7. So far so god. One thing that i enjoy with Linux is that i am able to customize it to my needs. With Linux now being my primary OS (by choice) i had to fix some kind of backup for photos and all that other stuff on my PC that i would not like to loose in case of an accident. The first thing that came to my mind was rsync.

I used rsync to mirror my files on to an usb-disk. But after a few days i started to miss Time Machine which i was using when i had a Mac as my primary computer at home. Just mirroring files was not enough to give me that warm and cozy feeling. I needed to go back in time! Continue reading “Time Machine for Linux – Bash and Rsync”