Hyper Text Coffee Pot Control Protocol

Turns out that HTTP 418 comes from the Hyper Text Coffee Pot Control Protocol.

HTTP 418

Coming home tonight, I ended up behind a car with the number plate HTTP 418. I was intrigued by this, so I made a note to check it when I got home.

Just checked it on Wikipedia and the HTTP response code means “I’m a teapot”.

This was apparently created in 1998 as an April’s Fools Joke. I’m impressed that this is an actual response code, impressed that a sense of humour is still in the Internet despite the corruption by industry, and impressed that someone knew this and got a number plate out of it.

Configuring Midnight Commander

I use Midnight Commander a lot. I depend on it. Over the years, it’s gone through a lot of configuration changes. At one point, I had the mc.ext file working nicely so when I had an image file highlighted, and pressed Enter, it would display that file with gqview. Gqview went away, and was replaced with geeqie. I reconfigured Midnight Commander to use geeqie. But somehow, my change disappeared.

Here’s what I think happened.

The config files for Midnight Commander are currently in ~/.config/mc. They’ve been in lots of different places over the years, but this is where they currently live. The file that controls what handles files is mc.ext.

All the different file types are listed in there like this:

type/^JPEG
    Include=image

and further down, handling of type Image is controlled by this:

include/image
    View=%view{ascii} /usr/libexec/mc/ext.d/image.sh view ALL_FORMATS
    Open=/usr/libexec/mc/ext.d/image.sh open ALL_FORMATS

That will push images out to Firefox. Why, I don’t know. I’ve read that file, and it doesn’t mention Firefox. But in action, if I hit Enter on a file, it displays it in Firefox, moving Firefox from the window it was open in, and doing other things I don’t want to happen.

I think in the past, I edited that file to force images to geeqie. But that’s a mistake. Next time there’s an upgrade, that file gets overwritten. If you want customised changes to be permanent, you must make them in your local config file.

So I edited ~/.config/mc/mc.ext and changed the Image section to this:

include/image
    View=/usr/bin/geeqie %f
    Open=/usr/bin/qeeqie %f

and now it behaves the way I want it to behave.

Upgrade to ownCloud 7

I’ve made a terrible mistake.

I’ve heard myself say that many times this year, and I said it again today.

I use ownCloud, and I use it heavily. I use the News feature the most. It’s an amazing News RSS reader. I use it daily, many many times. I use the file transfer, contacts, calendar, bookmarks, tags. I use almost all of ownCloud to help me have a happy and productive life.

Last week, a little yellow notice started appearing at the top of the page, telling me that ownCloud 7 had been released and I could upgrade.

[owncloud upgrade]

Last time I did an ownCloud upgrade, I ran into some minor issues. Nothing much, but I struggled a little to get News working again. This time I was going to be more cautious. I waited. After a week I checked to see if there were issues, and there did not appear to be. So I attempted the automatic upgrade. It went smoothly. At the point where it suggested I backup the directory, I considered it but did not do it. I made a terrible mistake. The upgrade proceeded, and it upgraded the database tables and structures.

After the upgrade, things looked good at first. Nearly everything was there and it worked. And then I started noticing the two big problems.

Tasks did not work. Tasks would attempt to load, but never finish loading the tasks in the database. News was not to be seen, but that was the same as last time. Last time, I fixed it by going into apps and enabling News. Uh-oh, News is not in the app store and I can’t just enable it. I spent a few hours reading and fumbling and trying to make News work. I could not. The News section is so important to me, that I decided to downgrade back to ownCloud 6.0.4, the last version I had running.

Then I wished I had made a backup of the directory. And a backup of the database.

But wait, at 3:30 each morning, I do backup the MariaDB database. So I have a backup from this morning. I copied the ownCloud 7 directory in case I needed anything. Then I installed the code for ownCloud 6.0.4. Then I extracted the SQL for just ownCloud from my backup, and I loaded that in. Then I aimed at my ownCloud URL. It wanted to do the installation. I entered an admin account, and gave it the MariaDB parameters, and wow, I was back in business. The passwords were all wrong, different seeds, so I had to re-enter them. I enabled Tasks and there they were. I enabled News, and bless it, all my feeds were there and I had 70 to read again. But oops, all my files were gone. No matter, I retrieved them from the saved ownCLoud7 directory and copied them into place. And all is well.

I am back to where I was this morning with all services enabled and caught up.

Lessons learned – backup before attempting an automatic upgrade; wait longer before thinking about doing an upgrade; do more reading for the optional modules like News.

I should report these things to ownCloud. I will keep reading their notes and report the Tasks problem. I don’t think the News developer has it ready for ownCloud 7 yet. I think I was premature in upgrading. I’ll keep reading his notes and not upgrade till he says it’s ready for ownCloud 7. I may be on ownCloud 6 for a while.

Marvin for epubs

I already had Marvin installed, and I reinstalled BlueFire, and I went through the appstore and looked at other epub readers.

