How to Setup CI/CD of Jigsaw Site to Digital Ocean Droplet Using Bitbucket Pipelines
I created a new personal resume site and decided I wanted to build a static site since it wouldn't be frequently updated. I evaluated Nuxt, Gatsby, and a few others but settled on Jigsaw, a static site generator based on Laravel. I had never used it before and figured this would be a good learning experience while building something I needed. I was pleasantly surprised by how easy it is to use and setup, so kudos to the Tighten team for putting together such an elegant solution.
I wanted to get a CI/CD pipeline configured to handle the site's deployment but couldn't find any working tutorials, so I'm sharing my solution in case it helps others. I'm using Bitbucket for this since it's a personal private repo, so I'm using Bitbucket Pipelines.
How to Setup a CI/CD Pipeline for Storybook.js using Gitlab
I just spent a few hours setting up a Gitlab pipeline to deploy a Storybook.js site. Of course the end result ended up being much simpler than I made it out to be. Like everything else on my blog, I'm sharing in case anyone else can use the information to save time.
Just put this in your gitlab-ci.yml and it'll take care of caching the node modules and building your static version of Storybook to deploy.
Why I’m switching from Namecheap to Cloudflare
Years ago, when the internet was young, I purchased my first domain from InterNIC for about $70 a year. When the alternatives finally popped up, I switched my domain to Godaddy. As prices dropped, I ended up buying more domains through them for ideas and projects I developed. Eventually, I got tired of Godaddy's shenanigans with pricing (increasing prices and having privacy as an add-on) and upselling everything, and after reviewing many technical forums, ended up switched everything to Namecheap where I even signed up for their shared hosting.
Things started well, but after a short while, the hosting ended up not being any better than Godaddy as all my sites became ridiculously slow as they oversold capacity. I finally made the jump to DigitalOcean, and the same site without any changes or optimizations jumped in performance about 60% based on the metrics reports I was running. No joke, people were pinging me asking what I changed to make my site run so much faster because they wanted to do the same.
I was annoyed that Namecheap refused to refund a partial credit on the hosting even though I wasn't using it anymore despite their bait and switch caused the performance issues by overselling capacity. In the end, I didn't fight, because it was cheap, I was beyond the credit card chargeback period, and I still had domains with them and didn't like any of the other registrars out there enough (nor were the prices better) to make the switch.
On the domain side, their control panel was pretty confusing at first. Godaddy's was more straight forward for managing DNS and records, so I had to constantly figure out what the Namecheap configuration equivalents were because it wasn't straight forward. They updated their control panel, and things got easier, but it still wasn't intuitive. I think a lot of my confusion came from them trying to default to their parking pages or their hosting.
I'd run into issues, and their support would always be good enough to help fix them. I then ran into an issue with setting up a txt record. The fix required them to manually enter the entry on their side due to a bug in their control panel that they still haven't fixed to date. The bug was serious enough that if I made any changes to any of the domain settings (like adding another A/CNAME/MX record), it would undo their change and I'd have to file another ticket for them to complete the change.
All changes would take hours to propagate. Many of the services that validate DNS changes would not see them for hours or even a day. It hadn't been a great experience, and now I've wanted to find a new registrar to replace Namecheap.
In 2018, CloudFlare announced their registrar service. I've patiently watched to see how reliable it is and finally ended up testing it last month with a domain for an existing project that's in development. To say I was blown away was an understatement. The experience hasn't been perfect, but the things that really matter are well executed.
I found Namecheap to be a bit deceptive in the transfer process. All other registrars I've used let you approve transfers instantly via a link in the notification email. Namecheap sent an email saying they received a request to transfer the domain and this is the text about approving/canceling:
One-line snippet to update linux and apps on Ubuntu using apt-get
I find myself using this command on Digitalocean droplets fairly often and am sharing in case anyone else finds it useful. Use this one line to install all updates, security fixes, and system upgrades.
How to stop CouchDB on Mac OS
I have been working on a proof of concept using CouchDB. After getting the proof of concept working, I spun up a digital ocean droplet and proceeded to setup CouchDB on the server. I went to enable the SSH tunnel so I could access the CouchDB Futon instance and promptly ran into an error because my local instance of CouchDB was using the same port, 5984. I had a lot of trouble finding out an easy way to stop CouchDB because the documentation in the Wiki wasn't accurate:
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 – error
I recently got handed a new Ubuntu droplet at work to setup and work on. I was going through the typical configuration to lock down the server and go to installing Apache when I suddenly ran into the error
How to Copy and Paste into the Digital Ocean VNC Console
I recently signed up for Digital Ocean to test droplets for my development and linux management testing. I was securing the server and setup fail2ban, disabled the root login, and created a user account but forgot to change the user name from root to the user name I selected in my SSH client profile. I ended up locking myself out of the server and had to resort to logging into the admin panel on Digital Ocean's website and use their browser embedded VNC client to restore my access. I quickly discovered that one of the downsides of using this panel is that you can't copy and paste commands. Luckily there's a workaround and you can use the browser console to do sendkeys through Javascript.
Bring up the console in the browser developer tools. Here's a cheat sheet for keyboard shortcuts: