Skip to content

Instantly share code, notes, and snippets.

@alekc
alekc / autotrader-userscript.js
Created May 12, 2023 09:56
Autotrader.co.uk userscript hiding certain cars
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.autotrader.co.uk/car-search*
// @icon https://www.google.com/s2/favicons?sz=64&domain=autotrader.co.uk
// @grant none
// ==/UserScript==
@alekc
alekc / printer.cfg
Last active October 21, 2022 09:31
Ender5 Pro klipper
[include mainsail.cfg]
# This file contains pin mappings for the stock 2020 Creality Ender 5
# Pro with the 32-bit Creality 4.2.2 board. To use this config, during
# "make menuconfig" select the STM32F103 with a "28KiB bootloader" and
# with "Use USB for communication" disabled.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select the
# USART3 serial port, which is broken out on the 10 pin IDC cable used
# for the LCD module as follows:
@alekc
alekc / working-dev-setup.md
Created June 15, 2022 13:30
working-dev-setup

Brew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/alexander.chernov/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Zsh config

Install Oh My Zash

@alekc
alekc / secrets.hcl
Created January 20, 2022 15:12
draft for getting secrets
data "aws_iam_policy_document" "secret-store-csi" {
statement {
effect = "Allow"
actions = ["secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret"]
resources = ["*"]
}
}
resource "aws_iam_policy" "secret-store-csi" {
name = "secret-store-csi-${var.cluster_name}"
@alekc
alekc / cka-study-notes.md
Last active August 6, 2021 14:48
Cka study notes

Exam areas

  • Cluster Architecture, Installation & Configuration, 25%
  • Workloads & Scheduling, 15%
  • Services & Networking, 20%
  • Storage, 10%
  • Troubleshooting, 30%

Cluster Architecture, Installation & Configuration (25%)

Data flow

securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
@alekc
alekc / go-cient.go
Created May 25, 2020 07:45
Watcher snippet for k8
var stopCh <- chan struct{}
watcher := cache.NewListWatchFromClient(k8Client.RESTClient(),"nodes", metaV1.NamespaceAll,fields.Everything())
_, controller := cache.NewInformer(
watcher,
&coreV1.Node{},
time.Second * 10,
cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
node, ok := obj.(*coreV1.Node)
if !ok {
@alekc
alekc / debug-daemon-set.yaml
Last active May 24, 2020 19:36
Debugging daemonset for kubernetes.
# kubectl apply -f https://gist.githubusercontent.com/alekc/bd1c60353171add01301096e67621cd8/raw/debug-daemon-set.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: dnsutil
labels:
k8s-app: fluentd-logging
spec:
selector:
matchLabels:
@alekc
alekc / kill.go
Created May 21, 2020 08:36
Manage the life of a spawned process in go
// Start a process:
cmd := exec.Command("sleep", "5")
if err := cmd.Start(); err != nil {
log.Fatal(err)
}
// Wait for the process to finish or kill it after a timeout (whichever happens first):
done := make(chan error, 1)
go func() {
done <- cmd.Wait()
@alekc
alekc / grafana.yml
Created May 19, 2020 07:22
PMM grafana dashboards configuration
grafana:
plugins:
- digiapulssi-breadcrumb-panel
- grafana-polystat-panel
# - pmm-check-panel-home
# - pmm-update-panel
defaultDashboardsEnabled: true
dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1