Wednesday, April 8, 2015

How much money can you get from YouTube video ads?

I was curious about what kind of money a normal person can make out of YouTube video ads.

As part of my Program Arcade Games web site I have a lot of tutorial videos. I've got about 2,000 subscribers and a half million views total on my video channel. Was that worth any money? Last Christmas I enabled advertising to find out.

The results:
Start date: 12/23/2014
End date: 4/8/2015
Days advertising was active: 106
Total views: 81,165
Total earned: 103.25
Amount earned per day 0.9741
Amount earned per view 0.0013

You need at least $100 in revenue to get paid. I ended the experiment to see once I got over $100. Quite frankly, $100 doesn't seem worth it to annoy people for 106 days and 81,000 views.

Keep in mind you only get paid if someone clicks on the ad. So a person isn't paid on a per-view basis. The results varied a lot on a per-day basis. This is what the analytics looked like:

Saturday, February 14, 2015

Script for setting up Wordpress on an AWS machine

I found the documentation a bit of a headache to run through. This is a quick way to get a wordpress server up and running on Amazon Web Services.


sudo apt-get -y update
sudo apt-get -y upgrade

sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password yourdbserverpassword'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password yourdbserverpassword'
sudo apt-get -y install mysql-server

sudo apt-get -y install apache2 php5 php5-mysql mercurial

sudo service mysql start
mysql -u root -p
CREATE USER 'wordpress-user'@'localhost' IDENTIFIED BY 'yourdbpassword';
CREATE DATABASE `wordpress-db`;
GRANT ALL PRIVILEGES ON `wordpress-db`.* TO "wordpress-user"@"localhost";

cd ~
tar -xzf latest.tar.gz

cd wordpress/
cp wp-config-sample.php wp-config.php
sed -i 's/database_name_here/wordpress-db/g' wp-config.php
sed -i 's/username_here/wordpress-user/g' wp-config.php
sed -i 's/password_here/yourdbpassword/g' wp-config.php

curl >> wp-config.php

sudo rm /var/www/html/index.html
sudo mv * /var/www/html/
sudo chown -R www-data:www-data /var/www/html

Tuesday, December 2, 2014

Learn to Program in Python!

The second edition of Program Arcade Games with Python and Pygame is out! I'm very happy with how it has turned out. A lot of feedback from the first edition has gone into making the second. The Amazon reviews are good as well. The whole book is available on-line at

 I'm not sure what my second professional project will be.

Monday, March 11, 2013

Three Years After The Adoption

Three years ago today Val and I sat in a courtroom to adopt Tanya and Nastya. Ten days later they were officially ours, and soon after they were in the US. 

Nothing worth doing is easy. But it has been worth it.

Nastya has learned so much and worked so hard. Her teacher this year didn't even know she’d been in Russia less than three years ago. 

Tanya, wow. The teenage years are hard enough. Watching her work through the frustration of everything and grow into a happy young woman getting ready to be independent is beautiful.

Alyssa? She grew up. We no longer had time to be helicopter parents, and Alyssa showed that she could do great anyways. One minute she can be an adult, the next minute turn around and act like a kid with Nastya.

Parents push their kids to do better, particularly when they don’t want to.

What I didn't know was that kids push their parents to do be better. I've never been pushed harder by anyone, including myself. And no one has been there for me more than Val. In another eight years the kids will leave, and there’s no one I’d rather spend the rest of my days with than her.

I think sometimes in life we focus so hard on where we’d like to be, that we forget to appreciate how far we've come. Nastya has had to learn everything a typical fourth grader knows in less than three years. Alyssa welcomed two strangers into her home as sisters. Tanya? She’s a typical high school student, defying the odds where half of all 15 year-olds that immigrate to the U.S. without English fail to even finish high school.

Please excuse me as I congratulate my family. Not everyone could have done that.

It has been a hard road, but we've traveled far and it looks like we have many miles ahead of us. Thanks to everyone that has traveled with us.

Wednesday, February 6, 2013


Pygame Tutorials

Learn to create games using pygame with this free on-line e-book.

Install Sphinx on Windows.

First, install Python 2.7. I've had no luck the the 3.x series.

Then, download and install easy_install from here:

Then, execute:

\Python27\Scripts\easy_install.exe sphinx

Saturday, December 29, 2012

I recently installed RhodeCode onto Simpson's server. Awesome program, but setup isn't quite as easy as I'd like. So here are my notes, in case anyone else is interested.
I relied heavily on the following sites for information:
Installation was done on a Debian Wheezy system.
First, become superuser.
sudo bash
Install pre-requisites.
apt-get install python-all-dev python-pip python-mysqldb rabbitmq-server python-virtualenv libmysqlclient-dev
easy_install -U distribute
pip install mysql-python
pip install virtualenv
Set up the message queue system.
rabbitmqctl add_user rhodeuser mypassword
rabbitmqctl add_vhost rhodevhost
rabbitmqctl set_permissions -p rhodevhost rhodeuser ".*" ".*" ".*"
I prefer mysql for the database. Set this up.
mysql -u root -p

create database rhodecode character set utf8; 
create user 'rhodecode'@'localhost' identified by 'mypassword';
grant all privileges on rhodecode.* to 'rhodecode'@'localhost';
flush privileges; 
Create a directory for installation
cd /var
mkdir rhode
chown www-data rhode
cd rhode

virtualenv --no-site-packages /var/rhode/venv
cd /var/rhode/venv/bin
source activate

cd /
pip install pastescript
pip install rhodecode

cd /var/rhode/venv/bin/
tar -zxf MySQL-python-1.2.3.tar.gz
cd MySQL-python-1.2.3
python build
cd ..

paster make-config RhodeCode production.ini
Edit production.ini so it looks like this:
vim production.ini
# -----
use_celery = true
# = localhost
broker.vhost = rhodevhost
broker.port = 5672
broker.user = rhodeuser
broker.password = mypassword

# Find this line and change to:
sqlalchemy.db1.url = mysql://rhodecode:mypassword@localhost/rhodecode
paster setup-rhodecode production.ini --user=rhodeuser --password=mypassword --repos=/mnt/hg_repos
/etc/init.d/rabbitmq-server start
See if celery works and hooks up to the message queue. If it does, hit ctrl-c and go to the next step. If it doesn't, debug before continuing.
paster celeryd production.ini
Start running. Then see if it works.
paster celeryd production.ini &
paster serve production.ini
I really wanted to use wsgi to serve stuff up. But I couldn't get authentication working. I am sad.
vim apache.conf
    WSGIScriptAlias /repo /var/rhode/venv/dispatch.wsgi
    WSGIPassAuthorization On
    WSGIDaemonProcess rhodecode user=www-data group=www-data threads=1 processes=10
    WSGIDaemonProcess pylons \
        threads=4 \

More wsgi stuff I didn't get working.
vim /var/rhode/venv/dispatch.wsgi
import os
os.environ["HGENCODING"] = "UTF-8"
os.environ['PYTHON_EGG_CACHE'] = '/var/rhode/venv/.egg-cache'


import site

from paste.deploy import loadapp
from paste.script.util.logging_config import fileConfig

application = loadapp('config:/var/rhode/venv/bin/production.ini')

To get the pass-through proxy working, this is what I did. First, enable the proxy mods:
a2enmod proxy_http
a2enmod proxy
a2enmod mod_headers
And some other stuff. I'll finish my notes later.