Skip to content

Instantly share code, notes, and snippets.

# Use an existing image as a base
FROM debian:buster-slim
# Set the working directory
WORKDIR /app
# Copy the application files to the container
COPY . .
# Install required dependencies
apiVersion: apps/v1
kind: Deployment
metadata:
name: techpenguin-demo-app
spec:
selector:
matchLabels:
app: techpenguin-demo-app
replicas: 1
template:
@eckelon
eckelon / nginx-exporter-rbac-example.yaml
Last active November 8, 2022 17:06
kube-rbac-proxy example for Prometheus exporter
kind: Namespace
apiVersion: v1
metadata:
name: example-app
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-rbac-proxy
namespace: example-app
@eckelon
eckelon / safeSideEffects.js
Last active July 30, 2020 09:31
Safe side effects using Fluture
// test in: https://runkit.com/eckelon/5f22785767e514001bddd5e3
const { env } = require('sanctuary-def');
const S = require('sanctuary');
const {env : flutureEnv} = require('fluture-sanctuary-types');
const { encase, fork } = require('fluture');
const { pipe, I } = S.create ({checkTypes: true, env: S.env.concat (flutureEnv)});
function Logger() {
this._log = (level) => (message) => {
const foo = 1;
@eckelon
eckelon / show-queries-real-time
Created November 26, 2019 12:20 — forked from daniDLL/show-queries-real-time
Show executed queries in real time
## Show real-time
watch -n1 'mysql -u root -ppassword --execute="SHOW FULL PROCESSLIST"'
## Show real-time and pipe all info to file
watch -t -n1 '(mysql -u root -ppassword --execute="SHOW FULL PROCESSLIST") | tee -a mysql-process-list.log'
@eckelon
eckelon / git-weekly.sh
Created November 14, 2019 11:33
script for generating a markdown styled report based on the last 7 days git activity, on all the repos inside the current dir. Inspired by https://twitter.com/climagic/status/1194712444201054209?s=12
#!/bin/bash
CUR_DIR=$(pwd)
GIT_USER="JA Samitier"
report="# Git report from last week\n"
printf "Generating git report...\n\n"
repos=$(find . -name ".git" | cut -c 3-)
for i in $repos; do
@eckelon
eckelon / generate-rush-project-config.sh
Last active November 6, 2019 08:42
Small script for creating project configuration for @microsoft/rush. I use it with `jq`: `./generate-rush-project-config.sh | jq`
#!/bin/bash
for i in $(ls -d */)
do
path="packages/${i/\//}"
name=$(cat "$i"/package.json | grep name | head -1 | sed 's/"//g' | sed 's/name: //g' | sed 's/,//g' | sed 's/ //g')
res="$res,{\"packageName\": \"$name\", \"projectFolder\": \"$path\"}"
done
echo "{\"projects\": [${res/,/}]}"
rg "require\('joi'\)" -l | xargs sed -i '' "s/'joi'/'@hapi\/joi'/g"
@eckelon
eckelon / init.lua
Last active July 11, 2019 07:59
hammerspoon script to emulate shiftIt behaviour
hs.window.animationDuration = 0
units = {
r30 = { x = 0.700, y = 0.000, w = 0.300, h = 1.000 },
r50 = { x = 0.500, y = 0.000, w = 0.500, h = 1.000 },
r70 = { x = 0.300, y = 0.000, w = 0.700, h = 1.000 },
l30 = { x = 0.000, y = 0.000, w = 0.300, h = 1.000 },
l50 = { x = 0.000, y = 0.000, w = 0.500, h = 1.000 },
l70 = { x = 0.000, y = 0.000, w = 0.700, h = 1.000 },
top50 = { x = 0.000, y = 0.000, w = 1.000, h = 0.500 },
bot50 = { x = 0.000, y = 0.500, w = 1.000, h = 0.500 },
@eckelon
eckelon / git-clean-local-branches
Created June 19, 2019 10:12 — forked from daniDLL/git-clean-local-branches
Git clean local branches that are not on remote anymore
git branch -vv | grep -E "desaparecido|gone" | awk '{print $1}' | xargs -n1 git branch -d