Skip to content

Instantly share code, notes, and snippets.

View ewingson's full-sized avatar
💭
You gotta hang on the trip you' re on

Matthias Evering ewingson

💭
You gotta hang on the trip you' re on
View GitHub Profile
@ewingson
ewingson / letsdoit.txt
Created December 7, 2018 11:35
apache2_config_ssl_letsencrypt_cert.pem_privkey.pem_chain.pem_fullchain.pem_?
LoadModule ssl_module libexec/apache2/mod_ssl.so
Listen 443
<VirtualHost *:443>
ServerName example.com
SSLEngine on
SSLCertificateFile "/etc/letsencrypt/live/example.com/cert.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/example.com/privkey.pem"
SSLCertificateChainFile "/etc/letsencrypt/live/example.com/chain.pem"
</VirtualHost>
@ewingson
ewingson / hta.txt
Created December 7, 2018 17:37
htaccess_rewrite_condition_force_nonwww_force_https_!
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.blahblah.com/$1 [R,L]
RewriteCond %{HTTP_HOST} ^www\.blahblah\.com [NC]
RewriteRule ^(.*)$ https://blahblah.com/$1 [L,R=301]
@ewingson
ewingson / hta2.txt
Created December 8, 2018 12:24
apache2_directory_rewrite_another_set_of_rules_that_seem_to_make_sense
# match any URL with www and rewrite it to https without the www
RewriteCond %{HTTP_HOST} ^(www\.)(.*) [NC]
RewriteRule (.*) https://%2%{REQUEST_URI} [R=301,L]
# match non https and redirect to https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
@ewingson
ewingson / apache2_conf_rewrite
Last active December 16, 2018 15:23
apache2.conf_rewrite_engine_force_nonwww_https_piece_of_code_in_production
Rewrite Engine On
#RewriteCond %{SERVER_PORT} !^8443$ [OR]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
#removed port from rule
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
import { Request, Response } from "@opennetwork/http-representation";
import { getType, notAccepted } from "./combine";
import { Fetcher } from "./fetcher";
import { readdir } from "./readdir";
import { combineForResponse } from "./combine";
export type SimpleGlobOptions = {
fetch: Fetcher
};
@ewingson
ewingson / node_project_anatomy
Created May 17, 2019 14:53
node_project_anatomy
lib/ is intended for code that can run as-is
src/ is intended for code that needs to be manipulated before it can be used
build/ is for any scripts or tooling needed to build your project
dist/ is for compiled modules that can be used with other systems.
bin/ is for any executable scripts, or compiled binaries used with, or built from your module.
test/ is for all of your project/module's test scripts
unit/ is a sub-directory for unit tests
integration/ is a sub-directory for integration tests
env/ is for any environment that's needed for testing
@ewingson
ewingson / gist:88dcdaba2db423fc9e750eb197df332e
Created May 24, 2019 07:04
copy_meta_put_recursive_file_jef
const auth = require('solid-auth-cli')
const file = 'https://jeffz.solid.community/public/likes.ttl.meta'
async function run(){
await auth.login()
await auth.fetch(file,{
method:"PUT",
body:"<> a <#test>.",
contentType:"text/turtle"
}).catch(e=>{console.log("Error : "+e)})
const quad = require('rdf-quad');
quad('http://example.org/subject', 'http://example.org/predicate', '?variable');
quad('http://example.org/subject', 'http://example.org/predicate', '"myString"', 'http://example.org/someGraph');
/usr/local/bin$
./certbot-auto certonly \
--manual \
--preferred-challenges=dns \
(--email mad@mail.com) \
--server https://acme-v02.api.letsencrypt.org/directory \
--agree-tos \
-d *.solidweb.org \
-d solidweb.org
connect root-server to net (depends on provider) (you will need ssh)<br />
* order vserver at provider of your choice<br />
assign FQDN to the machine<br />
* setup DNS properly<br />
get and deploy https certificate<br />
* ssh into the machine<br />
* deploy two certificates with letsencrypt/certbot (domain-cert and wildcard-cert)<br />
(you will need to edit a DNS-text-record depending on the challenge)