DIY Request Tampering Prevention in APIs

In API development, end-to-end encryption with TLS is a very important, fundamental protection mechanism used to prevent the request/response from being tampered with (and even inspected), in-transit. Sometimes, however, you might also want to add API-level validation checks to ensure that the request has not been tampered with. This is useful in scenarios where transport-layer security is not used for whatever reason (and the request payload does not contain sensitive content), but in-transit manipulation of the request payload could result in unwanted changes - such as the deletion of a different record than what was intended.

Dell XPS 13 7390 - WiFi drivers on Fedora

My WiFi drivers fail from time-to-time, usually after a Kernel upgrade. For future reference, this is the series of commands I run to fix them. Source: git clone chromiumos-linux-firmware cd chromiumos-linux-firmware sudo cp iwlwifi-* /lib/firmware/ cd /lib/firmware sudo ln -s iwlwifi-Qu-c0-hr-b0-50.ucode iwlwifi-Qu-b0-hr-b0-50.ucode

Google Calendar API - Fetching Group calendars

I’m currently working on writing a sync application to migrate Group calendars from Google G Suite to MS O365, and after reading up on a lot of APIs etc, I thought I’d post a short summary of my findings below. Unfortunately, Google’s Calendar API isn’t as flexible as I’d like it to be, so this is a much more complex process than it arguably should be. The following are some caveats/“gotchas” that I’ve come across so far.

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 Fix DNS issues on some Ubuntu 18.

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