Source of History

If anything, Microsoft likes to keep its source code well hidden from a public view, even to the level of reading other people mail while mocking Google’s privacy policy (the pot calling the kettle black :)).

So it came as a surprise that Microsoft released MS-DOS 1.1 and 2.0 together with Word 1.1a source code to the The Computer History Museum. While these sources are far enough in past to be completely useless for anything competitive, I find them a precious part of history and very well worth checking.

MS-DOS source is particularly dear to my heart because it shows just how much functionality can be fitted in just 28 KB. Assembly code is quite annoying to follow (things tend to look a bit ugly when optimized) but it is well worth reading because of the comments. Not only they will help you understand code but, if you are old enough to have any DOS experience, they will also bring you on a memory lane stroll.

Since I was a stubborn WordPerfect fan at the time of Word 1.1a, its source didn’t evoke same level of emotions in me. But I definitely found some parts amusing to see. Especially document titled 86fun.doc that lists some facts only programmer can think of as a fun.

I find both programs miniatures well worth checking and remembering. Thanks Microsoft!

NAS4Free in the Role of Syslog Server

Illustration

In my network there are multiple *nix devices, most notable of them being my file server (NAS4Free) and my router (Asus RT-AC56U). Nice thing about their common ancestry is that both support syslog logging. Since I already have a proper reporting in place for my file server, I started thinking about getting my router messages there too.

Well, as luck would have it, there is already a syslog server present within NAS4Free. Only reason why it doesn’t work is that it is explicitly disabled in /etc/rc.d/syslogd. Following line is the culprit:

syslogd_flags="-8 -ss"

In full NAS4Free installation it is simple to edit that file. In embedded, some “trickery” is needed. In System -> Advanced -> Command scripts I added a new PostInit entry:

sed -i -e 's^syslogd_flags=".*"^syslogd_flags="-8 -a 192.168.1.0/24:*"^g' /etc/rc.d/syslogd ; /etc/rc.d/syslogd restart

Purpose of this rather long command (ok, two commands) is to do a string replace of default flags with ones allowing the whole 192.168.1.x range to use it as a server (you could define single server too).

There are additional steps that could be taken, e.g. adding host name into /etc/hosts or getting syslog to save my router messages into separate log file (configurable in /etc/syslog.conf). However, as far as my needs went, I was perfectly fine with this.

[2018-07-22: NAS4Free has been renamed to XigmaNAS as of July 2018]

Missing Updated With Suffusion

Illustration

One good indicator of web page health is its status in Google Webmaster Tools. Although I probably don’t go there often enough, I do try to keep-up with warning it gives me. This time it was complaining about errors in my blog’s markup.

Quick look into Google’s Structured Data Testing Tool just confirmed that my blog’s Suffusion theme was indeed missing proper information. How can I add it in?

Solution was rather easy once I found proper place. In ./wp-content/themes/suffusion/custom/post-header.php I found line that controls display of time:

<div class="date"><span class="month"><?php the_time('M'); ?></span> <span class="day"><?php the_time('d'); ?></span><span class="year"><?php the_time('Y'); ?></span></div>

Since its original output was definitely not microformats compliant, I took simple step of extending it:

<div class="date **value-title" title="<?php the_time('o-m-d'); ?>"**><span class="month"><?php the_time('M'); ?></span> <span class="day"><?php the_time('d'); ?></span><span class="year"><?php the_time('Y'); ?></span></div>

By putting value into title, I allowed Google and microformats to be happy and my theme kept its look&feel.

Creating Certificate Signing Request Under Windows

Illustration

Certificate that I use for code signing was about to expire so I went to StartSSL to get a new one. After going through standard identity verifications only thing remaining was to submit certificate signing request (CSR). Last time I created one on my Linux machine using openssl. This time I wanted to create it under Windows.

It turns out this is not difficult at all. First step was to download openssl installation for Windows. Message about missing Visual C++ 2008 Redistributables could be safely ignored and after annoying setup procedure (why would anybody think you want to install stuff to root directory) everything was ready.

