Michael Cordell's Blog

Git Notes

Switch to remote branch git fetch git checkout -b **local** **remote/branch** Merge branch back into master git checkout master git merge **branchname** Delete remote branch git push origin :**branchname**

Netatalk fix for Ubuntu 12.04

Ubuntu 12.04 breaks netatalk and when you try to login in to the apple share you will get errors such as this in /var/log/syslog: Jun 14 13:03:13 GlaDoS afpd[4395]: =============================================================== Jun 14 13:03:13 GlaDoS afpd[4395]: INTERNAL ERROR: Signal 11 in pid 4395 (2.2.1) Jun 14 …

Stopping mdadm assemble on ubuntu boot

Soft raid setup with mdadm I have a Raid-6 running and it currently has 6 drives. My Mobo has 6 sata ports, one of which is used up for the boot drive (not involved in the array). The sixth array drive is on a PCI sata/raid card. The server is headless, which is important because I do not want degraded array events to …

Rails notes

Create a controller without tests. rails generate controller {controller name} {views/methods} --no-test-framework Create integration test rails generate integration_test {test_name} Roll back a migration rake db:rollback Rspec test for Mass Assign Vulnerbility (or attribute not being accessible): describe …

Rails app start guide

Set up a rails app with heroku, zerigo DNS, and bitbucket in one pomodoro: rails new {app_name} --skip-test-unit cd {app_name} git init git add . git commit -m "generated skeleton" vim Gemfile Gemfile changes < gem 'sqlite3' --- > group :development do 9a10,11 > gem 'sqlite3' > end …

Large HTML tables with fixed first column and header

Recently I wanted to create a large text heavy table (cells had large blocks of text in them) in HTML. Furthermore, I wanted an Excel-like “split” on the first column and row. I realized that this could probably not be solved in pure CSS and would likely require a Javascript solution. After much hunting I …

Branch & Bound problem in Ruby

Problem definition I want to find the set of widgets out of a list of widgets, that best fits a set of requirements. This is a problem of my own design that model’s a larger problem I am having for a project. Specifics: Widget has numeric qualities that correspond to the requirement categories There is a single …

Notes on creating a new ruby project

Quickest way to set up a new project. Use snake_case on project name. bundle gem my_gem_name cd ./my_gem_name/ git commit -m "empty project" rspec --init

Microsoft Access Database to SQL file

I had an existing Microsoft Access database that was quite large that I needed to migrate to a more managable MySQL database. I wanted to export the database to a .sql file for portability sake. Strangely, this feature is absent from Access the program. Here is the easiest solution. Download the program DBWScript. It …

Setting up Jekyl in a sub directory

Jekyll is a blog-aware static site generator. The operative words in that sentence being static site, there is no php, no database, running on this blog. There are few advantages to this setup over the traditional alternatives such as wordpress: Speed of service: no code execution means the limiting factor is how fast …

Pages