Skip to content

Instantly share code, notes, and snippets.

@arthurk
arthurk / foot.ini
Created February 14, 2022 07:24
foot terminal tokyonight colors
[colors]
foreground=c0caf5
background=1a1b26
## Normal/regular colors (color palette 0-7)
regular0=15161E # black
regular1=f7768e # red
regular2=9ece6a # green
regular3=e0af68 # yellow
regular4=7aa2f7 # blue
@arthurk
arthurk / gist:ab9ced56ce78bb8309599ccc62fa2576
Created June 1, 2020 03:50
fetch list images from GCR via service account
#!/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"
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "132123.fullname" . }}
labels:
{{- include "132123.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
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 }}
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 }}
{{- 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:
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
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]
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]
#!/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:]