Posts
Amazon Makes Computer Components
Amazon is now in the computer components business. It now sells a CPU cooling heatsink and fan combo with RGB lighting for $27 under the Amazon Basics brand name. It’s definitely not the cheapest in the category, but it’s a more recognizable brand name than the alternatives you can buy within the economy-budget category. It’s not available in all regions - for example, Amazon.ae does not list the Amazon Basics CPU cooler (yet).
Posts
Oopsy Moments Involving Money
An Oopsy moment that cost us money is not too uncommon. It could be in the form of falling prey to a scam, or clicking the wrong option and having to pay a change fee or a processing fee, forgetting to cancel a subscription and getting charged for it, or being pointed at a violation of policies and being denied a full cancellation.
When you buy a new Apple device, you get one or three months of free Apple TV use but you have to provide a credit card.
Posts
Skunkworks
In the movies, there’s a common storyline in which there’s a cop who refuses to play by the rules and so they make him a part of a secret elite team that operates outside the rules and wipes out evil gangsters, drug dealers, and criminal syndicates. Skunkworks is the engineering equivalent. Take a bunch of engineers who are exceptionally good at what they do but totally hate being put into the restraints of process, structure and management.
Posts
Binary Request and Postman-Generated curl Command
After using PostMan to test a web service, I decided to share a way to connect to the service with my team mate so I used PostMan to generate the curl command. It seems like a simple enough use case and that’s exactly what most people would do with PostMan, except that I had a web service to which I was posting a binary request body and I kept getting an error when executing the curl statement.
Posts
Ruby Queue
I wanted to build a simple queue that could accept HTTP requests to enqueue and dequeue, to keep things simple enough to post via a curl command. With Ruby being my go-to language for hobby projects, I wrote this:
require 'sinatra' $queue = [] get '/' do if $queue.length == 0 status 404 content_type('text/plain') return 'EMPTY' end content_type('application/json') $queue.shift end post '/' do if request.content_type != 'application/json' status 500 content_type('text/plain') return 'ERROR' end $queue.
Posts
Sinatra Doesnt Handle HEAD Requests
I was building a simple API around GET, POST, and HEAD requests and it turns out Sinatra doesn’t handle HEAD requests for the server root ("/"). Don’t believe me? Try this.
get '/' do puts 'This is a GET' 'GET is OK' end post '/' do puts 'This is a POST' 'POST is OK' end head '/' do puts 'This is a HEAD (root)' response['X-Message'] = 'HEAD is OK' end head '/nonroot' do puts 'This is a HEAD (non-root)' response['X-Message'] = 'HEAD is OK' end Now, open up Postman and send a request to each of the three.
Posts
Git Short Commit ID
In a git repository, every commit is associated with an SHA1 hash of 160 bits, or 40 characters when represented in hexadecimal. This can be abbreviated to make it easier to reference.
To get a list of hashes for changes:
$ git rev-list HEAD
To get the full hash of the latest commit:
$ git rev-parse HEAD
a657cd1e291dc69b5c491c5c1c6dbfe600ffaafd
To get the short hash (default length 7):
$ git rev-parse --short HEAD
Posts
Install Ruby With rvm
Continuing with the install-Ruby-with-X theme, I decided to document the steps needed to install Ruby with rvm. This is what I have been using in my VMs:
curl -sSL https://rvm.io/mpapis.asc | gpg --import - curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - \curl -sSL https://get.rvm.io | bash -s stable rvm install 3.1.2 rvm use 3.1.2 Also see: Install Ruby with rbenv | rvm | asdf
Posts
Install Ruby With asdf
Continuing with the install-Ruby-with-X theme, I decided to document the steps needed to install Ruby with asdf:
sudo apt install -y autoconf bison patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev # Taking the list of dependencies that rbenv's ruby plugin uses git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.2 # "Installing" asdf # Add these to .bashrc . "$HOME/.asdf/asdf.sh" . "$HOME/.asdf/completions/asdf.bash" # Install NodeJS and Ruby asdf plugin add nodejs https://github.
Posts
How I Got Locked Out of Github (Rant)
Security means a lot of different things to different people. If you are a home owner, you do not want to have somebody entering your house without authorization and you do not want somebody picking up a package from your porsch. If you are a store owner, you do not want to have someone entering the store, picking up goods, and making off with it without paying for it. For information, we have a general consensus that security implies confidentiality, integrity, and availability - the CIA triad.