Skip to content

Instantly share code, notes, and snippets.

View dgk's full-sized avatar
🇬🇪

Dmitry Kuksinsky dgk

🇬🇪
View GitHub Profile
@vengrov
vengrov / __map.geojson
Created September 17, 2019 12:47
E7A72B34-DEC3-24CD-FF3F-B94DE1DA0E00
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
curl -L https://gist.github.com/dgk/9229027/raw/git_config.sh | sh
curl -L https://gist.github.com/dgk/a1a8a30e94f63524af0a36ee34518771/raw/.vimrc > "${HOME}/.vimrc"
curl -L https://gist.github.com/dgk/a1a639ff7bb4a4e0ecbf20233c7394db/raw/.zshrc > "${HOME}/.zshrc"
@ertaquo
ertaquo / psd.ksy
Last active February 24, 2023 12:39
Photoshop format definition (incomplete) for Kaitai Struct
meta:
id: psd
file-extension: psd
endian: be
seq:
- id: file_header
type: file_header
- id: color_mode_data
type: color_mode_data
- id: image_resources
#!/bin/bash
set -o xtrace
rm -rf /etc/cni/net.d/*
ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
REGION=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region')
LIFECYCLE=$(aws ec2 describe-instances --region=$REGION --instance-ids=$ID | jq -r '.Reservations[].Instances[].InstanceLifecycle')
if [[ $LIFECYCLE = "spot" ]]; then
EXTRA_ARGS="--node-labels=lifecycle=Ec2Spot,aws.amazon.com/spot=true,node-role.kubernetes.io/spot-worker=";
else
resource "hcloud_server" "server" { # Create a server
name = "server-${local.name}" # Имя сервера
image = "${var.image}" # Базовый образ
server_type = "${var.server_type}" # Тип инстанса
location = "${var.location}" # Регион
backups = "false" # Включать ли бекапы
ssh_keys = ["${hcloud_ssh_key.user.id}"] # SSH ключ
user_data = "${data.template_file.instance.rendered}" # Скрипт, который отработает при старте
provisioner "file" { # Копирование файлов на инстанс
acme.challengeType=http-01
acme.email=hostmaster@domain.tld
acme.enabled=true
acme.staging=false
acme.logging=true
acme.persistence.enabled=true
acme.persistence.size=1Gi
acme.persistence.storageClass=longhorn
dashboard.domain=traefik.clusterXY.domain.tld
dashboard.enabled=true
@krnd
krnd / .style.yapf
Last active February 25, 2022 04:20
python-yapf
# .style.yapf
#
# DESCRIPTION
# Configuration file for the python formatter yapf.
#
# This configuration is based on the generic
# configuration published on GitHub.
#
# AUTHOR
# krnd
@davewongillies
davewongillies / Terraform_functions.md
Last active May 5, 2024 09:21
Terraform Functions

Supported built-in functions

  • abs(float) - Returns the absolute value of a given float. Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. See also the signum function.

  • basename(path) - Returns the last element of a path.

  • base64decode(string) - Given a base64-encoded string, decodes it and returns the original string.

@styblope
styblope / docker-api-port.md
Last active May 20, 2024 14:20
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@venezia
venezia / multiple-tillers.md
Last active August 9, 2019 06:00
Multiple Tillers

Introduction

Did you know that you can have multiple helm tillers running in a cluster?
This may actually be useful to us for both security as well as isolating what our cluster ops team does from what our customers can do.

Background

Current Helm Access Control

Helm security is such that "If you can talk to tiller, you can use that tiller" To be able to contact tiller, one needs to be able to create a pod in the namespace tiller resides in. Otherwise you will get an error message like: