Debian and Parental Control

The premise: Old Samsung laptop (40GB HDD, 700Mg RAM) is being repurposed for use by a 9-year old with very little experience of using the internet.

Better safe than sorry, I went all out. Debian runs very decently on the decrepit machine and I used tinyproxy to block everything apart from wikipedia.org – details below. Short of that, I just removed the Chat software and the Epiphany browser (I set up Iceweasel to go through tinyproxy) and it looks safe enough!

Reference links for tinyproxy: 

Excerpts of /etc/tinyproxy.conf:

LogLevel   Critical

Filter   “/etc/tinyproxy/filter”

FilterURLs   On

FilterDefaultDeny    Yes

Content of /etc/tinyproxy/filter:

.wikipedia.org

.wikimedia.org

SmartOS – Part 1

SmartOS is a hypervisor and a live image based on Illumos (Open Solaris, Unix-based). It supports the creation of zones (Unix/Ubuntu/Centos, very much like Promox) as well as regular virtual machines via KVM. Site is http://smartos.org/, you can find a good basic overview of the possibilities is at http://www.machine-unix.com/beginning-with-smartos/ (other user experience at http://opusmagnus.wordpress.com/2012/02/14/discovering-smartos/)and a very good description of the virtulization approach and OS basics at http://www.perkin.org.uk/posts/smartos-and-the-global-zone.html.

SmartOS is a 64bits only OS and I don’t have many x64 capable machines so I decided to experiment with SmartOS as a virtual machine on ESXi.

The First Challenge
ESXi will only boot from the ISO image in the virtual CD tray the first time after the VM is created. The second time and thereafter, it will try to start from the hard drive and crash, since SmartOS is loaded into RAM at launchtime and isn’t actually installed on the drive. For some reason, you can’t have a virtual USB key through ESXi, just share a physical one plugged into the hypervisor, which just isn’t an elegant solution. So I went about adding SmartOS to my PXE server (a Windows XP machine, which incidentally I need to have a look at because it has been crashing regularly on me but that’s another story) and well, that wasn’t as straightforward as that at all. I checked those links for reference – http://nahamu.github.com/2011/08/17/smartos-pxe.html – http://blog.smartcore.net.au/smartos-network-boot-with-pxe/ but nothing fit and I had to play around <<ADD DETAILS OF THE SETUP HERE>>

The Second Challenge
I then went about creating a zone to install FIFO on (http://project-fifo.net/display/PF/Project+FiFo+Home) but discovered at pkgin update time (“pkgin -fy up”) that my zone didn’t have connectivity (ie it couldn’t download the package_summary.gz that I checked was available on the joyent site), the IP of the zone registered on the LAN tab on my router, yet I couldn’t ping it. It turned out that I had to update ESXi to allow Promiscuous Mode for the NIC it presents to the virtual machines (that’s done through the vSphere console, under Configuration -> Network for the hypervisor itself, not the specific VM).

The Third Challenge (User-Related)
At this stage, I then went ahead and ran the chunter script… in the fifo zone rather than the global zone, which caused some havoc not easily rolled back and this ended up prevented the web console from working. After some unsuccessful debugging, I ended up tearing the fifo zone down and rebuilding from scratch. Workin perfectly now!

For future experimentation, if I can get suitable physical hardware to deploy
http://ispire.me/how-to-create-smartos-windows-vm/

If needed
http://wiki.smartos.org/display/DOC/SmartOS+on+VirtualBox

Update Red Hat Linux 5.5 with CentOS packages

I don’t have a subscription to us the Red Hat repo so this is what I tried, adapting the instructions at http://www.linuxquestions.org/questions/red-hat-31/how-to-update-redhat-from-centos-repos-696783/.

– Rename /etc/yum.repos.d/rhel….repo file

– Create /etc/yum.repos.d/centos.repo with the following content

############################################################
## ##
## RedHat EL5 using CentOS 5 repos. ##
## i386 ##
############################################################
[base]
name=Red Hat Linux – Base
#mirrorlist=http://mirror.centos.org/centos-5/5/os/i386/repodata/
baseurl=http://mirror.centos.org/centos-5/5/os/i386/
enabled = 1
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#priority=1

#released updates
[updates]
name=Red Hat Linux – Updates
#mirrorlist=http://mirror.centos.org/centos-5/5.3/updates/i386/repodata/
baseurl=http://mirror.centos.org/centos-5/5/updates/i386/
enabled = 1
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#priority=1

#released addons
[addons]
name=Red Hat Linux – addons
#mirrorlist=http://mirror.centos.org/centos-5/5.3/addons/i386/repodata/
baseurl=http://mirror.centos.org/centos-5/5/addons/i386/
enabled = 0
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#priority=1

#released Sources
[SRPMS]
name=Red Hat Linux – SRPMS
#mirrorlist=
baseurl=ttp://mirror.centos.org/centos-5/5/os/SRPMS/
enabled = 1
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#priority=1
################## EOF ################################

mkdir /var/cache/yum/centos

download the public key from
http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

rpm –import RPM-GPG-KEY-CentOS-5

And from my own limited experience, it works! I’ll post back if I find any issues further down the line.

PfSense – Make your own router!

Pfsense is an operating system that allows you to transform a spare computer with 2 network cards into a state of the art router with more options than you could ever dream off!

Caveat, not just any old computer. My first attempt was on a Pentium III, 512 GB RAM and I think that is why I had to go back to my Linksys after a couple of weeks because of packet dropping and random kernel panics. I will make a second attempt on a better spec machine time permitting. If that doesn’t work, maybe I need to upgrade my network cards.

Main advantages:

– vhosts – host your website on your router! vhosts-http needs to be started as a service (Status->Services) and status will not show as started (but it works fine). Also to note, address for vhost01.local on 8001/192.168.1.1 is http://192.168.1.1:8001/vhost01.local/

– FTP access – username is root by default with the same password than the web console.

– PeerGuardian package – Uses blacklists to let you download in peace!