This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
const fs = require('fs'); | |
// our demo string is in 'default' utf8 with emoji character assuming you are using an editor that supports those. | |
// if not, you can test this gist by setting utf8string to the equivalent '->\ud83d\ude03\ud83e\uddd2\ud83c\udffc\u00fc\u010d\u0113<-' | |
// gist doesn't support all ZWJ sequences, so can't show this here but it works with those as well, e.g. '\ud83d\udc68\ud83c\udffc\u200d\ud83d\udcbb' | |
const utf8string = '->😃🧒🏼üčē<-'; | |
// this is what you'd usually do to write to a utf-8 encoded file | |
fs.writeFileSync('test-utf8.txt', utf8string); |
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: filebeat | |
namespace: kube-system | |
labels: | |
k8s-app: filebeat | |
spec: | |
template: | |
metadata: |
exports.handler = (event, context, callback) => { | |
const response = { | |
statusCode: 301, | |
headers: { | |
Location: 'https://google.com', | |
} | |
}; | |
return callback(null, response); | |
} |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
Hopefully helped another k8s newbie with the following. The question was, how do you update a single key in a secret in k8s? I don't know anything about secrets but I will probably want to know this in the future, so here we go.
First, to create a dummy secret:
apiVersion: v1
kind: Secret
metadata:
name: test-secret
data:
One Paragraph of project description goes here. Don't forget to link back to the tutorial.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Write-Host "Preparing to download and install Elasticsearch..." -ForegroundColor Cyan | |
$esVersion = "6.1.2" | |
$downloadUrl = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$($esVersion).zip" | |
$zipPath = "$($env:USERPROFILE)\elasticsearch-$esVersion.zip" | |
$extractRoot = "$env:SYSTEMDRIVE\Elasticsearch" | |
$esRoot = "$extractRoot\elasticsearch-$esVersion" | |
Write-Host "Downloading Elasticsearch..." | |
(New-Object Net.WebClient).DownloadFile($downloadUrl, $zipPath) | |
7z x $zipPath -y -o"$extractRoot" | Out-Null |
I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.
For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.
Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.
Not all random values are created equal - for security-related code, you need a specific kind of random value.
A summary of this article, if you don't want to read the entire thing:
Math.random()
. There are extremely few cases where Math.random()
is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.crypto.getRandomBytes
directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.uuid
, specifically the uuid.v4()
method. Avoid node-uuid
- it's not the same package, and doesn't produce reliably secure random values.random-number-csprng
.You should seriously consider reading the entire article, though - it's