Skip to content

Instantly share code, notes, and snippets.

@lalyos
lalyos / README.md
Last active Oct 19, 2022
Recording bash's standard out
View README.md

If you want to store all stdout while runing an interactive bash:

Install

curl -Lo /usr/local/bin/cybash https://gist.githubusercontent.com/lalyos/94cef8ca8bb3087387312f7f3e775e3b/raw/cybash
chmod +x /usr/local/bin/cybash

Usage

@lalyos
lalyos / Dockerfile
Last active Oct 19, 2022
Test figlets
View Dockerfile
FROM alpine
RUN apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing lolcat curl
CMD curl -sL https://gist.githubusercontent.com/lalyos/99341041e6b513a05ac945c897ef518e/raw/network.txt | lolcat
@lalyos
lalyos / README.md
Last active Sep 30, 2022
LZ-string decoder in go flems.io
View README.md

LZ-string decoder in go

I was playing with https://flems.io/ and wondered how it stores data.

  • locally it uses localstorage
  • but state is preserved in url (bookmarkable POC)

Example link: http://flems.io

Usage

@lalyos
lalyos / index.html
Created Mar 28, 2022
JS Countdown Timer
View index.html
<div id="app"></div>
@lalyos
lalyos / index.pug
Created Mar 27, 2022
Quick pure CSS counter
View index.pug
- let d = 100, o = -.5*d;
- let sw = .1*d, r = .5*(d - sw);
- let len = 2*Math.PI*r;
.countdown
svg(viewBox=[o, o, d, d].join(' ') stroke-width=sw)
circle(r=r)
circle(r=r stroke-dasharray=len stroke-dashoffset=`${len}px`)
@lalyos
lalyos / appify.sh
Created Mar 24, 2022 — forked from oubiwann/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
View appify.sh
#!/usr/bin/env bash
VERSION=4.0.1
SCRIPT=`basename "$0"`
APPNAME="My App"
APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"
OSX_VERSION=`sw_vers -productVersion`
PWD=`pwd`
function usage {
@lalyos
lalyos / install-k8s-kubeadm.sh
Last active Mar 17, 2022
install k8s with kubeadm
View install-k8s-kubeadm.sh
## containerd prereq
modprobe br_netfilter
modprobe overlay
cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
overlay
br_netfilter
EOF
cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
View firday-2.yaml
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
annotations:
sealedsecrets.bitnami.com/cluster-wide: "true"
creationTimestamp: null
name: friday
spec:
encryptedData:
COLOR: AgBjJHOv3uB1m+yj/xiaqZqj97kwdEHcxyBIE6JxnNaAFPv+ZFP5+hs/4LtCCNjsvLjzZ9mgMlGUzKxNXH8stajNHjDfzp3EUyT8e4IdfKxExESHLgeLIAj/zTPknHNM380tAn5nHH0uPwyyT1BtQMnkmFxuDaXCTjHr3HlbVBupK0Yd6vKLxyQ3XdNRvepN1WSOHn5qs+Uihfv+SEGIhYlr5KmYVx+VBGvwoBDAnyb0mrlNPjk1QZnqimHu3BEWtvEn7+l6HGrugIb3iHd14zJf4vysqIMsc4h/G1BQbr8zB6rN9CbKuzxaP5SJ+96BrerxlhN4UU5ZP+FJeTVPIpj/RPndHQZBm/Yz46p2VX6f+f2xcrFOn0pLMFmnsALoIpUvQEqUODaQDf4Ql4O/nHHiSDeQATMuQ543cVeI6uUElvRkWRFj21Q6P+GpIRkoWV7EslIzbFMhpsYibDYpcI+em8TcKyKZmMhaaFYUfPDUZ8qV7JRVGL1Bz2A1zlnT3vs4sK7PRKOO9TNfQGuwN9q2FkWcgvIJPdUeoW/ZH+G91LDwyRnfH2F9ezI+qDLy/K6KnKyX4PtgPk6RM6TsuPAx3sNKyHx+rT6iSaKkqJzR8C6Xsk9WLgE63jjrfaDVzpJv8V+FDpwXQ+llEPCcf7Q9J2ILaEsgIQBrAjp+xaSGIfSOwT40Jisbkl0d+2tpPU4zMpc28g==
View ing.yaml
---
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: ing
spec:
version: "v0.0.6"
homepage: https://github.com/lalyos/kubectl-ing
shortDescription: "Generates an Ingress for a svc"
description: |
@lalyos
lalyos / explorer.yaml
Created Nov 7, 2021
rancher cluster explorer
View explorer.yaml
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-explorer
namespace: kube-system
labels:
app: kube-explorer
---
kind: ClusterRoleBinding