Parental control on home network

I recently looked into ways to block content on the home network. To protect the entire network, it seems like the filter should be placed on the router. This article on Lifehacker lists a few popular methods. I think using OpenDNS to filter is easy enough to get started. However, it’s quite easy to configure your connected computer to use a different DNS provider. However, one could set a static DNS on their tomato router.

Hosting multiple WordPress sites with WordPress Multisite and Domain Mapping

I use WordPress to run my blog. I recently had the need to run another site and wanted to also use WordPress as my CMS. However, I don’t want to run another installation of WordPress if I don’t have to. I followed the directions on here to create enable WordPress Multisite, and followed the directions on here to make use of a different domain name for my second site. Basically,

  • backup my WordPress database and WordPress directory first
  • enable WordPress Multisite via wp-config.php
  • disable all WordPress plugins
  • follow the install options on my WordPress site
  • re-enable my WordPress plugins
  • install the WordPress MU Domain Mapping plugin
  • continue with instructions here

Some things specific to my setup:

  • sub-domain was enabled by default from my previous WordPress installation; I had to add the CNAME *blog.mydomain.com to my Host DNS configuration, where blog.mydomain.com is my current WordPress site. I also had to add the line ServerAlias blog.mydomain.com =*.blog.domain.com to my VirtualHost setup my Apache web server configuration.
  • mapped my WordPress site 2 from site2.blog.mydomain.com to site2.mydomain.com, where site2 is the name of my new WordPress site.

Now I am able to host multiple WordPress sites from the same WordPress installation. What is the down side? I have to manage plugins and themes that are available for each of the site…

Flipping the classroom: creating screencast lectures in Linux

I’m debating the idea (hype) of flipping the classroom for one of my classes next Fall where students watch lecture videos at home (or elsewhere) so I could spend class time doing more hands-on activities like discussing the art of data analysis and how to solve problems with statistics. I think Khan Academy, Udacity, and Coursera are doing a great service for humanity by offering high quality courses taught by excellent teachers online that are accessible to anyone with an internet connection.

I don’t claim to be a great teacher, but I think my own students might benefit from this pedagogical method. My main concern with this approach is that not all students will watch the lectures, just as how not all students read the assigned readings (guilty as a student). I guess I can give students short quizzes during lecture to push them to watch the videos. Also, I’ll give my usual challenging homework so that only students that study the material well could excel. By flipping the classroom, more material could be covered, students have access to the recordings in addition to my slides, and I could make sure everything I want to be said are recorded (as opposed to a live session where I could forget a few points). Lecture times can then be more interactive as opposed to me lecturing them for an hour.

I think most of the online education sites use Camtasia with a Wacom Cintiq to produce their videos. I use Linux and cannot afford such an expensive device. I plan on using a screencast software like recordMyDesktop or Istanbul to record the desktop screen and audio. For recordMyDesktop, I had issues with the encode on the fly option, which means recording very long videos could be an issue (1 minute of raw video takes up about 210MB, and 1 minute encoded video takes up about 8MB). Istanbul records on the fly without problem (I think). I haven’t tried recording for an hour and 20 minutes yet.

My plan is to create my lecture slides with LaTeX Beamer and use Xournal to annotate the slides as I’m lecturing; hopefully my Asus T101MT netbook is strong enough to do the recording as I utilize it’s touchscreen capabilities. I can just switch over to Emacs to illustrate data analysis in R when needed. My main concern now is where I could host these (large) videos…

Update 4/27/2012: Screencast with ffmpeg

After some testing, I think the best screencast software on Linux would have to be ffmpeg. First, remove ffmpeg and compile it from source based on the latest version per this post. Then, create screencast.sh:

#! /bin/bash
DATE=`date +%Y%m%d`
TIME=`date +%Hh%M`
ffmpeg -y -f alsa -ac 2 -i pulse -f x11grab -r 24 -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -i :0.0 -c:v libx264 -preset veryfast -crf 22 -c:a libmp3lame -ar 44100 -ab 24k -threads 0 /tmp/screencast_$DATE-$TIME.mp4

For more libx264 options, see this page.

Record streaming radio with streamripper

Yes, many radio shows are available as podcasts. However, some are not. If a radio show is also broadcasted via a live stream online, then we could record it with streamripper. I did so as follow:

<pre class="src src-sh">sudo apt-get install streamripper <span style="color: #ff4500;">## </span><span style="color: #ff4500;">install</span>

## record for 60 seconds streamripper http://kpcclive1.publicradio.org:80/ -s -l 60 -a “Prarie – %d”

To have the show be recorded automatically, first create record.sh:

#! /bin/bash

## set in crontab: ## 59 17 * * 6 /path/to/record.sh cd /path/to/save/; streamripper http://kpcclive1.publicradio.org:80/ -s -l 3720 -a "Prarie - %d" &> /dev/null

Then add the following cron entry via crontab -e:

59 17 * * 6 /path/to/record.sh

Beware: certain Amazon EC2 AMI’s terminate at shutdown

I toyed with Amazon EC2 last year by migrating my web server there. After issuing shutdown -P in Ubuntu last week, my instance disappeared from the list in the AWS dashboard. I seeked help and found out that some AMI’s are set to terminate at shutdown. Unfortunately, the AMI I used was one of them. Files and settings are not recoverable after an instance is terminated. Luckily, I transferred most of my critical information out prior to the shutdown; I’m only missing one file. Note to self: for all future instances, the shutdown behavior to stop (as opposed to terminate) could be modified per these instructions. First, create and download the X.509 certificate and private key. To access the EC2 api, do the following on your computer:

<pre class="src src-sh">sudo apt-get install ec2-api-tools ec2-ami-tools <span style="color: #ff4500;">##</span><span style="color: #ff4500;">ec2-init</span>

Then, do the following to find out what behavior is currently set on your instance:

ec2-describe-instance-attribute i-AMAZON-INSTANCE-ID --instance-initiated-shutdown-behavior -K /path/to/x509-key.pem -C /path/to/x509-cert.pem 

If the value is not stop, then do

ec2-modify-instance-attribute i-AMAZON-INSTANCE-ID -K /path/to/x509-key.pem -C /path/to/x509-cert.pem --instance-initiated-shutdown-behavior stop