- 🎨 when improving the format/structure of the code
- 🚀 when improving performance
- ✏️ when writing docs
- 💡 new idea
- 🚧 work in progress
- ➕ when adding feature
- ➖ when removing feature
- 🔈 when adding logging
- 🔇 when reducing logging
- 🐛 when fixing a bug
#!/usr/bin/env ruby | |
require 'tempfile' | |
require 'optparse' | |
def parse_version(text) | |
if (text.match(/^\s*<version>\s*(.*?)\s*<\/version>\s*$/)) | |
$1 | |
else | |
nil |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
function pad (text, padded_length, pad_string, pad_direction) { | |
pad_string = pad_string || " "; | |
text = text + ""; | |
if (text.length >= padded_length) { | |
return text; | |
} | |
var pad_content = new Array(padded_length - text.length + 1).join(pad_string); | |
if (!pad_direction || pad_direction === "left") { | |
return pad_content + text; | |
} else { |
##Using Let's Encrypt certificates with AWS API Gateway
Before starting off with API Gateway set up it's worth mentioning that certificate configuration for this particular service is so far isn't well integrated, therefore different from other AWS services. Despite it using CloudFrount to serve on custom domains it won't let you customize distributions it creates, however all the limitations of CloudFront naturally apply to API Gateway. The most important in this case is the size of the key, which is limited by 2048 bit. Many tutorials provide ready to use terminal commands that have the key size preset at 4096 bit for the sake of better security. This won't work with API Gateway and you'll get an error message about certificate's validity or incorrect chain which won't suggest you the real cause of the issue. Another consideration is that to add a custom domain to API Gateway you have to have a certif
#!/usr/bin/env bash | |
# castanet.sh: Script to connect a chromecast to a WiFi network. | |
# | |
# Allows you to put your Chromecast on WiFi and do Chromecast initial setup | |
# without using the Google Home app at all, just using a normal Linux computer. | |
# | |
# You do need your Chromecast to be on Ethernet, or (untested) to join its setup WiFi | |
# network with your PC, and you also need to find out its IP yourself with e.g. | |
# Wireshark. |