How to Deploy Python Web App With Apache’s Mod_wsgi

|

For quite a while I couldn’t figure out how to deploy Python web apps. But with patience and tinkering, I slowly figured it out.

Here were my steps:

1. Setup Domain

I created an A record for python.davidxia.com in my DNS records pointing to the IP of the server on which I developed.


Support This Kickstarter Project

|

I browse Kickstarter regularly looking to fund projects and to trigger my creative juices. There’s many projects dedicated to iPhone and iPad covers and accessories, so it’s refreshing to discover meaningful and unique endeavors like “Realizing Empathy: An Inquiry into the Meaning of Making”.

The creator, Seung Chan Lim, has written a book on what it means to make something. I knew I had to back his project when I saw it. I can tell he spent a lot of time thinking philosophically and practically about what he does. The book seems like a treasure trove of insight.

There’s only 17 days left, so please fund this project. I want the book. And watch the videos he’s put up. They are fantastic.


Making History

|

Final paper submission on December 12, 2009 for Columbia University’s Nonfiction Workshop class.

China has a long history of forgetting its past. When intellectuals criticized the first emperor in 213 BCE for burning classical books that could undermine his rule, he buried them alive. Two millennia later, Mao Zedong told throngs of teenage Red Guards to incinerate genealogical books, shatter antique pottery, and kill intellectuals during the Cultural Revolution. Political leaders saw China’s traditional culture as a backwater, and remembering was not important. Despite this cultural destruction, much has survived, and much more has been revived. In the summer of 2009, I tried to salvage my own piece of the past. I tried to write my family’s history. I am still trying.


15 Ways to Increase Your WordPress’ Security

|

1. Don’t Display Error Messages on Failed Login

WordPress’ admin screen displays “ERROR: Invalid username.” if you enter an invalid username. But if you enter a valid username and an incorrect password, it’ll say “ERROR: Incorrect password.” This basic security flaw tells intruders which usernames to target. I don’t understand why the WordPress team designed it this way.

You can disable the error message by putting this in your theme’s functions.php:

1
add_filter('login_errors',create_function('$a', "return null;"));

Hear TV Show Characters Say a Quote, Playing With Twilio

|

I was inspired by Rob Spectre’s Laugh-o-tron and made a telephony extension to my Twitter Bots.

Try it out. Call 646-480-6046 to talk to various TV show characters. Right now the vast majority of the quotes are spoken by a text-to-speech program because I have to find, crop, and upload audio files for each one. But McNulty from The Wire (choice #1) has a few real audio clips. Let me know how I can improve it.


8 Ways to Defend Against Brute Force SSH Attacks

|

I looked at my server’s auth logs today and was unsettled to find thousands of lines like these:

Feb 12 06:49:52 localhost sshd[25416]: Invalid user photo from xxx.xxx.xxx.xxx
Feb 12 06:49:52 localhost sshd[25416]: pam_unix(sshd:auth): check pass; user unknown
Feb 12 06:49:52 localhost sshd[25416]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=some.random.domain
Feb 12 06:49:54 localhost sshd[25416]: Failed password for invalid user photo from xxx.xxx.xxx.xxx port 49608 ssh2

I was looking at someone running a brute force attack on my server trying to gain SSH access. Looking further back in the logs, I found crackers (not the derogatory term for white people but people who break security maliciously) had been attacking me for at least a month. Luckily the unsophisticated attack simply tried various username/password combinations. After common usernames like root, admin, and user were tried, the attackers used names like aaron, gary, stephanie, etc.

Alright, time to shut these guys down. (All setting changes were made in /etc/ssh/sshd_config and on Ubuntu unless otherwise specified.)


How to Send Email With Postfix on Ubuntu via Gmail SMTP

|

I just setup email sending on my server by following this clear tutorial.

The tutorial walked me through setting up Postfix on an Ubuntu server and sending email via Gmail’s SMTP. I had to create a certificate, sign it, have my server communicate via some secure transport layer with Gmail using another certificate signed by some country in South Africa. I don’t understand all of it, but it works.


Redesign

|

I just finished redesigning my site. It was a lot more work than I expected. After becoming interested in Swiss design, both philosophically and aesthetically, I was inspired by the personal websites of Rdio and Django designer Wilson Miner, former New York Times web designer Khoi Vinh, and an Argentinian designer.


The Origin of the World Wide Web

|

I’m reading Tim Berners-Lee’s book Weaving the Web about how he conceived of and designed the world wide web.

For a long time I never really got the distinction between the “Internet” and the “world wide web.” To me they were the same thing, and they might be for many other folks too. But in hindsight this is just a testament to how successful Berners-Lee’s creation is.