Showing posts with label rant. Show all posts
Showing posts with label rant. Show all posts

Saturday, September 03, 2022

Why YAML, Why?

 Last night I finally joined the ranks of those who despise YAML. I've always known (and known of) admins who loathe YAML. They rail against it every time they have to use it, or any time it is even mentioned. Primarily, they complain about it being white space sensitive.

  In the past, I considered this an extreme reaction. An overreaction to a minor annoyance. I'd not encountered any problems in using YAML so far, even when making the same edits they complained bitterly about. I considered the indentation fairly logical, and figured that if you treated YAML a bit like a wild animal, by giving it some respect and moving slowly, that it wasn't very likely to bite you and everything would be fine. For a long time, it was. Until it wasn't.

  I should preface that my bad experience with YAML did occur at almost 2am, so I wasn't functioning at peak capacity by any means. I was trying to implement Authelia for my self-hosted sites and it uses YAML for its config and its on disk user database both. I finished configuring it and launched it for the first time, then tried visiting my site, and got a 500 error. 

  Several rounds of troubleshooting later I found that the container was failing due to errors reading the config file. I found the line number where it began complaining about not finding expected keys and took a look, but couldn't see anything wrong. After many attempts, I ended up going back to the sample config file I had copied as the base for my file, and copied several lines to either side of the offending line. I then removed these same visually identical lines from my config, and pasted those from the sample config back in. Visually, nothing had changed, but the logs no longer complained about errors in the configuration.

  Instead, they complained that the display name of my one user couldn't be an empty value. It wasn't empty. I tried several variations, before finally tracking down a sample file, commenting out my entry, pasting in the sample, and then modifying it with my user's details. And it worked. Annoyingly.

  My best guess is that there was whitespace, either tabs vs spaces, at the ends of the lines, or on seemingly blank lines that was the source of the problem. Visually, there were no differences between the working and the non-working code. Indentation was the same. And of course, the error messages are very unhelpful. The problem wasn't that the value was empty, but that something else was causing the parsing to be incorrect.

  So, freshly burned by this experience, I have reluctantly converted to the side of those who consider YAML a terrible format for configuration files. There are much more forgiving options out there that don't require dark magic or blind copy pasting to get working when nothing is visually wrong with the data. 

  You won't convince me that whitespace is a problem in Python though. Not yet at least.

Tuesday, August 16, 2011

Sign Criticism

Driving home after work today, I saw one of those little signs stuck in the ground at a corner that said "Get Customer Leads" and had a phone number. The two thoughts that went through my head were: 1)  If you are so great at generating customer leads, then why aren't you contacting me instead of expecting me to call you?  2) If I were to call you,  would I end up on your list of customer leads that you sell to others?

Friday, September 21, 2007

My Webpage Addiction

So, yesterday, I had a recurring issue happen to me, which causes me much frustration. I lost about 100 webpages in Firefox. Yes that's right, I lost webpages. Ok, let me explain what I mean.

First, I have a problem. I collect webpages. I think that's about the only way to describe it. I will find a new webpage through any of a variety of means. I might open 15 pages from search results when I'm trying to troubleshoot a problem, or I might follow some links from various webcomics, or be sent something by a friend. Then, for whatever reason, I don't just read the page and move on. Instead, I save it. Either because I don't have the time to read it entirely right now, or I want to try it out later, or I think it's great reference material to keep around, or I want to send it to someone else. So for whatever reason, I want to keep it around.

Because of this, I've got hundreds of untamed bookmarks, synced between browsers, in theory, whenever Google Browser Sync works properly. (It synced at the beginning, but I'm not sure about lately.) I've also got a del.icio.us list that is 234 pages long at 10 items per page. And lately, I've become known (read as:ridiculed) for having as many as 150 tabs open in several windows in Firefox at any given time. Yes, starting Firefox is a 15 minute ordeal.

