Note: This post is a summary of information paraphrased from an excellent blog post by Christian Sepulveda.
Create the app and download the necessary dependencies.
| #! /usr/bin/env node | |
| // I am ./bin/buildSitemap.js | |
| const path = require('path') | |
| const glob = require('glob') | |
| const fs = require('fs') | |
| const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com' | |
| const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js') | |
| const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml') |
Create the app and download the necessary dependencies.
| ## You may choose to remove --recursive if is required only for the bucket or folder and not for objects within. | |
| s3cmd setacl --acl-private --recursive s3://mybucket-name | |
| s3cmd setacl --acl-private --recursive s3://mybucket-name/folder-name | |
| s3cmd setacl --acl-private --recursive s3://mybucket-name/folder-name/object-name | |
| s3cmd setacl --acl-public --recursive s3://mybucket-name | |
| s3cmd setacl --acl-public --recursive s3://mybucket-name/folder-name | |
| s3cmd setacl --acl-public --recursive s3://mybucket-name/folder-name/object-name |
| function slugify(string) { | |
| const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;' | |
| const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------' | |
| const p = new RegExp(a.split('').join('|'), 'g') | |
| return string.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters | |
| .replace(/&/g, '-and-') // Replace & with 'and' | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word characters |
| /** | |
| * Callbag loves TypeScript | |
| * | |
| * Copy-paste this into http://www.typescriptlang.org/play/index.html | |
| */ | |
| // A Callbag dynamically receives input of type I | |
| // and dynamically delivers output of type O | |
| type Callbag<I, O> = { | |
| (t: 0, d: Callbag<O, I>): void; |
| {... | |
| "scripts": { | |
| "postinstall": "node patch.js", | |
| ... | |
| } | |
| } |
| kubectl exec --namespace=manadr-dev -it $(kubectl get pod -l "service=mysql" --namespace=manadr-dev -o jsonpath='{.items[0].metadata.name}') -- bash |
| # warning: do not use the certificates produced by this tool in production. This is for testing purposes only | |
| # certificate authority | |
| openssl genrsa -out RootCA.key 4096 | |
| openssl req -new -x509 -days 1826 -extensions v3_ca -key RootCA.key -out RootCA.crt | |
| openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in RootCA.key -out RootCA.key.pkcs8 | |
| # intermediate CA | |
| openssl genrsa -out IntermediateCA.key 4096 |