Shallow Thoughts : tags : blogging
Akkana's Musings on Open Source Computing and Technology, Science, and Nature.
Mon, 16 Nov 2020
Fixing
the Disqus comment system required regenerating the pages for old
blog articles, to add the comment sections back. But doing that
made me realize that the calendar wasn't right on a lot of pages.
This blog uses PyBlosxom, an excellent minimal blogging platform that
is, unfortunately, no longer actively maintained. So I knew I couldn't
count on anyone else fixing the calendar. I dug into the code and
eventually found the problem, so I've regenerated all the blog pages
and will be updating my PyBlosxom fork and sending a pull request upstream.
But while watching all those pages regenerate, I was struck by the
three flavors of RSS generated for every page. It seemed excessive.
I'm guessing that by now, anyone who's still using RSS (I certainly
am!) can handle either Atom or RSS 2.0. So I've removed the
RSS 0.9.1 feed. If you were using it, please update to the
RSS 2.0 or Atom feed (see the links in the right sidebar).
If anyone was using RSS 0.9.1 and absolutely can't update to a
newer format, drop me a line. If it turns out there was a good
reason for supporting 0.9.1, I can put it back.
Tags: blogging
[
08:44 Nov 16, 2020
More blogging |
permalink to this entry |
]
Sun, 15 Nov 2020
The Disqus comments here have been broken for quite some time,
and I didn't realize it. I just thought nobody must interested in
any of my alphabet topics. :-)
It turns out there were two problems.
Read more ...
Tags: blogging
[
14:15 Nov 15, 2020
More blogging |
permalink to this entry |
]
Sat, 09 May 2020
Recently, I was dealing with the RSS page for a local newspaper,
and being irritated at how it had the full text of every story
on the RSS page, not just the first few paragraphs like most
sites do.
And then I realized that Shallow Thoughts has the same problem.
In my defense, I set up this blog a long time ago (2004). And nobody
complained, so I guess I just never noticed. Anyway, I think it's
kind of rude to put the whole story on the index page; it's much
more friendly (and the index page loads a lot faster) if there are
just intros for each story, letting the reader decide whether to
click through.
And then I had to figure out how to do that. PyBlosxom is semi-orphaned,
but there are actually still a few developers (I submitted some fixes
last year to get Shallow Thoughts working under Python 3, and they
were quickly accepted) and everything still works. And the
documentation is pretty good, too; it turned out I just needed
to enable the "Readmore" plugin and add a couple of configuration lines.
So now the index page, both in HTML and RSS, is much shorter and
should load much faster. I hope the change is welcome and doesn't
cause any problems for anybody!
And now, on to today's "I" entry ...
Tags: blogging
[
13:56 May 09, 2020
More blogging |
permalink to this entry |
]
Fri, 15 Nov 2019
Sometimes I tend to ramble on, and wonder if articles I'm writing are
really too long for a blog post. I try to keep them under about 200
lines, but sometimes a really meaty topic demands more.
It occurred to me to wonder how long a typical Shallow Thoughts post is.
A quick measure is lines, which I can measure this way starting
in the directory where I have the source files for all my past posts:
find . -name '*.blx' -exec wc -l '{}' \; | sort -h >/tmp/bloglen.dat
The find produces lines like:
79 ./linux/cmdline/random-command.blx
so if I sort -h (human-readable numbers), it will sort on the first
column and give me a sorted list of all posts in order of size.
The shortest posts, three of them, were only five lines;
the longest was 346 lines.
But what's the distribution of lengths?
I can plot the sorted data easily with gnuplot:
gnuplot -p -e 'plot "/tmp/bloglen.dat"'
or, if I didn't want the temp file, I could have done that all
with one command:
find . -name '*.blx' -exec wc -l '{}' \; | sort -h | gnuplot -p -e 'plot "/dev/stdin"'
That's kind of interesting. But I was really more interested in seeing
a frequency distribution: do I have a lot more shorter posts, or
longer ones? For that I do need the temp file.
I wasted some time trying to find a way in gnuplot to plot frequency
distribution. The best I found was
set style fill solid
plot '/tmp/bloglen' u ($1):(1) t 'data' smooth frequency w boxes
pause mouse close
(put that in a file and then run gnuplot on that file).
But it's not actually right: the bargraph shows 1 for lots of blog
post lengths that aren't represented in the data.
I finally gave up on gnuplot, having wasted enough time that I could
easily have written a Python script, and did so, which only took a
few minutes.
import matplotlib.pyplot as plt
posts = []
with open('/tmp/bloglen') as fp:
for line in fp:
posts.append(int(line.split()[0]))
plt.hist(posts, bins=max(posts))
plt.show()
Turns out I'm doing pretty well at keeping them under 200 lines.
The vast majority of posts are fairly short, with a peak around 50 lines,
and relatively few exceed 200. Only a couple of outliers get over 300.
I think I'm okay with that. Whether you, the readers, agree --
well, feel free to tell me!
For comparison, this post is 95 lines.
Tags: linux, cmdline, gnuplot, blogging
[
21:28 Nov 15, 2019
More blogging |
permalink to this entry |
]
Thu, 10 Oct 2019
A reader pointed out to me that the RSS page on my blog hadn't been
updated since May.
That must be when I updated PyBlosxom to the latest version and
switched to the python3 branch. Python 2, as you probably know,
is no longer going to be supported starting sometime next year
(the exact date in 2020 doesn't seem to be set). Anyway, PyBlosxom
was one of the few tools I use that still depend only on Python 2,
and since I saw they had a python3 branch, I tried it.
PyBlosxom is no longer a project in active development: as I
understand it, some of the developers drifted off to other blogging
systems, others decided that it worked well enough and didn't really
need further tweaking. But someone, at some point, did make a try at
porting it to Python 3; and when I tried the python3 branch, I was
able to make it work after I made a couple of very minor tweaks (which
I contributed back to the project on GitHub, and they were accepted).
Everything went fine for a few months, until I received the alert that
the index.rss and index.rss20 files weren't being generated.
Curiously, the RSS files for each individual post are still there;
just not the index.rss and index.rss20.
I found there was already a
bug filed
on that.
I tried the workaround mentioned in the bug, at the same time adding
Atom to the RSS 0.9.1 and RSS 2.0 flavors I've had in the past.
I haven't generated Atom for all the old entries, but any new entries
starting now should be available as Atom.
Fingers crossed! if you're reading this, then it worked and my RSS
pages are back. Sorry about the RSS hiatus.
Tags: blogging, pyblosxom, rss
[
09:10 Oct 10, 2019
More blogging |
permalink to this entry |
]
Sun, 18 Aug 2013
Shallow Thoughts has been nominated as a competitor in
round two of the
Foss
Force Best Personal Linux or FOSS Blog Competition.
There are plenty of excellent blogs on the list and I'm flattered to
be included.
If you have a moment, take a look and vote for your favorite
(whether or not it's Shallow Thoughts). You can vote for up to two.
If nothing else, it's a good excuse to check out some excellent articles
on free software from a variety of writers.
Voting ends on Monday.
Tags: blogging
[
12:05 Aug 18, 2013
More blogging |
permalink to this entry |
]
Fri, 11 Mar 2011
Based on the offline comments I got, I'm going to try
Disqus for blog comments.
Setting up an account was easy, and I think I have the PyBloxsom
side working now. So this is a test post to see if comments
are working. Feel free to post comments and see!
In theory, you should be able to use OpenID, Twitter, Disqus
or various other types of accounts.
Comments aren't visible on the blog home page, only on the
pages for individual stories.
If you want to try commenting but can't think of anything to say,
how about the Japan earthquake? Wow! My heart goes out to everyone
affected by the huge quake or the tsunami that followed.
Any good links to information about the quake?
Tags: blogging
[
17:09 Mar 11, 2011
More blogging |
permalink to this entry |
]
Tue, 08 Mar 2011
People periodically ask me why I don't have comments on my blog.
It's not because I don't want to see user discussion -- I'd love that.
In particular, several people had opinions on my recent post about
locations
for the SCALE conference,
and I would have loved to see and participate in a discussion on that.
The hold-up is purely technical: my current blogging setup makes it
difficult to add them and keep the system maintained.
But lately several services have arisen that apparently make it easy
to add comments to otherwise static pages, and I'm considering
trying one.
The candidates I know about are:
None of these is perfect.
I believe they all require signing up, though the first two can use
an OpenID account, and of course a lot of people already have a
Facebook account. But it might be a lot better than no comments.
Readers of my blog: do you have a preference, or any experience with
any of these services? ("Don't bother adding any of these" is also a
valid option, as are suggestions for services I didn't list.)
If there's a preference, I'll go with it ...
otherwise, I'll probably just pick one and try it.
Please mail me your thoughts or suggestions.
Thanks!
Tags: blogging
[
22:16 Mar 08, 2011
More blogging |
permalink to this entry |
]
Mon, 23 Feb 2009
File under "Is it really worth running your own server?":
About a week before we'd planned to leave for SCALE, our
router/firewall started acting flaky. Every could of days it
would just stop routing, for no apparent reason. A few days before
a trip is no time to debug a problem like that, so we re-purposed
another router we happened to have sitting around. It seemed to work
fine; we tested it from both inside and outside over several days,
and everything was working fine.
We drove down to LA as planned, spent a few hours hanging out
and having dinner with family, then decided on a quick email check before bed.
Um ... check where? There was no shallowsky.com on the net ...
nor any of the other domains we host from that server.
Lovely. Down less than 7 hours after we'd left, and no way of fixing
it until we got home a week later.
Luckily for me, a friend was generously willing to host my mail for
the week I was gone (including the associated bucketloads of spam).
That didn't solve the web downtime, but at least in theory I wouldn't
miss any important messages that came in. At least, I wouldn't miss
mail that happened to come from servers that checked the new MX
record; turns out a lot of servers don't, and just keep re-checking
their cached address for days or weeks, bouncing messages
accordingly. Not much I could do about that.
Anyway, now I'm back from SCALE (the conference went well)
... and it wasn't the router at all. The repurposed
router is chugging along just fine; it was the DSL modem that
coincidentally chose our departure day to stop talking to the net.
Never underestimate the power of coincidence.
Sorry for the downtime! Maybe it really is time to move this domain
to an ISP.
Tags: blogging, downtime
[
21:03 Feb 23, 2009
More misc |
permalink to this entry |
]
Fri, 29 Feb 2008
Python is so cool. I love how I'll be working on a script and
suddenly think "Oh, it should also do X, but I bet that'll be a
lot more work", and then it occurs to me that I can do exactly that
by adding about 2 more lines of python. And I add them and it
works the first time.
Anyway, it turned out to be very easy to go through all existing
blog articles and add tags for the current category hierarchy,
being careful to preserve each file's last-modified date since
that's what pyblosxom uses for the date of the entry.
add-tags.py
Tags: blogging, programming
[
19:37 Feb 29, 2008
More blogging |
permalink to this entry |
]
Wed, 27 Feb 2008
Entries on this blog are arranged by category. But all too often I
have something that really belongs equally well in two
categories. Since pyblosxom's categories follow the hierarchy on disk,
there's no way to have an entry in two categories. Enter tags.
Tags are a way of assigning any number of keywords to each blog
entry. Search engines apparently pay attention to tags, and most
tagged blogs also let you search by tag.
I wanted my tags to follow whatever canonical tag format the big
blogging sites use, so search engines would index them. Unfortunately,
this isn't well documented anywhere. Wikipedia has a
tags
entry that mentions a couple of common formats; the HTML format
given in that entry (<a rel="tag" ...>)
turns out
to be the format used on most popular sites like livejournal and
blogspot, so that's what I wanted to use. Later, someone pointed me
to a much better tag
explanation on technorati, which is useful whether or not you
decide to register with technorati.
Next: how to implement searching?
The simplest pyblosxom tags plug-in is called simply
tags.py.
All the others are much more complex and do tons of things I'm
not interested in.
But tags.py doesn't support static mode, and points
to a modified tags.py
that's supposedly modified to work with static blogs.
Alas, when I tried that version, it didn't work (and an inquiry on the
pybloxsom list got a response from someone who agreed it didn't work).
So I hacked around and eventually got it working.
Here's a
diff
for what I changed or just the
tags-static.py
plug-in.
Additional steps I needed that weren't mentioned in tags.py:
- Add "#tags foo,bar" directives as the second line of an entry,
right under the title; anywhere else in the file it will be ignored.
- You may ned to create the tag directories
http://yoursite/tags/$tagname
yourself (pyblosxom created the directories for me on the web
server, but not on the machine where I first tested).
- In addition to the config file entries discussed below, if you use
an extension other than .txt (or maybe even if you don't) you also
need to set
py[ 'taggable_files' ] = [ "ext" ]
- In your story.html template, include
$tag_links
wherever you want the tags line to go. But make "Tags:
"
or something similar be part of the pretext, so it won't
be included on un-tagged entries.
I also wrote a little python
index.cgi
for my blog's /tags directory, so you can see the list of tags used so
far. Strangely, tags.py didn't create any such index, and it was
easier to make a cgi than to figure out how to do it from a blosxom
plug-in.
And as long as I'm posting pyblosxom diffs, here's the little
filename
diff for 1.4.3 that I apply to pyblosxom whenever I update it, to
let me use the .blx extension rather than .txt for my blog source files.
(That way I can configure my editor to treat blog files as html, which
they are -- they aren't plaintext.)
Anyway, it all seems to be working now, and in theory I can tag all
future articles. I'll probably go back and gradually add tags to
older articles, but that's a bigger project and there's no rush.
Tags: blogging, programming
[
16:04 Feb 27, 2008
More blogging |
permalink to this entry |
]
Wed, 26 Jul 2006
Administrivia:
I've switched over to using static files with pyblosxom, instead of
generating everything from a CGI, to save some load on the server.
That means that URLs on this blog are changing to be a bit cleaner.
For instance, this entry, instead of being
http://shallowsky.com/blog/index.cgi?blogging/tostatic.html,
becomes http://shallowsky.com/blog/blogging/tostatic.html
instead.
The RSS URL changes from http://shallowsky.com/blog/?flav=rss to
http://shallowsky.com/blog/index.rss
The best top level URL to use is http://shallowsky.com/blog/
I've hacked up a python CGI script that will try to remap the URLs
appropriately, so old feeds will continue to work for a while.
But it probably isn't very robust, and I'd like to get rid of the
script eventually, so please update any bookmarks you might have to
this blog.
Tags: blogging
[
23:38 Jul 26, 2006
More blogging |
permalink to this entry |
]
Tue, 15 Feb 2005
Lots of Linux blogging software, such as the pyblosxom I'm currently
using, uses the Unix file date on for each posting to determine
the date at which the entry was made.
This makes it very convenient to add new entries, but it also
makes it tricky to go back and update an old entry without losing
all information about when the entry was originally posted.
I've been using a little sh script I hacked up for the purpose,
which parsed the output of ls -l and then passed that in to
touch -d.
It worked, but it was ugly and had problems with postings that
crossed a year boundary or were too old (because the ls -l
format varies).
I finally got around to rewriting the script in python.
It's more robust now, and cleaner, plus it checks EDITOR and
VISUAL instead of always using vi.
blogedit
Tags: blogging
[
23:51 Feb 15, 2005
More blogging |
permalink to this entry |
]
Thu, 26 Aug 2004
I discovered this morning while trying to improve the layout of
this blog that Blosxom (the perl version) keeps six processes
running once a query has been made. So changes to the CSS don't
actually show up on the web site, because the copies in the
running processes' cache don't have the new changes.
That makes it rather challenging to integrate new CSS changes
into a Blosxom site. (There must be a trick -- I've seen some
nice looking Blosxom sites, but there aren't any templates or
hints in the documentation.)
So I went looking for alternatives, and decided to try
PyBlosxom
first since it didn't require any changes to the existing entries.
It's very nice! Much easier to configure than perl blosxom, plus
it comes with (a) CSS template samples and (b) a collection of basic
plugins that actually work. Nice!
So now I have a sidebar and a category list as well as a calendar,
and CSS configuration should be much easier from now on.
Tags: blogging
[
17:07 Aug 26, 2004
More blogging |
permalink to this entry |
]
Fri, 23 Jul 2004
I tried nanoblogger yesterday, wondering if it would fix the
problems I'm having with blosxom (primarily, not being able to
limit the display to a small number of entries then offer some
way to get to earlier entries). It does fix that, but it has
other problems: it has a lot of bugs involving duplicate entries
that show up if you remove items or add them to categories,
and the category management is a hassle (you have to refer to
categories by number, there's no menu offered, and the command
to list the current categories is nonobvious though of course
it could be aliased).
A slightly bigger problem is that since entries are generated when
they are initially input, any change to the entry format later
doesn't get reflected in what appears on the web. Only sometimes
it does. I wasn't able to find a command that just did "refresh
entries" though adding a new entry sometimes accomplished that
for older entries (as well as also introducing duplicates and
other strange problems).
I was also a little bothered by not being able to preview the
site locally (nb hardcodes the site's url, so links all go to
the real site rather than the local copy, and css files work
inconsistently -- they work on some pages but not others) but
OTOH blosxom, being a cgi, obviously can only work through a web
server and not as local files, so they both have that problem as
far as maintenance on a disconnected laptop (and in both cases
it can be worked around).
The default nb look (when it does use the css, which it doesn't
always) is much nicer than the default blosxom look. For blosxom
I'll have to write css and collect a bunch of plugins to get things
that nb offers automatically, like a sidebar with topics and a
calendar of past entries. That's an appealing side to nb.
I'd be really tempted if those duplicate entries weren't such
a problem. Hmm.
Tags: blogging
[
10:48 Jul 23, 2004
More blogging |
permalink to this entry |
]
Sun, 18 Jul 2004
I'm testing out the possibility of switching to Blosxom.
It was very easy to set up, and wasn't even that hard to move my
entries over (thank goodness there weren't that many of them, though)
but there's a showstopper: I can specify $num_entries, the number
of entries shown on a page; but there's no way to get to the
previous entries! You can specify a date if you know it, or a
year, or a month; but in each case, it will only show you the
first $num_entries entries for that time period.
Who would want to have a blog but have a bunch of unreachable entries?
I've asked around, googled, and spent an hour or so in the source
(which makes it look like $path_info is set if a date or topic
is specified, otherwise unset, and patti found a yahoo posting
that suggested doing something like
$num_entries = ($blosxom::path_info ? 999 : 3);
but in fact, $num_entries is always null).
I've been through all the plugins, too. How could this popular package
be broken in such an obvious way?
Tags: blogging
[
23:59 Jul 18, 2004
More blogging |
permalink to this entry |
]