Skip to main content

Engineering & Code

Engineering & Code explores the full stack of modern tech—from bits and transistors to cloud fleets and formal proofs. Here you’ll find clear, rigorous walk-throughs of software design, embedded hardware, security architecture, and the physics that underpins them, always paired with code, schematics, and reasoning you can put to work.

WordPress Automatic Updates

If you want to get WordPress to accept automatic updates and are running your own server, you want the flexibility to not go through these steps every time an update arrives. You also want good security. I had to do this recently on several sites and thought I would share my notes. read more

WordPress Theme Development

I’ve started to get much more serious about WordPress themes. For me that means making them from scratch instead of modifying someone else’s theme. Traditionally, I just purchased a template and modified it. Now I’m starting to work with good designers and working from scratch. read more

Radiant to WordPress Conversion

First I had to backup my database from Heroku — so I created the database in PostGresSQL. heroku pgbackups:capture curl -o latest.dump `heroku pgbackups:url` pg_restore --verbose --clean --no-acl --no-owner -h localhost -d booher_blog latest.dump Armed with that and the handy Induction I then needed to get my data into a format easily imported by WordPress. […] read more

Find corrupted images

So I deleted all my pictures, and I restored them which resulted in a bunch of corrupted images; thousands of corrupted images. To fix this, I wrote the following script in MATLAB using the image processing toolbox: // insert blog here Using matlab I tried to determine what a corrupted image is. First when using […] read more

Import Access Data into Excel (via VB and ADO)

I had a lot of data in MySql in a rails application, but I moved to Mongo on a new application and wanted to give the client a nice archive of excel files for each client. It has been a long time since I’ve worked with visual basic, but it came back quickly. I was […] read more

Radar parameter estimation

[mathjax] Here we tackle what a Radar needs to accurately measure a target’s position, size and motion. (This is nothing new, just a placeholder for some of my notes.) First of all, everything depends on $SNR$, and the parameter estimation happens in the main computer of a Radar. The theoretical rms error of a measurement […] read more

Your key with fingerprint … is not authorized to access heroku with Ubuntu

This error was pretty hard to solve. I emailed heroku support and they recommended: “https://github.com/ddollar/heroku-accounts”:https://github.com/ddollar/heroku-accounts bq. For git commands to work git needs to use the ssh key associated with that account. It’s probably choosing a key associated with a different account which is causing these permissions errors. You can use a ~/.ssh/config file to […] read more

Mongoid counter_cache with has_and_belongs_to_many

If I have two Mongoid models joined by a has_and_belongs_to_many relationship, Users and Groups. I need to quickly and efficiently sort by the most popular groups which really should be done with a counter_cache. However, counter_caches are implemented in rails by setting a callback to update the counter cache every time a child model is […] read more

How do you deploy an application.yml based config to heroku

In one of my applications, I have the following config files that are excluded from git: * config/mongoid.yml * config/application.yml * config/mailserver_setting.rb * config/omniauth_settings.rb For deploying to a regular server, I just add tasks to my capistrano deployment file to create sym-links to a shared directory. In this case I have to modify my application […] read more

Recovering Rails Data Using Production.log

So you didn’t set up automatic backups and need to recover your data? Don’t try digging it out of mysql, look no further than your rails production log. OK, try a bit with mysql, because the rails production log is a terrible way to recover your data. Only use as a last resort, but when […] read more