Skip to content

Instantly share code, notes, and snippets.

@arthurk
arthurk / gist:ab9ced56ce78bb8309599ccc62fa2576
Created Jun 1, 2020
fetch list images from GCR via service account
View gist:ab9ced56ce78bb8309599ccc62fa2576
#!/usr/bin/env bash
set -euo pipefail
######################
# Script that fetches a list of all images from GCR
# uses 3 different users in GCR
######################
keyfile="gcr-svc-acc-keyfile.json"
projectName="example-project"
View deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "132123.fullname" . }}
labels:
{{- include "132123.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
View service.yaml
apiVersion: v1
kind: Service
metadata:
name: {{ include "mychart.fullname" . }}
labels:
{{- include "mychart.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
View gist:6f482ea04ace94a3bbd7f5275c64a4cb
apiVersion: v1
kind: Service
metadata:
name: {{ include "mychart.fullname" . }}
labels:
{{- include "mychart.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
View ingress.yaml
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "mychart.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
View df-h-aws.txt
admin@ip-172-31-17-214:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 486M 0 486M 0% /dev
tmpfs 99M 2.8M 96M 3% /run
/dev/xvda1 7.7G 868M 6.5G 12% /
tmpfs 494M 0 494M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 494M 0 494M 0% /sys/fs/cgroup
/dev/xvda15 124M 262K 124M 1% /boot/efi
tmpfs 99M 0 99M 0% /run/user/1000
View apt-list-installed-aws.txt
adduser/stable,now 3.118 all [installed]
apparmor/stable,now 2.13.2-10 amd64 [installed]
apt-listchanges/stable,now 3.19 all [installed]
apt-utils/stable,now 1.8.2 amd64 [installed]
apt/stable,now 1.8.2 amd64 [installed]
awscli/stable,now 1.16.113-1 all [installed]
base-files/stable,now 10.3+deb10u2 amd64 [installed]
base-passwd/stable,now 3.5.46 amd64 [installed]
bash-completion/stable,now 1:2.8-6 all [installed]
bash/stable,now 5.0-4 amd64 [installed]
View ps-ax-aws.txt
PID TTY STAT TIME COMMAND
1 ? Ss 0:01 /sbin/init
2 ? S 0:00 [kthreadd]
3 ? I< 0:00 [rcu_gp]
4 ? I< 0:00 [rcu_par_gp]
5 ? I 0:00 [kworker/0:0-cgroup_destroy]
6 ? I< 0:00 [kworker/0:0H-kblockd]
7 ? I 0:00 [kworker/u30:0-events_unbound]
8 ? I< 0:00 [mm_percpu_wq]
9 ? S 0:00 [ksoftirqd/0]
View bench.py
#!/usr/bin/env python3
from secrets import token_bytes
from coincurve import PublicKey
from sha3 import keccak_256
def generate_address():
private_key = keccak_256(token_bytes(32)).digest()
public_key = PublicKey.from_valid_secret(private_key).format(compressed=False)[1:]
addr = keccak_256(public_key).digest()[-20:]
View bumpme
Thu Oct 11 09:48:24 UTC 2018
You can’t perform that action at this time.