Alphanumeric-only passwords: what’s the point?

I’ve come across multiple websites that allow me to use only alphanumeric passwords, i.e. only the characters A-Z and 0-9 are allowed. No diacritics, underscores or any other special characters. The lamest one had a maximum length of 8 characters for the password.

I use passwords that are often more than 16 characters long and use enough special characters to make some people feel sick. It bothers me that I can’t use a “strong” password on a website. 8 characters is way too short in my opinion. The worst part, however, is that I have to make up completely different passwords for these websites, since I can’t use the characters I want. And that means more passwords to remember.

I’d love to use somekind of password manager, but I use multiple computers, some of which are public, so importing settings from another computer isn’t really an option. I’m also afraid that I might forget some of my most important passwords thanks to not having to remember them.

Using a single password for everything isn’t an option either. I’m too paranoid to ever fall for that. Sigh. At least give me 16 characters and ASCII, thank you very much!

Simplex veri sigillum

I decided to completely reconstruct my website. Or rather, trash everything and set up a readymade solution.

The reason is simple: laziness. I just didn’t feel like spending a lot of time tweaking with my own code, templates, Makefiles, and all that. I also realized that the statically generated blog I had wasn’t as practical as a dynamic system. I was planning to write a simple wiki-like program in Python that allows me to edit pages with my web browser, but I scrapped that project for now because I don’t have time to work on it.

I might import some of my old posts later. Right now it seems like too much effort though.

The WordPress theme is my own. I tried to make it as simple as possible. Because I like simple things. Although I must admit, I ripped quite a bunch of ideas from Rickard’s blog.

Automatic timestamp update for Vim

I edit Markdown documents quite often. I use special email-style headers for things like article title, date created, and last modified date. A document could look like this:

Title: Automatic timestamp update for Vim
Date: 2008-10-16T17:55:58+03:00
Modified: 2008-10-17T13:26:48+03:00

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc
pellentesque. Phasellus adipiscing ligula eu dui. Donec placerat. Sed
aliquet rutrum mauris. Vestibulum ante orci, venenatis ac, imperdiet in,
sagittis nec, mi.

Note that I use ISO 8601 (or more specifically RFC 3339) formatting for my timestamps so that I can easily parse them with almost any software. I use the dates for sorting the documents, so every document must contain at least the date.

It would be silly to type the date manually in every file, so a quick remap for the F5 key in Vim would do the trick nicely. However, it turns out strftime() can’t return the timezone with the colon separating hours from minutes. The closest I can get is %z, which gives me +0300 (as opposed to +03:00, which is what I want). It’s fixed easily enough with a little function:

" Get RFC 3339 compatible timezone (+03:00 instead of +0300)
function GetTimezone()
    let tz = strftime("%z")
    if strlen(tz) == 5
        let tz = strpart(tz,0,3) . ":" . strpart(tz,3,2)
    endif
    return tz
endfun

Now I can remap F5 to print the timestamp:

" Insert timestamp at current position
inoremap <F5> <C-R>=strftime("%FT%T").GetTimezone()<CR>

Now all I need to do is type the title, then “Date:”, then press F5, and I get the current date.

I also wanted a date that shows when the file was last modified. I could do this by checking when date that the filesystem gives me for a given file, but that would make it more complicated. I want all the variables I need to be in the file header.

I decided to use use a similar header variable called Modified. Then I used the following function (originally from Vim tips):

" Update or insert timestamp.
function! UpdateModified()
    if &modified
        let timestamp = strftime("%FT%T") . GetTimezone()
        let n = min([10, line("$")])
        exe "1," . n . "s#^\(.\{,10}Modified:\).*#\1 " . timestamp . "#e"
    endif
endfun

The function checks if a line contains the string “Modified:”. If it does, it appends the current date at that position (or replaces the previous date, if it exists). Since all the variables are in the header, it only checks for the first 10 lines instead of the whole document.

To make this function automatic, I made Vim run it when a “.text” (the extension I use for Markdown-formatted text files) file is saved.

" Call UpdateModified everytime you save a file.
autocmd BufWritePre *.text call UpdateModified()

Now all I need to do, is type “Modified:” somewhere at the beginning of the document, then command :w, and the last modified date automatically updates.