HCoder.org
Posts in Category “Meta”
-
Flattr: microdonations rock!
Aug 31, 2010 onEver since I discovered Flattr I was really excited about it. Back then it was a closed beta, only-by-invitation service, and I couldn’t get hold of an invitation before they opened it to everyone.
Of course I signed up, tried it out and looked for content to “flattr” right away. I think the idea is great, and I can’t really complain about the implementation either. The service feels really easy to use and understand, and there are many extensions and plugins to integrate with different tools, including the Wordpress plugin I’m using.
How does Flattr work then? Basically, you pay a fixed amount of money per month (you choose how much of course!), and you click “Flattr” buttons of the content you find interesting on the internet. At the end of the month, the money you paid is divided between the number of buttons you clicked, and each of those “slices” will be given to each author. You can watch the video below for a better explanation:
The only downside is that the money Flattr gets for every transaction is a bit high (10%), but I really like the idea and the service and I feel it’s something I have to support. Because, as the Question Copyright folks say, “I am the content industry”.
-
Goodbye Typo, Hello WordPress!
Jan 24, 2010 onAs I had mentioned several times, I had been frustrated with Typo. Several bugs or misfeatures that really annoyed me, upgrades that had frustrated me, and sometimes the feeling that more or less visible things were broken from time to time in new releases. And while the upgrade problems were mostly because of the need to upgrade Ruby gems, still it was something that was inevitable with Typo apparently, so sticking with Typo meant having to deal with Rubygems, which as you may know I hate.
So, after the last upgrade and the frustrations that came with it, I decided to ask around for good blogging software. The main contenders I had in mind were Wordpress and Movable Type. Most of the people who replied talked wonders about Wordpress, but I decided to try both. Wordpress’ installation was ridiculously easy (I’m talking about installing my own copy, not opening a blog in wordpress.com obviously) and I had a working blog pretty quickly. Also, at least the first impression of the UI is that it’s very slick and easy to use. It shows maturity. Movable Type was easy enough to install, although I did have some problems (mostly due to my own stupidity, but still). The first impression was that Movable Type was much “heavier” and maybe a bit too much for a single, personal blog. So I decided to go for Wordpress, which was the one that I had been recommended by most people anyway.
So, the first thing I had to do was exporting the content from Typo’s HCoder so I could import into Wordpress. I quickly found some script for Typo that would export in Wordpress’ format, for easy import. It worked very well, although I did a problem with the tags: they were treated as normal categories, so I ended up with many categories and no tags (and a huge, horrible, impossible to navigate sidebar with dozens of categories). I started to look around, and I couldn’t find a spec for the wxr format. Maybe I was naive thinking that there would be one, but hey. In any case, eventually I figured out that I had to change the:
<category>rants</category>
to
<category domain="tag">rants</category>
for the tags. The categories had to stay as they were, but luckily for me, all uppercase names were categories, and all lowercase names were tags, so I could do the trick with vim with:
:%s/<category>\([a-z]\)/<category domain="tag">\1/
After that, I could import back all the content, but then I had the next hurdle: the style of the blog. I didn’t mind if the design wasn’t exactly the same, but I was used to the old one and didn’t want to change it too much, so I used the excellent Opera Dragonfly to inspect the styles of the old blog, and I slowly copied the most interesting values (colours and font sizes mostly) to the equivalent CSS classes in the Wordpress theme. I’m happy with the result, so I think I’ll leave it as it is for now.
Last, but not least, I wanted to try to keep the old URLs working. I did two things for this:
-
I added some URL rewrites to keep Typo’s feed URLs working. However, the Atom ones also redirect to the RSS ones, I wonder if that’ll be a problem.
-
I changed the default permalink settings in Wordpress so they matched what I had in Typo. Hopefully almost all blog posts will actually keep the URL and the migration to Wordpress won’t be very traumatic. You tell me if I’ve broken anything ;-)
One thing that I don’t like about Wordpress’ blog editor is that apparently it doesn’t allow you to write in some Wiki-like syntax, like Markdown or Textile. I know Movable Type does have it, but several other things made me stick with Wordpress and I’m happy overall. At least for now ;-)
-
-
Typo upgrade
Jan 3, 2010 onI have upgraded to Typo 5.4.1. Partly because of security issues, partly because of new features and improvements. It took me a while, mostly because of stupid Ruby deployment nonsense that makes me even more tired of Ruby as a language for production usage, than I already was. Oh well. One of the most important new features for me in this release was the article preview, which doesn't seem to work. Or maybe it does, but then support for writing blog posts in Textile seems like it was dropped. Suggestions for other blogging platforms that aren't a pain to upgrade because of the language dependencies, supports writing in some wiki-like syntax (e.g. Textile or Markdown) and generally works well are _very_ welcome. It seems that everything is in place and working now, but if you see anything misbehaving, please give me a shout and I'll try to fix.
-
Another Typo upgrade
Feb 23, 2009 onI just upgraded the blog to Typo 5.2. I had a couple of issues, but things worked reasonably ok. Just in case this helps anyone, these are the issues I ran into:
-
I had to install a ridiculous amount of dependencies, sometimes to go from version 1.1.1 to 1.1.3 of some module. I really wonder if Typo 5.2 really needs those versions.
-
When trying to upgrade, it seemed to hang in this line:
Backing up to /var/www/virtual/hcoder.org/db/backup/backup-20090223-1843.yml
. It turns out, it didn’t really hang, it just takes a good while (and yeah, the file stays at 0 bytes for a long time too) -
I had some permission issues that I had to fix (when upgrading, it tried to modify/copy some files, and it couldn’t)
-
When applying the migrations, it died with a really strange error message. It turns out, my version of Rubygems was too old ????
While writing this first post, I see some improvements in the admin interface, although I still can’t see any kind of “preview”. I hope it helps me with my struggle with spam, at least :-/
-
-
Problems with comments
Nov 26, 2008 onToday, my good friend “Esberrito” warned me that comments were not working in the blog. I hadn’t realised earlier, but I had them enabled so they should have appeared all the time.
I investigated a bit, and it turns out that there’s some bug (apparently related to saving a post as draft, then publishing) that makes the post have an empty “permalink”. When this happens, the link to the blog post looks exactly like the view of the posts for that particular day (say, http://hcoder.org/2008/11/23/ instead of http://hcoder.org/2008/11/23/why-i-hate-rubygems), so Typo decides that it shouldn’t show the comment form.
The bad news is that many posts are fucked now (although I have fixed some of the most recent ones). The good news is that it’s more or less easy to fix. You just have to connect to a “Rails terminal” with the production configuration (with
./script/console production
) and do something like this for each post you want to fix:a = Article.find(:first, :conditions => [“title LIKE ?”, “GPG%”]) => #<Article id: 41, type: “Article”, yadda, yadda, yadda, …> a.title => “GPG confusion” a.permalink = a.stripped_title => “gpg-confusion” a.save => true
Lesson learned: don’t save as draft for now (maybe I should upgrade to 5.1.3, it seems fixed there). Instead, untick the “Online” under “Post settings”, and hit “Publish”. That will assign a default, sane permalink value.
-
Irrepressible information
Nov 9, 2008 onI just remembered something really cool that I had on my previous blog: a small box that shows information that “someone doesn’t want people to read”. It’s part of a brilliant campaign called “Irrepressible info” by Amnesty International. Many of you know that I’m very Amnesty-friendly (“supporter” might be too strong a word, since I’m not really doing much apart from being a member), and I think this campaign is just pure awesomeness.
The idea is very simple: you take texts that have been blocked in some country and allow people to show them in their own websites. It’s a simple but poweful way of showing your rejection for censorship and your support for freedom of expression. As for what you have to do to join the campaign, it couldn’t be simpler. You just have to copy some Javascript code from the instructions page and you’re set.
I have of course added the information box to the sidebar, under the “Irrepressible info” header.
-
Spam adventures
Sep 22, 2008 onToday I have had a gigantic e-mail spam attack. And by “gigantic” I mean something like one every couple of seconds. It seems to have stopped by now, though (maybe until tomorrow, sigh). However, there is some small tip that I used in the meantime, and I have found it helps me filtering spam so I thought I’d share with you. It’s very simple: ordering by subject instead of by date. Of course, you have to filter your view to only unread messages, but it works surprisingly well.
This is very easy to do in mutt, my mail reader of choice (for personal e-mail; I have found that, at least for work e-mail, Opera’s M2 works quite well too). You just have to limit to unread messages (pressing lowercase “L” and then using “~N” as filter), and then sort by subject (
:set sort=subject
). I have even created too “macros” in mutt to switch back and forth between “spam filtering mode” and “normal mode” :macro index Cs ":set sort=subject<return>l~N<return>" macro index Cq ":set sort=threads<return>lall<return>"
Let’s hope it doesn’t begin again tomorrow
:-S
-
Sucky Typo update
Aug 19, 2008 onThe other day I was talking about upgrading Typo. The update itself went well, true, and the site was up and running without too much downtime, but then I started using it again… and I have noticed two things so far (both about writing posts) that I really dislike:
First, the good old editor is not there anymore: the Typo editor used to be really good, because on the left hand side you had a very reliable and easy to use textarea with Wiki syntax (you can choose which exact syntax you want), and on the right hand side you had a “live preview” of your post, automatically updated with Ajax, that showed you how the post was going to look like. Well, that’s gone. Now there are two options: some retarded WYSIWYG box, that I tried to use and failed, and some good old textarea… without the damn live preview. That sucks big time, because there is no other preview (that I have seen: please enlighten me if there is indeed one), so I just blindly write things in a Wiki format, and hope that it’s going to look OK when I press “Publish”.
Second, I was playing with the Wiki format for the articles, and I changed it to “Markdown” (I always mix “Textile” with “Markdown”, and never remember which is which; the one I prefer is Textile). After I hit “Save”, not only the next article was parsed in Markdown format by default, but every single blog post. It’s like, you select the parser the system is going to use to interpret your whole blog. How retarded is that? Once you have written posts, it doesn’t make sense to change their syntax (unless you do it manually editing the post itself). Clearly the format is a property of each blog post, not of the whole blog installation.
Not everything is bad though: it seems that now you finally have a “Draft” concept, so I can start writing a blog post and just save as a draft, instead of unticking the “Online” property and saving as a normal post. Also, the drafts are saved automatically, so I don’t have to remember to hit “Save” from time to time just in case the browser crashes or I hit something stupid and erase the contents of the post. Yay for that.
-
Typo upgrade
Aug 7, 2008 onHey there!
I have just upgraded Typo. It was slightly traumatic, because at first the blog broke horribly and I couldn’t see anything other than errors 500. To be fair, the change was quite big, because it included also an upgrade to Rails 2 (I was using some older Typo that used Rails 1.2.x), so everything worked better than expected.
I could login as admin, and change preferences and whatnot, and the only thing that was broken was the public view of the blog. I had a look at the logs, and it complained about not being able to find some template for the sidebars. I was very confused, and didn’t know where to starting looking for this. So, obviously, I asked “Señor Google”. He didn’t tell me that much, but someone left me the following hint: if you comment out the call to the helper
render_sidebars
(in the active theme code) solved the problem…. at the price of not having sidebars of course.So I decided to connect a Ruby/Rails console to the production database, and have a look at the Sidebar model. The summary of what I did is this:
Sidebar.find(:all, :order => ‘active_position ASC’). map {|s| s.active_position} => [0, 0, 1, 1, 2, 2, 3, 4] Sidebar.find(:all, :order => ‘active_position ASC’). map {|s| s.type} => [nil, “CategorySidebar”, nil, “ArchivesSidebar”, nil, “TagSidebar”, “StaticSidebar”, “XmlSidebar”] Sidebar.find(:all, :order => ‘active_position ASC’). find_all {|s| s.type.nil?}.size => 3 Sidebar.find(:all, :order => ‘active_position ASC’). find_all {|s| s.type.nil?}.each {|s| s.destroy} => [#<Sidebar id: 1, active_position: 0, config: {“empty”=>false, “count”=>true}, staged_position: nil, type: nil>, #<Sidebar id: 2, active_position: 1, config: {“title”=>”Links”, “body”=>”…”}, staged_position: nil, type: nil>, #<Sidebar id: 3, active_position: 2, config: {“format”=>”rss20”, “trackbacks”=>true, “comments”=>true, “articles”=>true}, staged_position: nil, type: nil>] Sidebar.find(:all, :order => ‘active_position ASC’).find_all {|s| s.type.nil?}.size => 0
So, the problem is that there were some (severely broken) leftovers of the upgrade. I just removed them, and everything started working again. Phew!
-
Welcome!
Oct 10, 2007 onAfter http://www.zingzang.org, I’m opening a new blog, this time in some sort of English ;-)
The current plan is to write (mostly) about technical things in this blog, and leave the rest to CincoReyes.
Hopefully, I’ll go back to doing some Debian work, and will also resume Haberdasher development (“Haberdasher” is the new project name for PatchSever; why the name haberdasher? Well, go to Wikipedia and check ;-)).