@ wrote... (10 months ago)

I highly doubt I've invented something new, but I did independently invent it, so I have that going for me, which is nice. Plus I'm stitching together lots of great open source pieces which we all have going for us.

Anyhow, this is kind of difficult to explain. And complicated… with lots of moving parts… but is super useful once you get it to work.

As high level as possible, when I do a git push, another machine reloads new configuration files. And notifies me. All within a second.

more…

Category: tech, Tags: devops, docker, git, linux
Comments: 0
@ wrote... (1 year, 3 months ago)

I really want to like Kivy

I was trying to asyncronously load comic book images out of a cbr file (a rar archive) but was having a hell of a time figuring it out.

more…

Category: tech, Tags: kivy
Comments: 0
@ wrote... (1 year, 7 months ago)

Alkali v0.5.5 has now escaped.

Code at github.com and docs at readthedocs.org.

Major features are:

  • adding BoolField
  • adding CSVStorage, load/save csv files
  • queries are bit more efficient/fast, don't copy as many objects by default
  • some doc cleanups
Category: tech, Tags: alkali, python
Comments: 0
@ wrote... (1 year, 8 months ago)

You can now nicely render markdown in your console/terminal with ConsoleMD in glorious color.

Note the subtlety changing hues of the subtopics, the brilliance of auto-incrementing list counters, the dulcet notes of the embedded python, the elegant italics of the block quote. ConsoleMD has it all! At least with regards to my small test files.

Code is on github.com

Category: tech, Tags: consolemd, python
Comments: 0
@ wrote... (1 year, 9 months ago)

Alkali v0.5.4 has now escaped.

Code at github.com and docs at readthedocs.org.

Major features are:

  • implemented Query.distinct
  • implemented Query.annotate
  • implemented Query.aggregate functions: Sum, Count, Min, Max
  • Fields are now descriptors on Model instance
  • added ForeignKey field
  • models now cascade delete when ForeignKey instance is deleted
  • minor speed ups
  • IntField now has auto_increment property
  • Query returns copies of Model instances
  • added signals on model creation/deleting/saving/etc
  • better documentation
Category: tech, Tags: alkali, python
Comments: 0
@ wrote... (1 year, 9 months ago)

I had a hell of a time trying to make a nice help command while using click.

I wanted the ability to have a help sub-command for each real command.

mycommand --help
mycommand help

mycommand foo --help
mycommand help foo

It's actually fairly easy (once you know how).

CTX_SETTINGS=dict(help_option_names=['-h','--help'])

@click.group(context_settings=CTX_SETTINGS)
@click.pass_context
def cli(ctx, **kw):
    ...

@cli.command()
@click.pass_context
def foo(ctx):
    ...

@cli.command()
@click.argument('topic', default=None, required=False, nargs=1 )
@click.pass_context
def help(ctx, topic, **kw):
    if topic is None:
        print ctx.parent.get_help()
    else:
        print cli.commands[topic].get_help(ctx)
Category: tech, Tags: python
Comments: 0
@ wrote... (1 year, 9 months ago)

So it turns out I hadn't updated my Fedora installation for over two years (protip: don't run Fedora on a server kids) so I did a quick series of upgrades and went from Fedora 21 to Fedora 25.

Unfortunately that means that my PostgreSQL database was at version 9.3 but the installed software was version 9.5.

So can you upgrade from 9.3 to 9.5? No. But it's not impossible either.

more…

Category: tech, Tags: database, postgresql
Comments: 0
@ wrote... (1 year, 10 months ago)

It turns out that after I imported a bunch of databases from mysql all the ownerships were wrong so any future django migrations would fail.

Based on this stackoverflow.com answer I made a quick script to mass change several databases and its tables all at once.

more…

Category: tech, Tags: database
Comments: 0
@ wrote... (1 year, 10 months ago)

I'm in the process of merging databases with identical schemas. This will cause primary key collisions which one generally wants to avoid.

So there are a few things you have to do:

more…

Category: tech, Tags: database
Comments: 0
@ wrote... (1 year, 10 months ago)

I kept getting Incorrect string value warnings when trying to import UTF-8 strings into Mysql. It turns out that Mysql has pretty questionable utf-8 support as seen from this stackoverflow.com question.

Well enough was enough so I decided to migrate some datbases to Postgresql. Here are some notes/scripts that helped me.

more…

Category: tech, Tags: database
Comments: 0