Archive for category Programming
Printing the table structure of a SQLite Database in Android
Posted by Kyle Lexmond in Programming on July 17, 2016
I’m doing some Android app development, and as part of it, I hit some issues with the database. My first plan was to download the database and open it in SQLite, but having to re-establish my ADB debug session each time I downoaded the file got annoying, so I decided to write a short snippet […]
Notes from various AWS Investigations
Posted by Kyle Lexmond in Programming, Sysadmin on May 21, 2016
AWS CloudWatch Logs storage charge == S3 storage charge. Possibly less, since the logs are gziped level 6 first. CW Logs makes more sense than using AWS Elasticsearch at small scale – prices start at 1.8c an hour + EBS charges vs 50c/GB of log ingestion + storage For pure log storage & bulk retrival, […]
Checking a SSL certificate’s expiry date with Python
Posted by Kyle Lexmond in Programming on January 13, 2016
Before I found the –keep-until-expiring option in the Let’s Encrypt command line client, I was thinking I’d have to parse the cert, extract the expiry date, then check it against the current date before returning True or False. Thankfully I found the much easier option, but I decided to post the code I wrote to […]
Cloudflare & Python’s urllib
Posted by Kyle Lexmond in Programming on August 23, 2015
TL;DR: Trying to diagnose why my copr builds were abruptly failing, I found an interesting thing: Cloudflare’s Browser Integrity Check apparently doesn’t like Python’s urllib sending requests. The symptoms in Copr were weird: builds would try importing, and then fail with no log output. To me, trying to diagnose the problem made no sense – […]
Path to building Nginx Mainline RPMs for Fedora & CentOS
Posted by Kyle Lexmond in Linux, Programming, Sysadmin on February 13, 2015
Or: How I spent an afternoon doing a deep dive into the RPM spec and solving a problem for myself tl;dr – Nginx Mainline packages are being built for Fedora & CentOS at copr.fedoraproject.org/coprs/kyl191/nginx-mainline/ My webserver’s running nginx 1.4.7, a version that hasn’t gotten non-bugfix attention since March 2013, according to the changelog. Oddly enough […]
Musings on the Mythical Man-Month Chapter 2
Posted by Kyle Lexmond in Personal, Programming on April 2, 2014
tl;dr: Scheduling tasks is hard We assume everything will go well, but we’re actually crap at estimating We confuse progress with effort Because we’re crap at estimating, managers are also crap at estimating Progress is poorly monitored If we fall behind, natural reaction is to add more people Overly optimistic: Three stages of creation: Idea, […]
Musings on The Mythical Man-Month Chapter 1
Posted by Kyle Lexmond in Personal, Programming on April 1, 2014
Summary of the chapter: Growing a program A standalone product, running on the dev’s environment, is cheap. It gets expensive if: You make it generic, such that it can be extended by other people. This means you have to document it, testing it (unit tests!), and maintain it. You make it part of a larger […]
Django + Nginx resources
Posted by Kyle Lexmond in Programming, Sysadmin on October 26, 2013
For SE Hack Day: michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/ looks the best (along with michal.karzynski.pl/blog/2013/07/14/using-redis-as-django-session-store-and-cache-backend/) wiki.nginx.org/DjangoFastCGI and https://code.djangoproject.com/wiki/DjangoAndNginx are Django + FastCGI adambard.com/blog/start-to-finish-serving-mysql-backed-django-w/ blog.richard.do/index.php/2013/04/setting-up-nginx-django-uwsgi-a-tutorial-that-actually-works/ serverfault.com/questions/370525/nginxdjango-serving-static-files/370573#370573 stackoverflow.com/questions/17511466/deploying-django-on-nginx www.digitalocean.com/community/articles/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn because postgres
‘Solving’ SQL injection in Java
Posted by Kyle Lexmond in Programming on October 13, 2013
So during the summer I worked on a large enterprisey Java program. (Singleton pattern ahoy!) One of the annoying things (besides massive code duplication) was it used database queries that naively appended user input (particularly search queries) onto selects. And from my web background, I knew that SQL injection makes wiping the table trivial. Or […]
I broke… Java?
Posted by Kyle Lexmond in Programming on October 13, 2013
Something from my summer job. I found it horribly amusing. === And then I fixed it.