Skip to content

Instantly share code, notes, and snippets.

View Dani4kor's full-sized avatar
💭
sad

Dani Korniliev Dani4kor

💭
sad
  • Worldwide
  • Worldwide
View GitHub Profile
@Dani4kor
Dani4kor / gist:93c17df6eda059e2c4621b21e2e61f0b
Created July 10, 2023 16:04
wildcard letencrypt certificate(cert-manager) with DNS challange in CF (Cloudflare) in k8s/k3s with ingress-nginx controller
What i need:
- wildcard letencrypt certificate(cert-manager) with DNS challange in CF (Cloudflare) in k8s/k3s with ingress-nginx controller
as example below you need this steps:
- install cert-manager
- get cloudflare API TOKEN for DNS managment
- setup wildcard DNS A record pointed to hetzner LB(ingress-nginx) ip
- create secret with cloudflare API TOKEN
- create kind: ClusterIssuer
@Dani4kor
Dani4kor / gist:566d2e7b0da9d2e15a734fceecebef39
Created July 10, 2023 10:53
grafana and kube-state-metrics in prometheus-stack chart no tolerations or nodeSelector
# edit values.yml or subchart
kube-state-metrics:
nodeSelector: {}
affinity: {}
tolerations: []
grafana:
nodeSelector: {}
affinity: {}
tolerations: []
@Dani4kor
Dani4kor / gist:aa43559418eda336ab013e82fc5da49b
Created July 10, 2023 09:36
Error: 6003: Invalid request headers<- 6103: Invalid format for X-Auth-Key header cert-manager
# "cert-manager/challenges/finalizer: error cleaning up challenge" err=<
# while attempting to find Zones for domain _acme-challenge.domain.com.
# hile querying the Cloudflare API for GET "/zones?name=_acme-challenge.domain.com"
# Error: 6003: Invalid request headers<- 6103: Invalid format for X-Auth-Key header
# fix
https://github.com/cert-manager/cert-manager/issues/2384#issuecomment-575301692
@Dani4kor
Dani4kor / gist:0f39d8c531b08eab35e1a4bfad4912fd
Created July 10, 2023 09:30
challenge.acme.cert-manager.io stuck, cant delete
# to delete stucked challenge.acme.cert-manager.io
# edit challenge.acme.cert-manager.io resource
# remove finalizers
# save
# delete it
@Dani4kor
Dani4kor / Python parser for creating VisualStudio Resources.resx
Last active February 18, 2019 17:28
Python parser for creating VisualStudio Resources.resx
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re, os
'''
Parsing Translations.txt and creating Resources.resx with different languages
Translations format: b([0-9]+,[1-5])='String UTF-8'
@Dani4kor
Dani4kor / Python FEN chess Validation with regular expression
Last active August 17, 2022 05:32
Python FEN chess Validation with regular expression
def fenPass(fen):
"""
"""
regexMatch=re.match('\s*^(((?:[rnbqkpRNBQKP1-8]+\/){7})[rnbqkpRNBQKP1-8]+)\s([b|w])\s([K|Q|k|q]{1,4})\s(-|[a-h][1-8])\s(\d+\s\d+)$', fen)
if regexMatch:
regexList = regexMatch.groups()
fen = regexList[0].split("/")
if len(fen) != 8:
raise ValueError("expected 8 rows in position part of fen: {0}".format(repr(fen)))
'''
Python Quick Reference
https://github.com/justmarkham/python-reference
By Kevin Markham (kevin@dataschool.io)
http://www.dataschool.io
Table of Contents:
Imports
Data Types
Math
Comparisons and Boolean Operations
@Dani4kor
Dani4kor / TornadoCoroutines.py
Last active November 27, 2016 00:12
Tornado - Coroutines Time Delay&Sleep Example
import time
import tornado.web
from tornado.ioloop import IOLoop
from tornado import gen
from tornado.options import define, options, parse_command_line
define("port", default=8888, help="run on the given port", type=int)