MySQL Log Sequence Error: solved, sort of

Back in November, I noticed that I was getting a lot of MySQL crashes, with MySQL’s logs saying that it had a log sequence error. It was actually MariaDB, the community-managed version of MySQL (as opposed to Oracle’s “MySQL proper“), but for all intents and purposes, it was MySQL.

I tried everything I could think of: delete the logs, restore from binary backup, restore from text backup, everything. After switching away from MariaDB and to the “actual” MySQL, it seemed to be more stable at last…

But last week my wife reported that her site was having some of the same problems. I took a look at the logs again, and .. the log sequence errors were back. What’s more, while watching the logs (via tail -f mysql.log I could see new failures happen, through routine usage: MySQL crashed, then restarted. Then crashed, and restarted.

Back to the drawing board: first, I repeated some of the same steps I’d done before, making backups just in case. I cleared out the database, and recreated it from scratch; same problems.

By this time I was really frustrated, but then I noticed someone mentioning… memory.

I immediately cranked up top (actually, htop), and noticed mysqld was using a ton of RAM, and that my server was swapping quite a bit.

I’d not tuned MySQL (as the RamNode wiki actually suggests you do!) but my first thought was that I wanted this server to actually be used for more things – so I bumped up my VPS to give it three gigabytes of RAM. It’s a new service plan, but the nice thing about it was that as soon as I ordered it, the instance was allocated more RAM – I literally watched it happen via htop.

And all my MySQL crashes went away. It hasn’t had a crash since then.

My other server – oddly enough, the one that runs this site – is still on a more constrained instance. I may move it at some point, because I don’t know that I need or want two servers; they’re just cheap enough that it wasn’t a big deal.

New system hard drive; AOMEI software worked about as well as one could hope.

I have been waiting for my system hard drive to fail for a while. It’s not been a bad drive, except for the constant warnings that it’s got a limited time to live – wait, isn’t that the definition of a bad drive? I guess it could be worse, but…

Anyway, last night I bit the farm, kicked the bullet, and bought a bucket – bought a new 1TB drive, and installed it. The process for doing this on Windows involves installing the new drive as a secondary (internal or external), cloning the system drive to the new drive, and then fixing the partitions.

I chose AOMEI Backupper to do the cloning (by the recommendation of various sites, after googling). Installation was easy enough; you can get the capability for cloning by spamming your social networks or buying a software license for $40 USD. (If you didn’t see me spam you, well, you can guess which way I chose.)

Cloning was simple; choose to clone drives, select the destination and target drives, and wait.

After cloning, you then switch the drives around (actually, what I did was move the new primary in place and replace my old secondary, which I’d removed in order to replace the primary.)

That left the partitioning – my old drive was smaller than the new one, and the cloned image meant that I had this dangling partition, empty and unused. My English teachers from way back when said that I should never allow dangling partitions – or was that participles? – so that needed to be addressed, too.

Since I’d already used AOMEI to clone the drive, I decided to try their partition assistant program to fix the partitions; it actually worked about as easily as one could hope, and I’m typing on my laptop now with a giant boot partition on the new, faster drive.

DuOS-M: Android on Windows 8.1

One of my sons recently got me invested in Ice Cold Muffin‘s ICE, a game in which you try to take over bases in a simple directed graph. It’s a lot of fun, despite the extreme simplicity – maybe other game makers could benefit from noticing how simple games can be fun.

Anyway, while it’s fun to play on my phone, it’s a little small – most of the ICE ships end up being barely perceptible. That’s probably okay, really, because you don’t win bases with single ships – you overwhelm them with fleets. But it’d still be nice to have it on the Surface, because… well, just because.

Running Android games on Windows is possible, of course, because Android has a development kit for Windows. But you wouldn’t want to run the Android emulator as an actual runtime environment.

After noticing BlueStacks and reading some reviews about it, I decided to give AMI’s DuOS-M a try; it seemed to get rave reviews and looked very clean.

Sure enough, DuOS-M worked, and worked very well; it’s trivial to install Google Apps (it comes with the Amazon Store by default, but after initial installation it directs you to a page through which you can install the Play Store as well). From there, it felt like an actual (and giant) Android installation; it was fast and convenient.

It occurs to me that with DuOS might allow me to read all of my uploaded Amazon content on the Surface, via Android. I suppose I could use it as a way to migrate away from Amazon.

At any rate, DuOS-M is well done, from what I can tell so far; I’m glad I found it. ICE is also a great game, if you’re interested in such things, written by a kid who’s only 17 – well worth supporting, in my opinion.

A few thoughts for a Monday…

Life has changed a lot lately.

First, I changed employers; I’ve left Red Hat (for various reasons) and am now working for a company that will give me a little more direct purpose, along with an imperative for using Scala. (Did you see what I did there? Scala’s typically a functional language, not an imperative one, so.. um… a pun’s still funny if you have to explain it right?)

Second, my wife and I both use the Microsoft Surface 3, in addition to our regular working computers. This means that unless you count virtual servers, I’m using more instances of Windows than anything else. (If you factor in remote hosts, Linux is still ahead.)

It’s an interesting set of changes. The job is going to be a lot of fun – a lot of work, but it’s a good fit for me, I think. Red Hat’s still a great company; if I’d not changed jobs, I’d still have been pleased to work for them.

However, this is a good change, and Scala is something I’ve enjoyed as a very casual observer; this gives me a chance to really roll up my sleeves and approach the language with a real intent and purpose.

Functional programming’s going to take some getting used to, though. I’m reading an excellent book, “Functional Programming in Scala,” but deep into the book – I cheated and read ahead – it says “Cause side-effects but shuffle them around so their location is more tolerable.” (Not a quote, even though it’s in quotes.) I’m not sure that’s a terrible idea – at some point you do have to have an actual effect – but the way it’s offered is odd. It introduces an inconsistency in the FP paradigm, and then handwaves it away.

The Surface is a wonderful device. Since it’s running the same platform as my other Windows devices (as opposed to the Surface 2’s Windows RT) I can migrate seamlessly between computers; the form factor is different, but little else is.

The form factor, however, is quite a change. I find the lack of an Insert key to be very much the absolute worst thing about the Surface – a lot of programs use it, and they left it off of the physical keyboard. (The virtual keyboard has it but eats up a lot of your screen space. I’ll use it on occasion, but definitely I far prefer the physical keyboard, which is part of the cover.)

Apart from the Insert key, the right mouse button relies on time of contact, which is something to get used to; an alternative is to use a Bluetooth mouse (or USB mouse). I’m still adjusting to that aspect of the Surface, but it’s less of a deleterious effect than the lack of a physical Insert key.

With all of that said, the Surface’ ability to be a tablet is fantastic. It’s my new book reader, hands down; the larger screen (compared to the Nook HD+) and more solid feel (along with the much higher resolution) is excellent for reading.

However, I’m moving away from Amazon; most of my library’s in the Kindle format, and I suppose that can’t entirely change (what with prior investment) but honestly, the Nook Reader application on Windows is far better; with the Amazon application for Windows, I can’t read my own content, and with Nook I can. I’m an author; I get my own books in EPUB format, and I purchase a lot of books in EPUB. With the Kindle for PC app, I can’t read them on the Surface; I have to use the Nook HD+ or my phone.

It’s not good that I can’t use my Surface for reading my own content. It’s not the Surface’ fault – it’s Amazon’s. If and when Amazon fixes it, I’ll be willing to use their reader again (and I’d prefer it, because that’s where most of my library is), but until then, Nook for Windows wins by simple default. It’s just as readable, and the fact that I can import my own content makes it a huge win.

Adding arguments to CentOS boot

I’m running CentOS in a VirtualBox image (so I can play with Docker while using Windows, because … um… because). I don’t want X running; I am happiest with the command line for this application. So the screen resolution is really important to me; I don’t want an 80-by-25 console, I want something better.

It’s actually really easy, once you know how – that’s why I’m writing it up, so someone else can see exactly how I did it.

First, I needed to determine what values to use. You can work out potential values using hwinfo, which isn’t part of the CentOS repositories – you’ll have to install it from GhettoForge.

To be fair, I knew what values I wanted – I wanted mode 792, or 0x318.

(You should figure out what mode you want, then try it on your kernel before setting up the boot parameters. You have been warned.)

All I needed to do to set the boot param was:

sudo grubby --args=vga=792 --update-kernel=ALL

With that, when I booted CentOS, I get a larger console (but not a giant console) perfectly suited for what I wanted.

Smart Grids series reposted

I just republished an article I’d worked on for Red Hat, called “Smart Grids.” It’s got twelve parts already, with two more not actually finalized; I’d been pulled off of the smart grids article and never quite got back around to it. I’d still like to, though. It’s a good walkthrough of an “Internet of Things” architecture.

Check it out!

The LinnStrument looks awesome

Geert Bevin pointed out the LinnStrument this morning. Color me jealous – that thing looks awesome.

It’s basically a MIDI controller built on a pad, largely on a grid – much like a stringed instrument’s notes are, except providing expression and note control and you move your fingers around. There’re demos of using it to play slide guitar, expressive saxophone, violin – I can imagine it being workable for drums but it’d probably be underusing a lot of the LinnStrument’s power for expression.

And it’s based on the Arduino – and the software is open source, at that! (Or the site claims – I didn’t see a reference offhand to the source repository. Geert told me it’s going to be available when the instrument is available, which makes sense.)

At $1500, it’s not cheap (nor has it been released yet, as of September 9, 2014) but it looks really nice – it’s a little like the Eigenharp in providing a different and unique control surface, while being a little less intimidating for people like me.

Repost: My speech synthesizer project from 1984

This is a repost, from 27 February 2006. It was on a blog-city blog I’d set up, and darn it if I wouldn’t rather it be on this blog.

This is a true story. If you’re reading this, Dad, the previous sentence is false.

My oldest son is into hardware, in a big way. Yesterday, for example, I took him to his version of Heaven – Fry’s, where we cherry-picked a set of ICs from their selection. As a reward for my dropping some serious change for EPROMs, digital counters, LEDs, wire, and other such things, he has threatened to force me to work with him building various gadgets.

He’s really good at it. I asked him to build stuff with hardware that would take me a minute at most with software, and a few minutes later, he’s done… provided, of course, it’s doable with his hardware selection.

See, I hate hardware. It’s so much not my forte that it’s not even mildly humorous. He can bury you with details about EISA, SATA, PATA, Socket 7, Firewire, USB2, Athlon, Intel, OMG, WTF, BBQ… and my eyes glaze over at SATA. I can’t help it. I try to keep up with him, but I just get lost.

The reason? My speech synthesizer project, courtesy of Ahoy!, back in 1984 or so.

Ahoy! was one of the Commodore 64-specific magazines back in the day, along with Transactor and a few others. They ran a series on building expansion cards for the C64 one time, and the idea of a speech synthesizer was so neatoriffic that my cousin, Curt Holland, and I rather unwisely decided that, parts list in hand, we’d embark on building this thing. (Incidentally, you can find this project on teh intarwebz: Ahoy!, a scan of the issue!)

We had everything we needed, except parts and tools (and money, and experience, and…) The parts list, as mentioned, was courteously provided by Ahoy!, as were the instructions for putting the thing together. My dad was (and is) a pretty accomplished engineer, so I set upon wheedling money out of him, so that the fruit of his body could follow in his rather illustrious hobbyist’s footsteps.

At least, that was the idea.

The article, you see, described the entire cost of the parts as roughly around $20. We went to Radio Shack with the parts list (which conveniently listed Radio Shack part numbers!) and went for the inventory… except some of the parts weren’t available. So we replaced parts with equivalents the best we could, aided by our handy dandy salesman who – armed with his two-year advantage in age – surely knew everything. Or so it seemed to us, being entirely clueless.

Uh oh – we had the parts, but we were missing necessary things like tools. So we went back to my dad, saying that we needed more supplies: a soldering iron, maybe a multimeter (checking current is great, but a multimeter is great when you’re working with ICs about which you have zero understanding – chicks dig ’em!)… we ended up buying a pretty decent beginner’s set, with all of our parts and tools adding up to about $50 USD.

We then set about putting this thing together. I think I mentioned that we weren’t exactly good at stuff like this – well, let me clarify a bit. We weren’t “not exactly good” – we had no experience, no patience, no desire to learn – we just wanted a cool speech synthesizer.

Some of the parts didn’t quite match up to the diagrams. One of the chips, for example, had sixteen pins where the part recommended in the article had eight. Instead of doing the logical thing – i.e., either getting the right part or at the very least matching the pin functions up – we just used the pin diagram from the eight-pin IC.

Looking back, I can say this was probably wrong.

After about two hours of screwing around, soldering with great abandon and slotting chips in – probably backwards, and other such follies – we had a wonderfully tech-looking glob of entirely unfunctional electronics. We tried. We really did. It just didn’t do anything – the C64 wouldn’t even start with the thing slotted in.

So we did what any sixteen-year-olds would have done, having pretty much wasted $50 of parents’ money – we dummied up. Our speech synth project was declared a “victory” and quickly submerged with a declaration that we’d gladly demo it at some future point in time – after we’d finished term papers, essays, homework of pretty much any stripe. (“Yes, dad, we have homework for physical education – we gotta calculate how much force jumping jacks put on your knees or … something.”)

However, our machinations didn’t quite work. One day, my dad and stepmother decided it was time to see our handiwork. Curt and I went into panic mode – and the speech synthesizer card magically transported itself to Curt’s house. We’d show it to them the next day… provided Curt remembered to bring it.

That only worked for so long. The moment of truth had arrived – but no, we were schemers and Dad knew a lot more about hardware than software!

So we loaded a software speech synthesizer, called “SAM” (oddly, still living for Windows!) We then propped the card we’d sort of built into place behind the C64 – not plugged in, of course, but visible – and plugged a set of wires into it so it looked like it was in use, and happily showed SAM to my parents.

“Hbblelo,” it said.

“See, it said ‘hello!'” we explained.

Satisfied, my parents left the room, and Curt and I never got involved in hardware ever again, except that karma forced me to endure it with my son.

And that’s the story of my speech synthesizer. Curt and I still laugh about it today, except nowhere near my father.

Like I said, Dad, none of this is true. Not even the parts you remember. I promise.

Author’s Note: A repost (of a repost, as the initial phrase points out).