Skip to content

Instantly share code, notes, and snippets.

View hunterlong's full-sized avatar

Hunter Long hunterlong

View GitHub Profile
graph LR
A[Internet] -- A-series ==> Rack47
Rack47 -- ToNode ==> g0a0a0a
g0a0a0a --FromNode ==> Rack47
Rack47 -- ToNode ==> g0b0b0b
g0b0b0b --> P[(pod)]
g0b0b0b --> P[(pod2)]
langs := []string{"english", "russian", "french", "german", "spanish", "japanese", "chinese", "italian", "korean"}
for _, v := range langs {
if err := CreateJS(v, jsDirectory); err != nil {
panic(err)
}
}
// CreateJS accepts the JS file name to be created, and a slice of translations to
// create a dedicated JS file for each language.
func CreateJS(name, directory string) error {
package main
import (
"encoding/csv"
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/translate"
"io"
// TranslateCSV accepts a CSV file for translations, the CSV format should be:
// key,english_value
// hey,Hello
// bye,Goodbye
// the CSV KEY will be used as the JS variable name
func TranslateCSV(filename string) error {
file, _ := os.Open(filename)
defer file.Close()
c := csv.NewReader(file)
// InitAWS sets up the AWS Translate package using your AWS credientials
// via environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
func InitAWS() {
awsKey = os.Getenv("AWS_ACCESS_KEY_ID")
awsSecret = os.Getenv("AWS_SECRET_ACCESS_KEY")
creds := credentials.NewStaticCredentials(awsKey, awsSecret, "")
sess, err := session.NewSession(&aws.Config{
Region: aws.String("us-west-2"),
Credentials: creds,
// +build ignore
package main
import (
"encoding/csv"
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
apiVersion: v1
kind: Pod
metadata:
name: envar-demo
labels:
purpose: demonstrate-envars
spec:
containers:
- name: envar-demo-container
image: gcr.io/google-samples/node-hello:1.0
@hunterlong
hunterlong / kuber.yml
Last active September 16, 2020 21:50
apiVersion: v1
kind: Pod
metadata:
name: envar-demo
labels:
purpose: demonstrate-envars
spec:
containers:
- name: envar-demo-container
image: gcr.io/google-samples/node-hello:1.0
[
{
"type": 1,
"title": "Statping",
"restart_policy": "unless-stopped",
"description": "Service monitoring with an easy to use status page and mobile app",
"logo": "https://assets.statping.com/icon.png",
"image": "statping/statping:latest",
"ports": [
"8080:8080/tcp"
# Deploy Portainer demo (demo.portainer.io) in a play-with-docker playground
#
# - Go to http://play-with-docker.com/?stack=https://raw.githubusercontent.com/portainer/portainer-demo/master/play-with-docker/docker-stack.yml
# - Login and/or Start.
# - Wait until 'Your session is ready!' and 'Close' modal.
# - Refresh (if a shell is not shown).
# - Wait until a link with text '80' is shown. It is the link to the demo.
# - Visit https://github.com/portainer/portainer to check default credentials.
#
version: '3'