Import SQL file into Docker Compose Container

How to import a .sql dump file into a docker container created by docker-compose.

Get in there!

It took me a while to figure out how to properly import a .sql dump file into a docker container I had started with docker-compose. The recommended way was to import the data on creation of the container by adding the dump file to the /docker-entrypoint-initdb.d directory. I wanted to avoid this if possible because the dump file is a backup of a production database but the docker-compose file is shared ...

Machine Learning Practice: Part II

Let's check the news.

Building a Dataset

We were introduced to a few basic concepts in part one of this series, but going forward it will probably be easier to start experimenting with data that is actually relevant to the problem that we want to solve. As refresher, that problem is scan news articles and determine if they are relevant to natural resource conservation.

To start simple, we'll grab two articles; one about some sort of ecological conservation ...

Machine Learning Practice: Part I

Bring on the learning. Machine style.

Getting Started

I'll mostly be following along with the online book Natural Language Processing with Python by Steven Bird, Ewan Klein, and Edward Loper while referring to Machine Learning in Python by Michael Bowles, but I'll be aiming to apply the lessons to problems that interest me personally. You can find the code associated with this blog series on my GitHub.

The ultimate goal of this machine learning practice is to produce a ...

Timelapse video from static images

How to make a video from a bunch of images.

Getting things in order

For one of my nonprofit's projects, I used a DSLR camera on a tripod to capture the transformation of a common garden green bean seed from germination to small seedling. If it interests you, you can find the code on GitHub here.

Unfortunately, an earlier iteration of the code I wrote to control the camera did not account for the fact that the script may need to restart at one ...

Django + Wagtail Custom Users

Because I'm willing to give myself a major headache for small gains.

The Problem

As I said in my last post, I'm aiming to add the ability for users to log in to the website using django-registration. It should be pretty simple, especially considering I got it working just fine on my nonprofit's website. Unfortunately, this website is essentially all about creating silly problems for myself so I can learn by fixing them. And thus, I have run into a problem that I did not ...

Website updates

Because you can't have progress without a whole bunch of annoying things trying to stop you.

And we're back!

I'm finally coming back to my personal website so I can make it less bad. And more good.

I've spent the better part of two days updating all of the packages on the VPS as well as those in the python development environment. It's kind of just fun to update things. It makes me feel better.

With style

I refactored a bunch of the project code to better handle ...

MySQL: From remote to local

Securely backing up a remote mysql database to a local machine.

Ok so now that we have our secure backup location, it's time to actually grab everything from the database. The first command will allow us to securely communicate with the remote server over SSH. If we didn't do this, all of the website traffic would be vulnerable to interception since it would be unencrypted in transit (with the exception of the user passwords which are stored encrypted already).

ssh -f -L3310:localhost:3306 ...

Encrypting the backups

You gotta encrypt all the things.

As of the time of writing, the website still looks crumby. But there has been progress! You just can't enjoy it yet.

Considering I implemented the strictest level of encryption on my website before I even built a way for users to submit data, I obviously care about security. In fact, I probably approach security in way that could be construed as paranoia, but that's just because I think such an approach offers ...

Setting up a new work environment

There's a lot of stuff to do behind the scenes when building a website from scratch. And it takes up a lot of time.

As with most computer related things it seems, working on one problem always seems to expose a variety of new problems, some of which are blocking while others are just interesting optimizations. In the age of Squarespace and other such tools that allow one to erect aesthetically pleasing websites in a matter of minutes, part of the fun of this project is to tackle as many of the challenges I encounter head on. As such ...

Building the website

Outlining my plans for the new website.

This website will serve to showcase my various projects and interests.

Various topics and categories will be explored:

  • Programming

  • Photography

  • Miscellaneous projects

For the foreseeable future, I will mainly be writing about programming in Python and various web-focused languages while I build out this website. The site is hosted by DigitalOcean* on an Ubuntu 16.04 x64 instance and powered by Django and Wagtail. It is served by the nginx web server. The source code ...