For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2
gem errors on MacOS Mojave.
Make sure openssl
is installed on Mac via Homebrew.
For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2
gem errors on MacOS Mojave.
Make sure openssl
is installed on Mac via Homebrew.
import os | |
import zipfile | |
import time | |
class FileStat: | |
def __init__(self, filename, mod_time): | |
self.name = filename | |
self.mod_time = mod_time |
source: https://savedlog.com/uncategorized/letsencrypt-ssl-certificate-namecheap-hosting/
The “Positive SSL” certificate I bought along with my domain is invalid with any of my subdomains and cannot be used with wildcards. One annoying thing is that namecheap doesn’t offer auto installation of free let’s encrypt certificates, even though, they are saying “Namecheap is dedicated to data security and privacy for all internet users. We believe the movement to encrypt nearly all web traffic is a positive direction. As more sites embrace HTTPS and use of security products, providers of free SSL are beginning to come online.”
Let me show you what it needs to be done in order to “encrypt nearly all web traffic”.
First, not required but it’s helpful to enable ssh access, it is not enabled by default on the base hosting plans, just go an start a live chat and request ssh access.
#!/bin/bash | |
# Vadim Zaliva [email protected] | |
# based on https://gist.github.com/hadess/6847281 | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
# Copied from http://blog.salsify.com/engineering/tearing-capybara-ajax-tests | |
# https://gist.github.com/jturkel/9317269/raw/ff7838684370fd8a468ffe1e5ce1f3e46ba39951/rack_request_blocker.rb | |
require 'atomic' | |
# Rack middleware that keeps track of the number of active requests and can block new requests. | |
class RackRequestBlocker | |
@@num_active_requests = Atomic.new(0) | |
@@block_requests = Atomic.new(false) |
public class Backtrack { | |
public static List<List<Object>> backtrack(int[] A) { | |
// Set up a list of list to hold all possible solutions | |
List<List<Object>> result = new LinkedList<List<Object>>(); | |
if (A == null || A.length == 0) { | |
return result; | |
} | |
// As we need to recursively generate every solution, | |
// a variable is needed to store single solution. |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
var http = require('http'); | |
var querystring = require('querystring'); | |
var MailParser = require("mailparser").MailParser; // https://github.com/andris9/mailparser | |
var server = http.createServer(); | |
server.addListener('request', function(req, res) { | |
var chunks = []; | |
req.on('data', chunks.push.bind(chunks)); | |
req.on('end', function() { | |
var mailparser = new MailParser(); |