Skip to main content

Posts about dgplug (old posts, page 17)

A Hundred Days of Code, Day 033

Done with an introductory Regular Expressions book.
Picked up an advanced one.

My physio used keep to telling me, that we needed to loosen and pry my hips open to expand my range of motion.

These past few days have been the same, with respect to pattern matching using Regular Expressions. These lessons have been prying my brain open to a new way of thinking about words and characters.

From the way things are going, I think I will be spending the better part of next week on Regular Expressions too.
It’s still hard work, but it’s getting to be enjoyable hard work now.
I need to pace myself better and slow down.
I burnt myself out this week.

Onwards …

Introducing Regular Expressions

Done with Introducing Regular Expressions, by Michael Fitzgerald.
The subtitle, of the book says it all.

Unraveling Regular Expressions, Step-by-Step

Michael is a funny, patient and pithy author.

The book breaks down the basics of Regular Expressions into its components and then walks through explaining them in examples, line by painstaking line.
Any book that uses Coleridge to teach me Regular Expressions is awesome, so I’m biased :)

Definitely worth a read if you are brand new to the powerful world of RegEx.

Python Regular Expressions - Real World Projects

Did this short course to get myself upto speed with Regular Expressions, since the books I was trying to read were not quite doing it for me.
It’s short, sweet and extremely thorough.

After this I don’t quite know regex, but I’m no longer lost at sea.

I’ve now picked up a book and I get what they are talking about now.
The book and lots of practice, should get me to where I want to be with Regular Expressions.
I’m sweating this, because I’ve realised, this is an important skill, I need to have.

Breaking Change to this Website

I rejigged the website today.
I try not to do this often, but sometimes it becomes unavoidable, when I listen to some ineffable voice in my head.
This time, I hived the blog off to a /blog subsection, leaving the site free for any static remodelling that I’d want to do later.

I am trying my darndest to get redirection to work, but so far no joy.
If you are a regular reader of my articles, just add a /blog/ after the domain name with any page you want to access.
For e.g. is now

That’s all the housekeeping for now folks. And thank you for reading!

P.S. Think I figured it out. Most links should work now. If you find something broken, let me know.

Miniflux Service Fails to Start at Boot

Pleased as punch, with my Miniflux instance.
RSS, is how I catch up with everything newsy and techy and with what people I want to hear from, have to say.
I love it.

I did face one teensy issue with it though.
Every time I rebooted my machine, the Miniflux service would fail to start.
I would just manually do a systemctl restart miniflux and it would start right up, with that innocent doggy face.


image courtesy, Beverly & Pack, on Flickr

The last few days however, it’s been niggling me no end, because I have been rebooting the box ever so often.
Only when I go check up on RSS, at the end of the day or in the morning, do I realise something’s off.
So I checked up on Miniflux today, with a systemctl status miniflux
And I saw,

May 14 04:52:40 minmachine miniflux[706]: 
[FATAL] You must run the SQL migrations, 
the database schema is not up to date: current=v0 expected=v28

That did not sound right.
I religiously do a migrations step, every time it’s needed.

And then the penny dropped.
The current version of the schema, according to the error, was v0
That was not at all in line, with what I used to see, whenever I migrated.
It used to run from v25 to v26 to whatever. (These are not the actual numbers, I’m just pulling them out of my ass :P)
Not v0

It struck me that Miniflux might be starting up, before the database it uses, does.
So I just modified my Miniflux systemd script1 to startup after the database.
Like so …

Description=Miniflux Service
Requires=postgresql.service postgresql.service

Disable service, enable service, reboot system to check if all is well, and all that jazz …
And et voilà! Problem solved!
Miniflux and me, sitting in a tree … h-a-p-p-i-e-e!

  1. I use the helpful script miniflux.service from the docs

A Hundred Days of Code, Day 029

Awfully proud of myself today.
I wrote little program to scratch an itch, I had.
It’s still rough, but it does what I want it to, and that makes me happpy.
I go to Poetry Foundations’ Poem of the Day ever so often to catch a poem.
And I wondered, what if the daily poem showed up in my RSS reader everyday?
I searched and unfortunately couldn’t find a feed.

So I did the next best thing.
Armed with my newly acquired, Python knowledge, I set out to see if I could just get a link to a new poem daily.
And what I ended up doing was writing a program, that scraped the webpage metadata for the date, compared it to today and if it was, created a baby xml feed for me, that I have now put into my reader.

It’s a blank entry. The title takes me to the poem foundations page, so I don’t miss a day.
I put the program on my linode and then scheduled a cron job that runs the script once a day and moves the xml file to the appropriate place.
Today’s run was brilliant. Let’s see if it holds up tomorrow.

Right now it just overwrites the current item, since that is all I need.
But I could also look at building a list of daily items, if I so desire, later.
I need to just show up every day, for this positive ratchet to continue.
Like Seth says,

The hard part is “steady.”

Anyone can go slow. It takes a special kind of commitment to do it steadily, drip after drip, until you get to where you're going.

The code as usual, is here on Gitlab and Github1

  1. I still have to document it. But I will save all that for another day. More practice to do! 

A Hundred Days of Code, Day 028

This probably will be a few days of bike shedding.
I finally came up with a problem, I want to solve for myself and then realised, I don’t know enough command line fu to integrate my stuff with my operating system, the way I like.
So I am going to spend time, learning how to use the bash shell.
Been searching, copying and modifying scripts for far too long now.
Best to get this skill in my kitty as soon as I can possibly learn it.

P.S. Learnt enough in a marathon 12 hour session to be dangerous, to know what I want and look it up.