Skip to content

Instantly share code, notes, and snippets.

View ruanbekker's full-sized avatar
🇿🇦

Ruan Bekker ruanbekker

🇿🇦
View GitHub Profile
@ruanbekker
ruanbekker / argocd-repo-server-timeout-tcp.md
Created September 19, 2024 11:15
ArgoCD: transport: Error while dialing: dial tcp: lookup argocd-repo-server: i/o timeout

ArgoCD Failing to connect to repo-server

I faced this error in my argo cd applicationset controller logs:

argocd-applicationset-controller-d79554d98-qbp8t applicationset-controller time="2024-09-19T10:53:28Z" level=error msg="error generating params" error="error generating params from git: error getting directories from repo: error retrieving Git Directories: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp: lookup argocd-repo-server: i/o timeout\"" generator="&{0xc000575d40 argocd}"
argocd-applicationset-controller-d79554d98-qbp8t applicationset-controller time="2024-09-19T10:53:28Z" level=error msg="error generating application from params" applicationset=argocd/blogs error="error generating params from git: error getting directories from repo: error retrieving Git Directories: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp: lookup argocd-repo-server: i/o timeout\"" generator="{ni
@ruanbekker
ruanbekker / 0-loki-v3-simple-scalable.yaml
Last active September 4, 2024 21:59
Loki v3 Config - Simple Scalable Deployment
deploymentMode: SimpleScalable
loki:
auth_enabled: true
server:
grpc_listen_port: 9095
http_listen_port: 3100
http_server_read_timeout: 600s
http_server_write_timeout: 600s
schemaConfig:
configs:
@ruanbekker
ruanbekker / grafana-loki-v3-promtail.md
Last active August 24, 2024 01:38
Grafana 11, Loki v3 and Promtail on Civo

Loki:

helm upgrade --install loki-cluster grafana/loki \
  --version 6.10.0 \
  --namespace default \
  --values loki-values.yaml

Grafana:

@ruanbekker
ruanbekker / python_github_discussions_graphql.py
Created March 10, 2024 15:54
How to Create Github Discussions via GraphQL API using Python Requests
"""
This script uses the GraphQL API to create discussions programatically using Python and Requests.
"""
import os
import time
import json
import requests
def url_builder(path):
@ruanbekker
ruanbekker / index.html
Created April 21, 2023 12:51
Simple User Card #1
<div class="card">
<img class="avatar" src="https://pbs.twimg.com/profile_images/1610149927455178752/JuWuMNUw_400x400.jpg">
<div class="follow-btn" onclick="followBtn()">Follow</div>
<p class="name">Frank Eno</p>
<p class="username">@xsgames</p>
<p class="info">Game Developer, Web designer<br>Guitar player, father of 4</p>
<div class="bottom-data">9.7K <span>Followers</span> • 240 <span>Following</span> • <span>Since May 2018</span>
</div>
@ruanbekker
ruanbekker / use_curl_to_send_discord_messages.md
Last active July 5, 2024 02:11
Send messages to Discord using curl
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ruanbekker
ruanbekker / open_port.py
Created June 25, 2022 21:00 — forked from jdavis/open_port.py
Find an open port in Python.
import socket
def find_open_port():
"""
Use socket's built in ability to find an open port.
"""
sock = socket.socket()
sock.bind(('', 0))
########################################################
# How To Auto-Scale Kubernetes Clusters With Karpenter #
# https://youtu.be/C-2v7HT-uSA #
########################################################
# Referenced videos:
# - GKE Autopilot - Fully Managed Kubernetes Service From Google: https://youtu.be/Zztufl4mFQ4
#########
# Setup #
@ruanbekker
ruanbekker / loki_nginx_regex_access_logs.md
Last active November 5, 2024 13:45
Loki Regex LogQL Query for Nginx Access Logs

Access Log:

172.16.4.86 - - [04/Jun/2022:07:58:38 +0000] "GET / HTTP/2.0" 301 280 "-" "curl"

Query in Grafana / Loki:

{job="prod/nginx"} |= "GET / "