Scripted mass-creation of WordPress posts

So, the last couple of years I’ve been posting the Advent Calendar set of the day from the LEGO Star Wars and LEGO City box sets. The most mind-numbing part of this was creating the page and tagging it each day, so this year I decided to pre-populate the system with the posts ahead of time.

I leveraged some information on the net and a terrible PHP script, listed below. Whatever you do, I wouldn’t recommend using this on a production system without FIRMLY understanding what’s going on :)

In short, I give it the titles of the sets (City, Star Wars) and the year (in this case 2014) and it creates 24 draft posts with the tags required. Since I can automatically get the links, I’ve also created a “rollup” post which I’ll post on xmas day which includes links to all 24 posts.


proFTPd timing out while requesting LIST

In the process of locking down our servers we’ve been setting up host-based firewalls on one of our internal FTP servers.

The default thing was to deny access to everything but ICMP and SSH, good start.

Our first command was to only allow a given host access to port 21, FTP:

This allows the client to connect:

And there it sat, until it timed out.

After doing some research I found that the server was running in Passive mode, which wasn’t allowed through the firewall. Configuring proFTPd to expose specific Passive Ports (Instead of those in the high-RPC range)

To configure the server, I opened proftpd.conf and added the following line:

I also opened the firewall:

And was able to connect successfully! :)

Now, this is a very lightly used server and a very contrived example so be careful when opening up ports that you allow at least 2x the expected connection count when opening ports.


splunk SDK notes

Here’s an annoying one when building a custom splunk search command using the python SDK:

“Error in ‘script': Getinfo probe failed for external search command ‘testscript'”

This mean you have:

  1. “supports_getinfo = true” set in commands.conf for that particular command
  2. failed to set a docstring for one of the splunk elements within the command.
    1. Check your instances of Option and set doc=””
    2. Set a docstring for the class itself, but you already did that anyhow, didn’t you? :)

Another issue that may occur is this one:

AttributeError: The value of configuration setting streaming is managed

This means you’ve tried to set streaming=true in the @Configuration of the class. Put it in commands.conf and you’ll be fine.

On winding a watch…

Paul Blackburn – Julio Cortázar from Cronopios and Famas “The Instruction Manual”

(A Spanish Text)

Preamble to the Instructions on How to Wind a Watch

Think of this: When they present you with a watch they are gifting you with a tiny flowering hell, a wreath of roses, a dungeon of air. They aren’t simply wishing the watch on you, and many more, and we hope it will last you, it’s a good brand, Swiss, seventeen rubies; they aren’t just giving you this minute stonecutter which will bind you by the wrist and walk along with you. They are giving you—they don’t know it, it’s terrible that they don’t know it—they are gifting you with a new, fragile, and precarious piece of yourself, something that’s yours but not a part of your body, that you have to strap to your body like your belt, like a tiny, furious bit of something hanging onto your wrist. They gift you with the job of having to wind it every day, an obligation to wind it, so that it goes on being a watch; they gift you with the obsession of looking into jewelry-shop windows to check the exact time, check the radio announcer, check the telephone service. They give you the gift of fear, some­one will steal it from you, it’ll fall on the street and get broken. They give you the gift of your trademark and the assurance that it’s a trademark better than the others, they gift you with the impulse to compare your watch with other watches. They aren’t giving you a watch, you are the gift, they’re giving you yourself for the watch’s birthday.

Instructions on How to Wind a Watch

Death stands there in the background, but don’t be afraid. Hold the watch down with one hand, take the stem in two fingers, and rotate it smoothly. Now another instalment of time opens, trees spread their leaves, boats run races, like a fan time continues filling with itself, and from that burgeon the air, the breezes of earth, the shadow of a woman, the sweet smell of bread.

What did you expect, what more do you want? Quickly. strap it to your wrist, let it tick away in freedom, imitate it greedily. Fear will rust all the rubies, everything that could happen to it and was forgotten is about to corrode the watch’s veins, cankering the cold blood and its tiny rubies. And death is there in the background, we must run to arrive beforehand and understand it’s already unimportant.

From the original source, for history.