Author: Josh

  • My new rails application won’t display the “Yay!” page!

    I was doing some recent environment testing with rails with the same application created on each of OSX, CentOS, and Ubuntu and was surprised when the application gave an error about no root route available, instead of the “Yay!” page: I, [2020-02-12T16:51:06.845723 #46720] INFO — : [8d1ab83a-b4e4-45bf-a734-a6494c4d15c2] Started GET “/” for 127.0.0.1 at 2020-02-12 16:51:06…

  • Enable EPEL Repository on Amazon Linux

    Amazon Linux provides an easy way to install / enable the EPEL yum repository from the command line. Use the amazon-linux-extras command to enable the epel feature, and then install the repository: amazon-linux-extras enable epel yum install epel-release To see which packages are available via amazon-linux-extras, just type the command without any arguments.

  • Rails new fails to create all of the content…

    I recently deployed a Rails app on a CentOS 8 container and was surprised to see that the ‘rails new’ command did not create the entire application directory structure that I would expect, ie: [root@607ebc931c48 app]# rails _5.2.3_ new centos_app_2 create create README.md create Rakefile create .ruby-version create config.ru create .gitignore create Gemfile run git…

  • Unique UserAgent

    I saw this line in a server log this morning and thought it was humorous – if you’re going to spoof the UserAgent, why not do it right? 109.228.111.66 – $virtual_host.com – [06/Feb/2020:07:21:11 -0800] “GET /.env HTTP/1.1” 301 238 “-” “Mozlila/5.0 (Linux; Android 7.0; SM-G892A Bulid/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3112.107 Moblie Safari/537.36″…

  • MacBook Pro – Swollen Battery – Heat Management

    I’ve been using the MacBook Pro platform for daily business operations for years now. One issue I’ve suspected is that if you leave the laptop display closed for extended periods of time, the laptop can heat up enough to cause the battery to swell. This happened on my most previous MacBook and I’ve just noticed…

  • Why is rails 5.2 joining to the same table twice?

    I was working on a Rails project for a client recently where I was trying to figure out why a model search operation was joining to the same table twice, resulting in a huge performance hit. The answer turned out to be an incomplete understanding of the ‘has_many’ ‘:through’ relationship. Given a model with the…

  • Serving static content with Nginx via Docker

    I was playing around with the nginx docker container recently and wanted to serve the content from the local directory that I was in (pwd). This is how I ended up doing it: docker run –name nginx -d –rm -p 8080:80 -v $(pwd):/usr/share/nginx/html nginx:1.7 That will launch an nginx docker container and serve whatever is…

  • Ubiquiti Cloud Key Upgrade – Can’t Login to Web UI

    TL;DR: A recent update to the UCK (Ubiquiti Cloud Key) controller software to add controller version caching caused the device to not start properly. Updating the unifi package via apt and rebooting solved the issue. SSH using the root account and your user password. apt update apt upgrade -y shutdown -r now ————— I recently…

  • Rails timestamp search using datetime_field_tag

    I recently worked on an issue when creating a Rails form to search and display objects by timestamp and spent far too much time troubleshooting an issue with the datetime_field_tag form helper. The issue began with the following two lines in my view: Evidently, you cannot place more than one space between the name assigned…

  • Windows Permissions – Unable to enumerate container…access denied

    One of the greatest reasons I prefer not working with Microsoft Windows is that the intent behind managing Windows seems to be to make it as difficult as possible for an administrator to do their job. In theory, I suppose the intent is to make it difficult for a determined hacker to break the defenses…