This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
certbot certonly --agree-tos --email <email> --webroot -w /var/lib/letsencrypt/ -d <domain> -d www.<domain> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# will need to supply passwords through stdin | |
pfx_to_crt_key() { | |
openssl pkcs12 -in $@ -nocerts -out extracted_encrypted.key | |
openssl pkcs12 -in $@ -clcerts -nokeys -out extracted.crt | |
openssl rsa -in extracted_encrypted.key -out extracted_decrypted.key | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Interface] | |
PrivateKey = <KEY-HERE> | |
Address = <IP-HERE>, <IP6-HERE> | |
DNS = <ETC> | |
# Customize to taste: | |
PostUp = route add -net 192.168.107.0 netmask 255.255.255.0 gw 192.168.1.1 metric 600 dev wlp5s0 | |
PreDown = route del -net 192.168.107.0/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://stackoverflow.com/questions/3800551/select-first-row-in-each-group-by-group | |
-- Can be a good way to find the oldest duplicate records et. al. | |
SELECT DISTINCT ON (customer) | |
id, customer, total | |
FROM purchases | |
ORDER BY customer, total DESC, id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git -C "$(rbenv root)"/plugins/ruby-build pull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h1>Create an event</h1> | |
<div class="form-container"> | |
// Vue form | |
<form @submit.prevent="onSubmit"> | |
<label>Select a category: </label> | |
<select v-model="event.category"> | |
<option | |
v-for="option in categories" | |
:value="option" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stub and Call the original | |
expect(object).to receive(:some_method).and_call_original | |
expect(object).to receive(:some_method).with(2,3),and_call_original | |
expect(object).to receive(:some_method).at_least(3).times.with(2,3),and_call_original | |
# Counts | |
expect(object).to receive(:some_method).once | |
expect(object).to receive(:some_method).twice | |
expect(object).to receive(:some_method).exactly(n).times | |
expect(object).to receive(:some_method).at_least(n).times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new Vue app | |
vue create APPNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su - postgres | |
psql -d template1 | |
alter user postgres with password 'new password'; | |
exit # psql | |
exit # postgres login shell | |
systemctl restart postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allow_any_instance_of(ActionController::TestRequest).to receive(:referrer) { 'whatever' } |