Alex Raichev

I Knew a Woman

I knew a woman, lovely in her bones,
When small birds sighed, she would sigh back at them;
Ah, when she moved, she moved more ways than one:
The shapes a bright container can contain!
Of her choice virtues only gods should speak,
Or English poets who grew up on Greek
(I’d have them sing in chorus, cheek to cheek).

How well her wishes went! She stroked my chin,
She taught me Turn, and Counter-turn, and Stand;
She taught me Touch, that undulant white skin;
I nibbled meekly from her proffered hand;
She was the sickle; I, poor I, the rake,
Coming behind her for her pretty sake
(But what prodigious mowing we did make).

Love likes a gander, and adores a goose:
Her full lips pursed, the errant note to seize;
She played it quick, she played it light and loose;
My eyes, they dazzled at her flowing knees;
Her several parts could keep a pure repose,
Or one hip quiver with a mobile nose
(She moved in circles, and those circles moved).

Let seed be grass, and grass turn into hay:
I’m martyr to a motion not my own;
What’s freedom for? To know eternity.
I swear she cast a shadow white as stone.
But who would count eternity in days?
These old bones live to learn her wanton ways:
(I measure time by how a body sways).

~ Theodore Roethke, 1954

What a sweet poem! Here's my musical setting for (part of) it.

Author: Alex Raichev
Date: 2018-09-10
Tags: poetry, Roethke
Permalink, Comment

The Event

Sourced from Saturday Morning Breakfast Cereal.

Author: Alex Raichev
Date: 2018-08-19
Tags: comic
Permalink, Comment

Deploying a Flask Application on Webfaction

A few months ago i had to deploy for the first time a Flask application on a Webfaction server. After studying this Webfaciton Community thread on the topic, issuing a Webfaction support ticket for help ---Webfaction customer service is excellent--- and trying and failing several times, i figured it out. Here's what i did.

Suppose that your Flask project structure looks like this:

APPNAME
├── APPNAME
│   ├── main.py
│   ...
│   └── wsgi.py
...
├── Pipfile
├── Pipfile.lock
└── README.rst

that you are tracking it with Git, that you run it locally in a Python virtual environment, e.g. using Pipenv, and that it works. Now, let's deploy it to Webfaction.

  1. Log in to your Webfaction control panel and create a new mod_wsgi/Python application. Also create a corresponding domain and website for the app. I assume you know how to do that.

  2. Throughout the remainder of these notes, suppose that your Webfaction username is USERNAME and that your Flask application is called APPNAME

  3. SSH into your Webfaction server and run these commands:

    > mkdir home/USERNAME/webapps/APPNAME/APPNAME
    > rm -r home/USERNAME/webapps/APPNAME/htdocs
    > rm -r home/USERNAME/webapps/APPNAME/lib
    

    You don't need the lib directory in the last line, because you will be using a virtual environment.

  4. Set up Git, Git hooks, and push your local repository to Webfaction. See the Webfaction instructions here and here.

  5. Create your virtual environment ---let's call it VENVNAME here--- and install your app requirements. I think the easiest way to do this is to install Pip to install Pipenv to manage your virtual environments and packages.

  6. If your local repo has a .env environment file containing (Git-ignored) secrets, then create a corresponding .env file in your Webfaction repo.

  7. If you haven't done so already, create the file home/USERNAME/webapps/APPNAME/APPNAME/wsgi.py containing the single line from main import server as application.

    This assumes that your Flask code lies in the module main.py and that the Flask app you create in that module is call server. If that's not the case, then change the above snippet as needed.

  8. Edit the file home/USERNAME/webapps/APPNAME/apache2/conf/httpd.conf to the following, where PORT is the port number that Webfaction assigned to your application (which you can view in your Webfaction control panel for the app):

    ServerRoot "/home/USERNAME/webapps/APPNAME/apache2"
    
    LoadModule authz_core_module modules/mod_authz_core.so
    LoadModule dir_module        modules/mod_dir.so
    LoadModule env_module        modules/mod_env.so
    LoadModule log_config_module modules/mod_log_config.so
    LoadModule mime_module       modules/mod_mime.so
    LoadModule rewrite_module    modules/mod_rewrite.so
    LoadModule setenvif_module   modules/mod_setenvif.so
    LoadModule wsgi_module       modules/mod_wsgi.so
    LoadModule unixd_module      modules/mod_unixd.so
    
    LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    CustomLog /home/USERNAME/logs/user/access_APPNAME.log combined
    ErrorLog /home/USERNAME/logs/user/error_APPNAME.log
    
    Listen PORT
    KeepAlive Off
    SetEnvIf X-Forwarded-SSL on HTTPS=1
    ServerLimit 1
    StartServers 1
    MaxRequestWorkers 5
    MinSpareThreads 1
    MaxSpareThreads 3
    ThreadsPerChild 5
    
    WSGIPythonHome /home/USERNAME/.virtualenvs/VENVNAME
    WSGIDaemonProcess APPNAME processes=2 threads=12 python-path=/home/USERNAME/webapps/APPNAME/APPNAME:/home/USERNAME/webapps/APPNAME/APPNAME/APPNAME
    WSGIScriptAlias / /home/USERNAME/webapps/APPNAME/APPNAME/APPNAME/wsgi.py
    WSGIProcessGroup APPNAME
    WSGIRestrictEmbedded On
    WSGILazyInitialization On
    
  9. Restart your app via home/USERNAME/webapps/APPNAME/apache2/bin/restart.

These instructions will probably go obsolete in a few months, as all things web related do. Still, they'll help me while they last and maybe help you too.

Author: Alex Raichev
Date: 2018-05-17
Tags: instructions, tech
Permalink, Comment

Kūtere

youtube~O2KR8PXZ2Zo

Kūtere - (Māori, verb) to flow together, rush into one place. Made by my friend Kate.

Video sourced from YouTube here.

Author: Alex Raichev
Date: 2018-02-19
Tags: video, poi
Permalink, Comment

Take a Street and Build a Community

youtube~C1WSkXWSJac

Video sourced from YouTube here.

Author: Alex Raichev
Date: 2018-01-04
Tags: video, resilience
Permalink, Comment


Why no comments? I used to do public comments but found that moderating and maintaining them took too much time in front of the computer, time better spent playing outdoors. So these days I only do private comments, that is, you can email me comments regarding a post by clicking the 'Comment' link at the bottom of the post.