{
"CN": "My Custom CA",
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
use std::{ | |
fs::File, | |
io::{Read, Write}, | |
time::Instant, | |
}; | |
use tokio::task::{self, JoinHandle}; | |
async fn compute() { | |
let handles: Vec<JoinHandle<_>> = (0..1000) | |
.map(|_| { |
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
provider "google" { | |
project = var.google_project_id | |
region = var.region | |
zone = var.az | |
} | |
resource "google_compute_instance" "k3s_master_instance" { | |
name = "k3s-master" | |
machine_type = "n1-standard-1" | |
tags = ["k3s", "k3s-master", "http-server", "https-server"] |
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
bash$ pg_ctl -D /usr/local/var/postgres start ## init postgres | |
bash$ psql -d postgres ## connect to postgres | |
psql# create database logger; -- create a database named "logger" | |
psql# begin; -- start a transaction | |
psql# \i log.sql -- load database | |
psql# commit; -- commit the transaction | |
bash$ go run log.go ## run driver program |
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
package main | |
import ( | |
"fmt" | |
"net" | |
"sync" | |
"time" | |
_ "unsafe" | |
) |
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
extern crate custom_error; | |
extern crate memmem; | |
extern crate openssl; | |
extern crate openssl_sys; | |
extern crate hex; | |
extern crate foreign_types_shared; | |
extern crate tokio; | |
extern crate tokio_openssl; |
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
# start from golang image based on alpine-3.8 | |
FROM golang:1.10-alpine3.8 AS dev-build | |
# add our cgo dependencies | |
RUN apk add --no-cache ca-certificates cmake make g++ openssl-dev git curl pkgconfig | |
# clone latest seabolt 1.7 source code | |
RUN git clone -b 1.7 https://github.com/neo4j-drivers/seabolt.git /seabolt | |
# invoke cmake build and install artifacts - default location is /usr/local | |
WORKDIR /seabolt/build | |
# CMAKE_INSTALL_LIBDIR=lib is a hack where we override default lib64 to lib to workaround a defect | |
# in our generated pkg-config file |
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
#!/usr/bin/env -S gnuplot --persist -c | |
# Plot memory and CPU usage over time. Usage: | |
# usage-plot.gp <input file> [<output .png file>] | |
# where the input file has the columns `<unix time> <memory, with m/g suffix> <% cpu>` | |
# To create the input file, see https://gist.github.com/jakubholynet/931a3441982c833f5f8fcdcf54d05c91 | |
# Arguments: | |
infile=ARG1 | |
outfile=ARG2 | |
set term x11 |
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
apiVersion: batch/v2alpha1 | |
kind: CronJob | |
metadata: | |
name: aws-registry-credential-cron | |
spec: | |
schedule: "* */8 * * *" | |
successfulJobsHistoryLimit: 2 | |
failedJobsHistoryLimit: 2 | |
jobTemplate: | |
spec: |
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
FROM golang:1.9 | |
WORKDIR /go/src/github.com/purplebooth/example | |
COPY . . | |
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go | |
FROM scratch | |
COPY --from=0 /go/src/github.com/purplebooth/example/main /main | |
CMD ["/main"] |
NewerOlder