How To: Set up X-Accel-redirect for send_file with nginx, rails and passenger 5
Published 02 August 2017 under software

If you need provide the ability for users to download protected files when using rails you can store the files in a non-public directory and serve them within a rails action using send_file. In...

Read more →

How To: Convert an RGB888 image to RGB565 in C
Published 24 March 2017 under software

Here's some C code to convert RGB888 to RGB565. #include #include #include uint16_t rgb888torgb565(uint8_t *rgb888Pixel) { uint8_t red = rgb888Pixel[0]; uint8_t green = rgb888Pixel[1]; uint8_t...

Read more →

How To: Simple Firebase REST API server authentication using Ruby
Published 02 December 2016 under software, firebase, real-time database, rubyonrails

Firebase is a set oftools and infrastructure which includes a real-time database. We recently needed to get a Ruby on Rails application talking to a Firebase real-time database over their REST API....

Read more →

Let's Encrypt, nginx and Ruby on Rails
Published 16 November 2015 under software, website

Let's Encrypt are currently in closed beta but you can apply to get your domains whitelisted here. After receiving the confirmation email that the domains are whitelisted we can get started...

Read more →

How to get the path to the current script in bash
Published 03 September 2015 under bash, shell, path, software

It's sometimes useful to be able to get the absolute path to the current script in bash: SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Read more →