Skip to content

Instantly share code, notes, and snippets.

View KrustyHack's full-sized avatar
💭
┬─┬ ノ( ゜-゜ノ)

Nicolas Hug KrustyHack

💭
┬─┬ ノ( ゜-゜ノ)
View GitHub Profile
@KrustyHack
KrustyHack / gist:08c37c4bec76762ae2d2fe7e83244c77
Created July 15, 2024 19:46
Simple Python Docker file with Gunicorn/Uvicorn
FROM python:3.12-bookworm AS builder
RUN pip install poetry
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
WORKDIR /app
@KrustyHack
KrustyHack / blueprint.json
Created January 11, 2024 21:41
Raindrop.io x Make x ChatGPT
{
"name": "Integration Raindrop.io, OpenAI (ChatGPT, Whisper, DALL-E)",
"flow": [
{
"id": 1,
"module": "raindrop-io:watchBookmarks",
"version": 1,
"parameters": {
"__IMTCONN__": 2363503,
"collection": {
@KrustyHack
KrustyHack / domdetailer.sh
Created December 26, 2023 14:49
Script to call Domdetailer API and check root domain and www
#!/bin/bash
# Check if parameter is empty
if [ -z "$1" ]
then
echo "Please provide a domain name"
exit 1
fi
temp_file=$(mktemp)
@KrustyHack
KrustyHack / envoyfilter.yaml
Created June 29, 2023 07:49
Envoyer filter for fault injection
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: failure-simulation
namespace: mynamespace
spec:
configPatches:
- applyTo: HTTP_FILTER
match:
context: SIDECAR_INBOUND
@KrustyHack
KrustyHack / deployment.yaml
Created January 12, 2023 09:18
Pod placeholder example
# Source: placeholder/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: release-name-placeholder
labels:
helm.sh/chart: placeholder-0.1.0
app.kubernetes.io/name: placeholder
app.kubernetes.io/instance: release-name
app.kubernetes.io/version: "latest"
@KrustyHack
KrustyHack / .tmux.conf
Created January 27, 2022 15:21
Tmux configuration
# -- general -------------------------------------------------------------------
set -g default-terminal "screen-256color" # colors!
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s focus-events on
set -g prefix2 C-a # GNU-Screen compatible prefix
bind C-a send-prefix -2
@KrustyHack
KrustyHack / gist:e97cba32b308c92ad72a9e87b4ace522
Created January 21, 2022 15:37
Kubernetes delete all failed pods
kubectl get po --all-namespaces --field-selector 'status.phase==Failed' -o json | kubectl delete -f -
@KrustyHack
KrustyHack / kill_k8s_namespace.sh
Created January 21, 2022 15:36
Force kill Kubernetes namespace
#!/bin/bash
###############################################################################
# Copyright (c) 2018 Red Hat Inc
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
echo '{"code": "send-log-via-fluent-cat", "message": "This is a log from in_forward plugin."}' | /opt/google-fluentd/embedded/bin/fluent-cat log-via-in-forward-plugin
@KrustyHack
KrustyHack / reset.sh
Created January 21, 2022 15:34
Hard reset fork from upstream
#!/bin/bash
UPSTREAM="$1"
read -n 1 -p "/!\\ Keep in mind, that this makes your repo look exactly like upstream - If you have commits, they will be eaten ! /!\\ [y/n]" askinput
echo -e "\n"
if [ "${askinput}" == "y" ]; then
echo -e "Will force reset with upstream"