BlueFire was still twitchy, and didn’t have a way to categorise books. iBooks had a way of categorising and separating books that I liked. I read a book in BlueFire and it’s nice, it’s got a good display of fonts and yes, it looks really good. But no way to categorise that I could see.

None of the other readers looked interesting. I read a book with Marvin. Not as clean a display as iBooks or BlueFire, but it had a cheerful feel to it. I know that’s not scientific, but the display was good enough, the options are terrific, the more I used it the more options I found. Even Dropbox. And a Calibre plugin. And it has a way of categorising books and doing bulk operations on books. I loaded up some of my library and it took it all. I flicked between BlueFire and Marvin, and finally the convenience of Marvin won me. I deleted BlueFire and I deleted iBooks. Marvin is the way forward for me, for the time being.

I just hope they don’t do what most apps do – improve them to the point of unusability.

I would have been happy with iBooks. If I had managed my library in the One True Sanctioned Way through iTunes, I would not have had the problem. But I manage my library without iTunes. I hate iTunes. It’s a spreadsheet abomination that I use as infrequently as possible. So if a full encrypted backup of my iPad means that iBooks will shed all unsanctioned books, I either have to not back up (not an option), or use another ereader. I choose the other ereader. Marvin.

iBooks on iPad lost all my books

I would have to say it threw them away, rather than lost them. It seemed a deliberate act.

I settled down this afternoon to continue reading on my iPad, opened iBooks, selected the book I was reading. The book opened up, displayed my page, and then iBooks dropped out. When I restarted it, all my loaded books were gone. The books from the iTunes store were there, but everything I had loaded from my own sources was gone.

Earlier this afternoon, I backed up my iPad to iTunes. I don’t sync books. I didn’t change any sync settings. I’m not sure if this is related, but from my reading, it appears it might be.

I used to use BlueFire reader, but with the iOS7 update, it got twitchy. If I tapped a book the wrong way, it saw it as a swipe and wanted to delete the book. I moved to iBooks after that. But now iBooks is displaying irritating tendencies, it’s all open again. I’m not going to use an app that will throw away books from my sources and keep the “official” sources. So iBooks is now out. I’ll go back and look at BlueFire, but I’ll also look at Marvyn. I started looking at that earlier, but now I think it deserves a better look.

I don’t require much in an epub reader. Folders, non-twitchy UI, and not throwing away my books when it feels like it. That shouldn’t be hard.

Mac Mini Server

I acquired a mid-2011 Mac Mini Server. It’s got two 500 gig hard drives in it, and 8 gig RAM. Running OS X Lion Server. The guy who sold it had started using it as a server, but never really got into web development. So he was using it for his photos and music. Then he needed money, so he sold it.

He had deleted most of his files, and he had erased most things, but left his Apple ID and other things behind. I didn’t care, I wanted a clean start and wanted to erase everything. First I tried to install Mavericks, thinking that would erase Lion Server. Twice, it got about 4 gig into the 5.32 gig download and then stopped and told me it couldn’t do it. I wasn’t sure if this was because of download problems, or if it was a permissions problem with conflicts over Apple IDs.

Next, I hooked up an external DVD drive, and tried to install a non-server version of Lion. It told me it wasn’t allowed to do that on this machine.

Then I did some research. Turns out there is a hidden partition on the hard disk. Reboot with holding down Command-R gave me a special menu. First up, I used the Disk Utility to erase the two hard disks. Then I asked it to reinstall Lion. Turns out it reinstalled Lion Server. But it downloaded more stuff for six hours, and finally it finished and it reinstalled Lion. This time, I got my Apple ID in, and it was the only Apple ID it knew about. Then into the App Store and start the free upgrade to Mavericks. This was the 5.32 gig download again. It got all the way to 5.20 gig downloaded, and then it froze. Ten minutes went by, then fifteen, then it rushed ahead and downloaded the last little bit.

I then got told that the Server components had been disabled. If I wanted them, I could go into the App Store and buy the latest version. I was happy with that. I don’t want the server component. The Dock icon for Server now had a large X through it. I put it in Trash. Then I used Finder and put the whole Server app into Trash.

This is great. I just wanted another newish Mac Mini that will take Mavericks, and hence XCode, so I can do some development, and that’s what I ended up with. I’ll get XCode on it next week, and the 8 gig RAM will be a big help there. I’ll take the other one home and use it for the same thing. So now, Anne has a newish Mac Mini with Mavericks, and I now have two of them. We can probably stay up-to-date with new versions of the OS for another five or six years.

ownCloud problem

After praising ownCloud so highly recently, I now have to report a problem with the ownCloud Linux client. Everything else works just fine – the webserver, the Mac clients, the iPad and iPhone software – the only thing having a problem is the Linux desktop client.

I have the client installed on my Slackware desktops, installed using sbopkg. The client depends on libocsync.so, and that depends on libiniparser. Both of these are add-ons from sbopkg. libocsync is a version of csync (a file synchroniser) that has been modified to work with ownCloud. It looks for the flag SAMBA_4.1.6 in libiniparser. I don’t know why it does this as I do not use samba at all. Libiniparser got upgraded in April, and the flag changed to SAMBA_4.1.9. But libosync still wants SAMBA_4.1.6 so when I start owncloud now, I get this error message “owncloud: /usr/lib/libiniparser.so: version `SAMBA_4.1.6′ not found (required by /usr/lib/libocsync.so.0)” and it will no longer start.

The ownCloud client has been running on my work and home desktops for a long time, but I rebooted my work desktop and now the ownCloud client won’t run. It’s still running on the home desktop, but the next time I shut it down and attempt to restart it, it’s not going to run either.

I think I had this problem happen once before, but I can’t remember how it started working again. That’s why I started writing here again, it’s my way of making system notes for the future.

I think I waited a little bit and libocsync.so got upgraded to come back into sync with libiniparser. I have a number of options to try and make it work.

Forcing Midnight Commander

I have a theory that most really useful utilities get improved to the point where they are awful.

I’ve been using Midnight Commander (mc) at the command line, in xterms, since 1994. 20 glorious years of useful use. But lately I’ve been struggling with it. The defaults keep getting changed, or else the distribution defaults get changed, and I have to keep making over-riding corrections so I can keep doing what I want to do.

First of all, I don’t want to exit from Midnight Commander and be in the last directory I accessed. Given that this is default Slackware behaviour, I would guess that many people want this. I do not. So every time I do a new installation, or upgrade Midnight Commander, I make the shell scripts in /etc/profile.d.mc* not executable.

Then I want to be in the left pane when it starts. I want Midnight Commander to start with my focus in the left pane, and if I told it to start in a directory, I want that directory to be in the left pane. I have it doing this now, but I can’t work out how I did it.

But the thing that has started driving me to a rage is what directories it displays. I don’t know what other people want, but I want the absolute simplest approach.

If I type mc with no parameters, I want left and right panels to be the current directory. If I type mc with one directory after it, I want left and right panels to both be set to that panel. If I type mc with two directories after it, I want the first one to be in the left panel, and the second one to be in the right panel. That makes sense to me, but I can’t configure mc to give me that. Maybe I am just not reading the right parts of man or the documentation. Anyway, I have conquered this with brute force.

First, I have an alias so if I type mc, it runs my mc script in $HOME/bin.

Second, that script does exactly what I described up above.

#!/usr/bin/bash

DIR1=$1
DIR2=$2

if [ "$DIR1" == "" ]; then
  DIR1="."
fi
if [ "$DIR2" == "" ]; then
  DIR2=$DIR1
fi

/usr/bin/mc $DIR1 $DIR2

And with that in place, my blood pressure and my rage have subsided. Now it doesn’t matter what the defaults get turned to, my use of mc will be the way I want it, how it makes sense to me. I am grateful that I can control this, to allow me to do things my own odd way.

New Mac Mini

I generally buy used Apple equipment, being reluctant to pay the premium for brand new gear. This means I spend less, but tend to be a bit behind. Right now, I have a Mac Mini stuck at Snow Leopard (10.6), a MacBook and a MacBook Pro, both from 2006, stuck at Lion (10.7). They work well, they do all that I need, but they cannot progress to the latest levels of Mac OS X. Normally, I wouldn’t mind. But at work, we have a need for an iPhone app, and I wanted to explore iOS development. For that you need XCode, and XCode needs Mountain Lion (10.8) or Mavericks (10.9) to run. I cannot put XCode on any of my devices. So staying at the blunt edge of technology does not work if you want to do iOS development.

I needed a machine that could run Mavericks. I investigated Craigslist and found once again that most people selling equipment on Craigslists are complete arseholes who take hours to answer texts, won’t give out phone numbers, give addresses that don’t exist, and sometimes don’t even have the equipment for sale. I kept looking at MacBook Pros that were from around 2009 and 2010, that are running Mavericks, and cost about $600. Generally they only have about 2 gig RAM, so I would have to upgrade the memory before doing anything serious with XCode. But the problem with these is that they probably would not be able to run the latest Mac OS X in a year or two. What I really wanted was a development machine that would be up-to-date right now, and continue to be up-to-date for the next six years. I needed to buy a brand new Mac.

Have you looked at the prices for brand new Mac Books and iMacs? Insane. I’m not spending that much money. I ended up getting a Mac Mini with 4 gig. Normally I would get it at Apple, but Best Buy had $10 off, and I had a coupon for $15 off anything, so I got it at Best Buy. Only 4 gig, but I can upgrade to 16 gig for about $150 from Crucial.

I got it to work, upgraded all pieces of software, discovered that I get iWork for free, so got that downloaded, and got XCode downloaded and installed. I am set and ready for iOS development. I have the Big Nerd Ranch book for tutorials on old-school iOS development, and some newer works on Swift development, and I am ready to learn.

←Older