For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
// This is the primary configuration file for the BIND DNS server named. | |
// | |
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the | |
// structure of BIND configuration files in Debian, *BEFORE* you customize | |
// this configuration file. | |
// | |
// If you are just adding zones, please do that in /etc/bind/named.conf.local | |
include "/etc/bind/named.conf.options"; | |
include "/etc/bind/named.conf.local"; |
// This event emitter emits events, but reserves the right to publish events to | |
// for its creator. It uses a WeakMap for true encapsulation. | |
const eesToEventMaps = new WeakMap(); | |
export default class EventEmitter { | |
constructor(publisher) { | |
const eventMap = Object.create(null); | |
eesToEventMaps.set(this, eventMap); |
package main | |
import ( | |
"reflect" | |
"strings" | |
) | |
func makeChannel(t reflect.Type, chanDir reflect.ChanDir, buffer int) reflect.Value { | |
ctype := reflect.ChanOf(chanDir, t) | |
return reflect.MakeChan(ctype, buffer) |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
import ( | |
"archive/zip" | |
"io" | |
"os" | |
"path/filepath" | |
"strings" | |
) | |
func zipit(source, target string) error { | |
zipfile, err := os.Create(target) |
import signal | |
import functools | |
async def looping_task(loop, task_num): | |
try: | |
while True: | |
print('{0}:in looping_task'.format(task_num)) | |
await asyncio.sleep(5.0, loop=loop) | |
except asyncio.CancelledError: | |
return "{0}: I was cancelled!".format(task_num) |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: fluentd-config | |
namespace: fluentd | |
labels: | |
app: fluentd | |
data: | |
fluentd.conf: | | |
@include prometheus.conf |
#!/bin/bash | |
set -e | |
if [[ -z ${K8S_JVM_POD} ]]; then | |
echo "K8S_JVM_POD not defined" | |
exit 1 | |
fi | |
EXEC="kubectl exec ${K8S_JVM_POD}" | |
CP="kubectl cp ${K8S_JVM_POD}" |
# FOR ETHER -> | |
web3.eth.getTransactionCount(this.address).then(txCount => { | |
const txData = { | |
nonce: web3.utils.toHex(txCount), | |
gasLimit: web3.utils.toHex(100000), | |
gasPrice: web3.utils.toHex( YOUR_GAS_PRICE), // 10-15 gwei should be ok | |
to: this.toAddress, | |
from: this.address, |