I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.
- Flask is managed by
uWSGI. uWSGItalks tonginx.
| user=`whoami` | |
| # if installing node directly | |
| sudo chown -R $user /usr/local/bin | |
| sudo chown -R $user /usr/local/lib/node_modules | |
| # if using nvm | |
| sudo chown -R $user ~/.npm |
| # -*- coding: utf-8 -*- | |
| import datetime | |
| from south.db import db | |
| from south.v2 import SchemaMigration | |
| from django.db import models | |
| from django.db.models import get_app, get_models | |
| class Migration(SchemaMigration): |
| After spending the better part of the month implementing date support | |
| in RethinkDB, Mike Lucy sent the team the following e-mail. It would | |
| have been funny, if it didn't cause thousands of programmers so much | |
| pain. Read it, laugh, and weep! | |
| ----- | |
| So, it turns out that we're only going to support dates between the | |
| year 1400 and the year 10000 (inclusive), because that's what boost | |
| supports. |
This is a list. There are many like it, but this one is mine
| # iPython Notebook with per-user storage and config | |
| # | |
| # Based on crosbymichael/ipython | |
| # Creates a Docker image with IPython Notebook installed. | |
| # | |
| # It expects to be run like this: | |
| # | |
| # docker run -v /home/eduard/notebooks/eduard:/notebooks benthoo/ipython-user | |
| # | |
| # You provide a folder per user on the host system. This folder will hold the users notebooks and also needs to contain the |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
| import re | |
| import json | |
| import luigi | |
| import pandas as pd | |
| from mysolr import Solr | |
| from bs4 import BeautifulSoup | |
| class InputText(luigi.ExternalTask): |
One of my ongoing resolutions is to learn a new programming language every year. I've been looking at Go for a while and I thought it would be fun to use the 'holiday' today to really get cranking. I recorded some random impressions as I was chugging along...
When learning a language, I'm one of those people that can't simply read documentation and contrived code examples with any usable level of recall -- I need to internalize it by writing code to solve a legitimate problem. So, I decided to write a little library, a parser for the Linux /proc filesystem. There aren't very many good ones that I've found for Go (and I am thinking of some projects I may want to use it for in the future).
Steps taken:
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"