Archive for category Programming

Printing the table structure of a SQLite Database in Android

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 […]

No Comments

Notes from various AWS Investigations

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, […]

No Comments

Checking a SSL certificate’s expiry date with Python

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 […]

,

2 Comments

Cloudflare & Python’s urllib

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 – […]

, , ,

No Comments

Path to building Nginx Mainline RPMs for Fedora & CentOS

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 […]

, ,

1 Comment

Musings on the Mythical Man-Month Chapter 2

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, […]

No Comments

Musings on The Mythical Man-Month Chapter 1

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 […]

No Comments

Django + Nginx resources

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

No Comments

‘Solving’ SQL injection in Java

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 […]

,

No Comments

I broke… Java?

Something from my summer job. I found it horribly amusing. === And then I fixed it.

,

No Comments