Late 2015 Macbook Pro 12,1 + Fedora: Getting the Webcam to work (and automating the process after Kernel upgrades)

Update (4/12/2018): The master branch of Patjak’s bcwc_pcie repository is not compatible with Linux kernel 4.19.2+. Thankfully, the mainline branch is compatible. The code below has been updated, but if you experience issues please try switching back to the master branch by changing the repository_branch variable at the top of the script. When upgrading the Kernel on a Fedora workstation running on a Late 2015 MacBook Pro 13”, the Webcam ceases to function (as the drivers are compiled against the current kernel).

Stubbing controller methods with Capybara & Rspec

Although it is often a sign of code that needs to be refactored and is an anti-pattern, it is sometimes necessary to stub controller methods within RSpec when running integration/feature specs. To avoid needing to use RSpec-mock’s allow_any_instance_of method, which I prefer to avoid using, I tend to create a new controller instance, stub the required method against the new controller instance, and then stub the controller class’ .new method to return the stubbed controller.

Useful Docker Commands

The following are some useful docker commands that I haven’t yet committed to memory. Delete all containers $(echo docker ps -aq) | while read -r line; do docker rm "${line}"; done Delete ALL docker-related data (images, containers, etc) WARNING: As with rm -rf on Linux, this action is not reversible. Take care when using this command. docker system prune -a -f

Debugging unresponsive Ruby Applications with gdb

Every once in a while, I encounter random freezing/hanging when developing Ruby applications and often find myself having to Google to find the correct gdb commands to use to debug these sorts of issues. To make life easier for myself (and hopefully for others out there), I’ve decided to document them here for future reference. I will (hopefully!) add to this page as I come across new strategies for debugging these sorts of issues.

Building affordable Self-service Kiosks with Raspberry Pi

Recently, I was tasked with designing and setting up a simple, cost-effective, touchscreen-based self-service Kiosk which users can intuitively use to navigate a predefined website (and nothing else). After spending some time researching the options (and realising just how expensive commercial touchscreens are!), I settled on the Dell P2418HT 24” touchscreen monitor and a Raspberry Pi. At a total cost of under $600 per Kiosk, it was a bargain when compared to the other options I’d come across ($1,200+ for the display alone)!