Programming

Msqur Update

Well, the holidays are long over and I haven’t updated msqur.com in a while. I’m adding some configuration management to it, so nothing visible will happen for a while. What’s planned, however, is .ini file parsing so that .msq files can be parsed according to the INI file version they use. That is, I will parse the INI file for the schema to a .msq file instead of hardcoding it. This way showing a .

msqur.com – MSQ file sharing site

Well, I’ve only been working on it a little so far, but I suppose it’s good enough to post about at this point. The site is msqur.com, and it’s for Megasquirt ECU users to share their tunes (from the TunerStudio MS software). You can upload (multiple) .msq files, assign some engine information to them at upload, and share them with other people for troubleshooting or tuning help. The goal is to make something easier than attaching a file to a forum post that others have to download and fire up the full tuning software suite to just view it.

Raspberry Pi – Cross-compiling

Now that you have the hardware built and tested (although that’s not necessary), you can either use the code I’ve written-which is specific to the hardware and environment I have, or compile your own version. If you want to compile your own there are two options:

  1. Compile on the Pi itself
  2. Compile on an ARM virtual machine
  3. Cross-compile on a faster machine

The trade off? Compiling on the Pi is slow (very slow). The virtual machine is a marked improvement for compiling speed, but is complicated to setup. Cross-compiling is about the same difficulty as setting up a virtual machine but a bit faster and less “bulky”. So it depends. The virtual machine is nice if you have a lot of libraries you want to use, since you’ll have to compile all of them to be available for linking. If any of them have poor autoconfig support, it might be a pain to fix if you weren’t already on the target machine. But, since I just needed one or two popular libraries, I decided to setup cross-compiling from my host (x86_64) machine.

The last time I setup cross-compiling it was on Gentoo, and it wasn’t pleasant. However, after a little bit of research it looks like the crosstool-ng project is pretty popular and useful. I only had to patch one tiny thing.

Here’s the overall process:

  1. Install crosstool-ng
  2. Configure a cross toolchain with it
  3. Try and build the toolchain
  4. Use the toolchain to build your Pi code

Carduino 2.0 – Intel Galileo Setup

Out of the box the Galileo is setup to run sketches uploaded from volatile memory, which is really lame. I didn’t spend much time with it using the stock SPI kernel. So, an SD card is pretty much required to do any serious development with this board. This is not a bad thing (although you aren’t running in real-time anymore), since having a full OS to use has lots of advantages. Plus, this way I can automate the build process in a way I’m more familiar with.

Carduino 2.0

Over a year ago I got an Arduino Uno and a CAN-BUS Shield to try and make some kind of datalogger for my car. I was also interested in using the OpenXC library with it (which might need a port if there isn’t one already, since it uses the Digilent chipKIT Max32 development board). While OpenXC allows interfacing with Android stuff for phones, I’m more interested in a self-contained datalogging type deal.

Updating WordPress on nearlyfreespeech.net hosts

Update Dec. 13, 2014:

These scripts are out of date. NFS has the WP-CLI installed allowing for much, much easier upgrades, backups, etc. See the repository for information.

Originally posted on Sept. 10th, 2014:

If you use NearlyFreeSpeech.net as your web host, you may have found it difficult to automate WordPress updates. I’ve made a script that does this for you. It also calls my backup and permissions fixing scripts, which I include here as well.

Beware of some notes and assumptions though:

  • Assumes WordPress is installed in /home/public/ (not a subdir of it)
  • Scripts are assumed to be in /home/private/
  • Does not check or recover from errors

Custom Speed app update

I update Custom Speed to 1.1. Changes include: An actual theme (consistent colors) More units New icon 2.0 will include an actual settings page that will allow the units to be selected from an easier control, a setting for keeping the display on, and other minor UI improvements. There’s no ETA currently for 2.0.

Exporting Drupal Pages/Posts to WordPress

I’ve decided to consolidate some of my web presence. My car’s website will be merged into this one. Going from WordPress to Drupal is easy, but the other way is not. I found a couple links for SQL scripts to import lots of posts automatically, but these were and are easily outdated by Drupal and to a lesser extent WordPress. It was easier just to create my own SQL JOIN statement and export the resulting list.

Python script to write a word using the word

That’s the best title I can come up with. The idea is to do this:

THISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHIS
    THISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHIS
    THIS            THIS    THIS    THIS            THIS            THIS
    THIS            THIS    THIS    THIS            THIS            THIS
    THISTHIS    THISTHIS    THIS    THISTHIS    THISTHIS    THISTHISTHIS
    THISTHIS    THISTHIS    THIS    THISTHIS    THISTHIS    THISTHISTHIS
    THISTHIS    THISTHIS            THISTHIS    THISTHIS            THIS
    THISTHIS    THISTHIS            THISTHIS    THISTHIS            THIS
    THISTHIS    THISTHIS    THIS    THISTHIS    THISTHIS            THIS
    THISTHIS    THISTHIS    THIS    THISTHIS    THISTHISTHISTHIS    THIS
    THISTHIS    THISTHIS    THIS    THISTHIS    THISTHISTHISTHIS    THIS
    THISTHIS    THISTHIS    THIS    THIS            THIS            THIS
    THISTHIS    THISTHIS    THIS    THIS            THIS            THIS
    THISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHIS
    THISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHISTHIS

With any number of alphanumeric characters. The idea comes from a reddit user posting something similar, and then my mind wandered.