Skip to content

Instantly share code, notes, and snippets.

Kenneth Massada kmassada

Block or report user

Report or block kmassada

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kmassada
kmassada / README.md
Last active Jul 30, 2019
PFsense image to GCE instance
View README.md

PFsense image to GCE instance

View deltaT.go
package main
import (
"errors"
"flag"
"fmt"
"strings"
"time"
)
View ingress-readiness.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoheaders
spec:
selector:
matchLabels:
app: echoheaders
replicas: 1
template:
@kmassada
kmassada / README.md
Last active Sep 26, 2018
fanout ingress with static IP
View README.md

create static IP

gcloud compute addresses create fanout-ingress --region $REGION

Note annotation "fanout-gress" is the name of static IP

  annotations:
View pubsub.go
// pubsub attempts to reproduce a client timeout issue.
package main
import (
"context"
"fmt"
"math/rand"
"os"
"os/user"
"sync/atomic"
@kmassada
kmassada / README.md
Created Jun 25, 2018
Trying let'sencrypt with nginx
View README.md

Letsencrypt + nginx

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo apt-get install nginx
@kmassada
kmassada / scrape-cos-gke-logs.sh
Last active May 11, 2018
scrape CoS nodes running GKE for node logs
View scrape-cos-gke-logs.sh
#!/bin/bash
# GENERIC
# uptime
# dmesg
# df -a --inodes
# cat /proc/sys/fs/file-nr
# systemctl status -l docker
# sudo journalctl -u docker
# sudo journalctl -u kube-docker-monitor.service
View README.md

Create the sertificate and a secret

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout secret.key -out secret.crt -subj "/CN=foobar.com"
kubectl create secret tls tls-secret --key=secret.key --cert=secret.crt
@kmassada
kmassada / echo.go
Last active Feb 27, 2018
go echoheaders
View echo.go
package main
import (
"fmt"
"net/http"
"strings"
"time"
)
// handler hello world, the web server
@kmassada
kmassada / Dockerfile
Last active Jan 9, 2018
Node.js container on gce with pid and exit on ctrl-c
View Dockerfile
FROM node:8
USER node
ENV HOME=/home/node
RUN mkdir $HOME/app
WORKDIR $HOME/app
COPY package.json $HOME/app
RUN npm set progress=false && \
npm config set depth 0 && \
npm install --only=production && \
npm cache clean --force
You can’t perform that action at this time.