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

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). To get around this, I like to use the following script to automatically rebuild the firmware drivers against the new kernel, on kernel installation. Hint: Make sure to set the following script as executable (i.e. chmod o+x /etc/kernel/postinst.d/ Note: This makes use of Patjak’s reverse-engineered Broadcom 1570 drivers, which he has generously published on Git.

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)!