Skip to content

Instantly share code, notes, and snippets.

View asardaes's full-sized avatar

Alexis Sardá asardaes

View GitHub Profile
@cyberpunk042
cyberpunk042 / debian12_configuration_script.sh
Last active May 27, 2025 07:37
TrueNAS Scale 24.04.2 Customization
#!/bin/bash
# Set script to exit on error
set -e
# Enable logging
exec > >(tee -i /var/log/setup-script.log)
exec 2>&1
echo "Starting script execution..."
@RollingStar
RollingStar / beets_config.yaml
Created May 19, 2020 23:57
beets_config.yaml
# don't copy paste this into your config. It's tailored to me and I haven't really stress-tested it outside of my own use. Also, I was mostly using this in 2017-2019 and features may have changed.
# Some plugins have been retired and I haven't migrated yet. copyartifacts is the best example of this.
# Just use this as a starting point to learn about advanced, undocumented/poorly-documented features of beets.
directory: e:\Music\
library: e:\Music\beetslibrary.bib
#copyartifactspy3 chroma scrub
@tzapu
tzapu / gist:f47924daae9d64b65fdfaf92b64f587c
Last active August 18, 2024 13:05
connecting to a kubernets hosted kafka cluster from macOS
# you will need to alias the internal kube IPs to your loopback interface
# get pods with IPs
kubectl get pods -n kafka -o wide
# add aliases
sudo ifconfig lo0 100.101.168.109 alias
sudo ifconfig lo0 100.117.38.251 alias
sudo ifconfig lo0 100.121.158.154 alias
@yang-g
yang-g / greeter_async_server.cc
Created March 17, 2017 22:26
grpc async server toy example
// Class encompasing the state and logic needed to serve a request.
class CallDataBase {
public:
// Take in the "service" instance (in this case representing an asynchronous
// server) and the completion queue "cq" used for asynchronous communication
// with the gRPC runtime.
CallDataBase(Greeter::AsyncService* service, ServerCompletionQueue* cq)
: service_(service), cq_(cq), status_(PROCESS) {}
virtual ~CallDataBase() {}
@mgoodness
mgoodness / k8s-svc-annotations.md
Last active September 7, 2024 16:25
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@abhin4v
abhin4v / maximal_cliques.py
Last active October 7, 2021 16:46
Finds all maximal cliques in a graph using the Bron-Kerbosch algorithm
# Finds all maximal cliques in a graph using the Bron-Kerbosch algorithm. The input graph here is
# in the adjacency list format, a dict with vertexes as keys and lists of their neighbors as values.
# https://en.wikipedia.org/wiki/Bron-Kerbosch_algorithm
from collections import defaultdict
def find_cliques(graph):
p = set(graph.keys())
r = set()
x = set()