Creating certificate signing request was exactly the same command as on Linux:

openssl req -new -newkey rsa:4096 -nodes -out my.csr -keyout my.key

After answering a few questions, all that was left to do was to open resulting my.csr file in any text editor and copy/paste it to the certificate authority. Not as easy as on Linux (where openssl is usually part of OS) but close enough for me.

PS: In order to get PFX certificate based on private key and certificate file, you can also use openssl:

openssl pkcs12 -export -inkey my.key -in my.cer -out my.pfx

My WordPress

Illustration

Every WordPress installation is a unique creature as far as customization goes. Mine starts with latest WordPress installation combined with a great free theme called Suffusion. Beauty is, of course, in the eye of the beholder but I believe to be one of best themes out there. It is extremely configurable and you can find it works as well on multimedia-rich sites as on simple home pages as this.

As on all WordPress sites, plugins are plentiful and they change with seasons. Here is my list and reason for them:

Akismet

This is part of probably every blog out there. It will not catch every spam but it will help you deal with most annoying ones out there.

Broken Link Checker

Linking to other websites is path toward hell as far as I am concerned. While it seems as a good idea at first, it can lead to a lot of broken links years down the road. Sometimes nothing can be done about it - resource is simply gone - but this plugin at least makes you aware of it.

CloudFlare

If you use CloudFlare and you love statistics, you will want to install this plugin too. Without it every user would seem to come from the same set of proxied IP addresses and all that per-country log analysis would be for nothing. :)

Facebook Open Graph Meta Tags for WordPress

Simple plugin that does its job - gets your website sharing links for Facebook and Google+ have proper excepts and look decent. It is not fancy and there aren’t many things you can change but I find myself liking all defaults anyhow. I was using NGFB Open Graph+ before but with time it became annoying dealing with its advertisements for bigger Pro edition. Not only that you got a huge banner on your admin pages (sacrilege!) but they started removing features with newer editions (bait, hook & switch). I won’t use it again any time soon.

Fast Secure Contact Form

Simple solution for contact forms. It was a bit annoying to configure, but it worked flawlessly since.

Google XML Sitemaps

Google web crawler occasionally might need a bit of hint as what page is considered more important in your view. 99% of time everything will work properly regardless, this is just to cover all bases.

Limit Login Attempts

Protecting against brute-force password cracking is probably something that should be already built-in to WordPress. But this simple plugin will do to. Security must-have.

Nonsingular noindex

This is a custom plugin I built to avoid Google indexing search and category pages. As blog grew, it became annoying to see search pages in Google results higher than actual page and I had to do something about it. Since I haven’t found any plugin readily available, I decided to build one.

Online Backup for WordPress

If you love your site, you will backup it. And you will backup it offsite. Mailing it to GMail account is perfect for me and this plugin does it without issues.

Simplest icon link

Just a simple plugin to add Apple touch icon to website. Probably there is dozen other plugins that do the same, but I decided to roll my own.

Snippet pre

Never finished plugin for source code highlighting. Since I found every syntax highlighter lacking in some way I decided to build one for myself. While I do use it for new posts, it has severely limited capabilities in its current form.

Snippet text template

One more itch I had to scratch was repeating of same phrases over and over again on multiple pages. So I built this plugin to help me with that. Unsuitable for anybody else because of hardcoding, but it does its job here.

SyntaxHighlighter Evolved

Syntax highlighter that I stopped using because of some annoying bugs and lack of development. However, lot of older posts use it so it will stay here a while. Ultimate goal is to change all those posts to use my own highlighter (once I finish it) but lack of time will probably ensure that never happens.

W3 Total Cache

Probably best caching program out there. If you are using shared hosting and there is any significant traffic, you need something like that. Lot of small options help optimize for your particular situation.

Widget Logic

If you want to limit widgets to some pages only, this is plugin for you.

WordPress HTTPS

This plugin ensures that your login always goes over HTTPS instead of HTTP. Must have if you occassionaly use unknown WiFi to access your blog. Of course, you do need SSL certificate too.