The strategy of just leaving the tabs open, works best for things I just haven't had time to read, or want to try in the next day or two. In theory. So, pre-Firefox 2.0, I use an extension to save my tabs, and restore them in case Firefox crashed on me. It also had the nice extra of saving the last 2 sessions, so if for some reason it didn't load my tabs properly, I could go back to the previous saved version. (Just don't close Firefox after not having your tabs load, or you will lose the good saved session information.) Firefox 2.0 came along, and with it, integrated session saving. This has been nice, and is more robust that the extension I relied on before (which is no longer compatible with current versions). However, it does not have the ability to re-load the session, or to load an older session.

Why does this matter? Well, I usually have the most tabs open on my laptop. And, for whatever reason I haven't tracked down yet, this is also my least stable installation of Firefox. I deal with a few crashes each day, on average. My laptop also has a quirk dealing with its Wifi, often requiring me to powercycle the radio before it will connect. Thankfully, it's just a key press on my laptop. However, if I fail to realize I'm not connected before I launch Firefox, or if (as happened this last time) Firefox gets auto launched because it was open when my previous X11 session ended, then all my tabs come up unable to connect. Once this happens, I have to go connect to the net, then reload each tab by hand. If I don't, then they will be saved as blank tabs, and Firefox will forget what site was previously loaded in them. Once this happens, they are usually gone, because I obviously do not remember what I had loaded in 150 different tabs. In addition, many of the tabs have been open for weeks, or longer, so they will no longer be listed in my browser history.

So, today, when my laptop decided it wasn't going to resume from suspend anymore, but would instead hang on booting, I managed, through a serious of events, to have this happen. This is probably the tenth time or so I have lost my tabs. It really, really ticks me off. So I decided to see what I could do about it. Unfortunately, the answer is, if I had known what to do, and had been quick enough, I might have been able to save them. Maybe. Depends on how far gone they were once I got the rest of the system functioning again. (How does Gnome just forget you had a notification area on your taskbar?)

There is an API available, with something vaguely like what I would want, mentioned as a potential use case. However, my coding skills are infantile, and creating a program to utilize this would be way beyond me. I did, however, come up with a stop gap measure. I added an entry t o have logrotate copy the session saving information for me (which is updated routinely as Firefox runs). This means, in theory, that I will have snapshots from several days available, and hopefully anything added after the snapshot was taken will be recent enough to still be found in my history.

Yes, I do realize that the real solution is to change my habits, and stop leaving so many tabs open. However, this is my stopgap solution. Time will tell if it works or not. May I never need to use it.

My configuration entry for logrotate:

/home/madasi/.mozilla/firefox/8ryaickb.default/sessionstore.bak
/home/madasi/.mozilla/firefox/8ryaickb.default/sessionstore.js {
        rotate 7
        daily
        copy
        dateext
        compress
        missingok        

}

Tuesday, August 29, 2006

Christmas Decorations

Ok, I realize that the whole "Christmas is over-commercialized" thing is itself commercialized at this point, and that nobody cares anymore, but I just want to note it down somewhere, because I say I'm going to every year.

Last night, August 28, was the first time I saw Christmas stuff for sale in a store. Granted it was Big Lots, but they had a decent amount of it out, near the generic fall, and Halloween decorations. They also had the stocking instruction sheets that diagram hot to lay it out on the shelves, so it wasn't just a case of having happened upon some extras they were trying to unload.

So, that's what, only 4 months of shopping time now?

Saturday, July 01, 2006

EULA'S

I avoided bringing up the Sony/BMG rootkit fiasco back when it was big news The reasons were 1) it's a decently technical subject, and if you understand what I'm talking about, you probably also already knew what is going on, and 2) many people more technically proficient, knowledgeable, or eloquent than I have already said quite a bit about it. I do want to mention the issues inherent in the horrible EULA that accompanies these CDs, and other computer software. I dislike these one sided agreements where terms get dictated, and you have only a binary yes/no choice, usually after you've already paid for the item. Software isn't the only place these are found though, not by far. Admission tickets to almost anywhere are pretty bad, parking garage claim tickets, etc. Here is the exact text from the back of a ticket from our recent trip to the zoo.

"This ticket is issued to Holder as a revocable license which may be revoked at management's discretion for any reason including Holder's acting in a disorderly manner or otherwise violating the rules or regulations of the Zoo. The Zoo shall not be required to issue an exchange or refund for any reason including inclement weather. Holder voluntarily assumes all risk and danger of personal injury and all hazards, which are related in any way to Holder's visit. The zoo and its officers, directors, employees and agents are neither responsible nor liable for any injuries, expenses, claims, or liabilities resulting from or related to Holder's visit and Holder expressly releases each of those persons from any claims arising there from. Holder grants permission to the Zoo and its designees to utilize Holder's image, likeness, actions or statements in connection with any live or recorded video, photographic display or other transmission or reproduction without payment, inspection, or review by Holder. Holder agrees not to transmit, distribute or sell (or aid in transmitting, distributing or selling) any description, account, picture, video, audio or other form of reproduction of the visit for which this ticket is issued. Pets are not allowed inside the Zoo."

So, this license says that no matter what, they don't have to give me my money back. No matter what happens I've agreed not to hold them responsible. They can take as many photos/videos of me as they want and use them any way they want, and I don't get to see them first, or even be notified of it. Finally, I'm not allowed to even show my vacation photos, especially not on the Internet. I can't tell you what I saw, or what they have at the zoo, I can't give you my review of it, etc.

Typical all for me, none for you treatment. Do celebrities get special tickets? That can't afford (and don't allow) their likeness to be given away this freely. What if I don't agree to these terms? Am I out my money? These are the kind of things a lawyer somewhere thought up, and it gets shoved down your throat, and most people probably never even read the back of the ticket.

It's these kind of invisible, legally binding contracts we enter into so many times per day, usually without ever knowing it that bug me. America is already lawsuit crazy enough that the zoo feels the need (or the zoo's lawyers feel the need) to limit their liability, and while we are at it, let's throw some other things into the contract. Now if we get a bad review, we have legal grounds to sue. Not that we would, just in case, you know, we needed to.