Skip to content

Instantly share code, notes, and snippets.

View apinter's full-sized avatar
🏠
Working from home

Attila Pinter apinter

🏠
Working from home
View GitHub Profile
@apinter
apinter / proxy-tester.py
Created March 17, 2025 07:50
A script for testing socks5 connection
import socks
import socket
import requests
PROXY_HOST = "1.2.3.4"
PROXY_PORT = 1080
def get_public_ip():
try:
response = requests.get("https://ipconfig.org", timeout=5)
@apinter
apinter / mongo_perf.py
Last active March 14, 2025 04:30
mongo perftest
import pymongo
import time
import random
import string
import socks
import socket
PROXY_HOST = "1.2.3.4"
PROXY_PORT = 1080
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-deployment
labels:
app: hello-world
spec:
selector:
matchLabels:
app: hello-world
@apinter
apinter / k8s_learning_path.md
Last active March 20, 2025 22:29
k8s is king

Get familiar with the base concepts

Doesn't need a running cluster! Install podman and kubectl.

  • kubectl
    • Don't write it down as a simple tool to interact with clusters. kubectl can create all sorts of resources like secrets, pods, deployments etc. Great for learning.
    • kubectl run (kubectl run -i --tty --rm debug --image=registry.opensuse.org/opensuse/tumbleweed --restart=Never -- bash)
    • kubectl exec (kubectl exec -it -n default debug -- bash)
    • kubectl create (kubectl create deployment test --image registry.adathor.com/opensuse/tumbleweed --replicas 3 --dry-run=client -o yaml)
  • kubectl logs
@apinter
apinter / demo_pod.yml
Last active December 6, 2024 23:11
demo pod
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-deployment
labels:
app: hello-world
spec:
selector:
matchLabels:
app: hello-world

Commit signing with GPG keys

Having access to a code base to which you can make changes to poses some risks besides the obvious benefits. Commit signing is a great way to make sure of the individual's identity who is making these changes, and not just someone who gained access to the contributors' git account.

Requirements

The following packages are required:

[apinter@busybee:~/nix-config]$ nix run github:nix-community/nixos-anywhere -- --flake .#medusa root@194.233.75.126
### Uploading install SSH keys ###
/run/current-system/sw/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/tmp/tmp.metxAoZsfS/nixos-anywhere.pub"
/run/current-system/sw/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/run/current-system/sw/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Warning: Permanently added '194.233.75.126' (ED25519) to the list of known hosts.
root@194.233.75.126's password: 

Number of key(s) added: 1
@apinter
apinter / ovh_dev_mongo_dbaas.md
Created June 7, 2024 10:26
Dev mongo change
# ovh_cloud_project_database.mongodb must be replaced
-/+ resource "ovh_cloud_project_database" "mongodb" {
      ~ advanced_configuration  = {} -> (known after apply)
      ~ backup_regions          = [
          - "GRA",
        ] -> (known after apply)
      ~ backup_time             = "09:00:00" -> (known after apply)
      ~ created_at              = "2023-11-17T14:37:58.851097+01:00" -> (known after apply)
      ~ disk_type               = "high-speed" -> (known after apply)
◆ xund-terraform2 git:(OVH-DBaaS) ✗ ❯❯❯ TF_LOG=DEBUG terraform plan -out plan.bin
2024-05-21T19:48:08.849+0700 [INFO]  Terraform version: 1.8.3
2024-05-21T19:48:08.849+0700 [DEBUG] using github.com/hashicorp/go-tfe v1.51.0
2024-05-21T19:48:08.849+0700 [DEBUG] using github.com/hashicorp/hcl/v2 v2.20.0
2024-05-21T19:48:08.849+0700 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2024-05-21T19:48:08.849+0700 [DEBUG] using github.com/zclconf/go-cty v1.14.3
2024-05-21T19:48:08.849+0700 [INFO]  Go runtime version: go1.22.1
2024-05-21T19:48:08.849+0700 [INFO]  CLI args: []string{"terraform", "plan", "-out", "plan.bin"}
2024-05-21T19:48:08.849+0700 [DEBUG] Attempting to open CLI config file: /Users/localadmin/.terraformrc
0ACD0807:D6C2_0ACC8104:01BB_662A7D91_98FA25D:2F0C2
2024-04-25T22:58:08.927+0700 [DEBUG] provider.terraform-provider-ovh_v0.43.1: X-Iplb-Request-Id: 67796CB4:196C_8D5FBADF:01BB_662A7D90_9A0558F:C5A7
2024-04-25T22:58:08.927+0700 [DEBUG] provider.terraform-provider-ovh_v0.43.1: X-Ovh-Queryid: EU.ext-2.662a7d91.1200691.f8632fcef2581cf8dbe7652a68266d68
2024-04-25T22:58:08.927+0700 [DEBUG] provider.terraform-provider-ovh_v0.43.1: X-Recruitment: You know how to code? This is a good start, but it may not be enough! We are looking for engineers who LOVE coding. Programming enthusiasts, code aesthetes, CTF winners, ... In short, geeks eager to learn, obstinate, involved. You want to challenge yourself? Join us! http://ovh.jobs
2024-04-25T22:58:08.927+0700 [DEBUG] provider.terraform-provider-ovh_v0.43.1: X-Xss-Protection: 1; mode=block
2024-04-25T22:58:08.927+0700 [DEBUG] provider.terraform-provider-ovh_v0.43.1
2024-04-25T22:58:08.927+0700 [DEBUG] provider.terraform-provider-ovh_v0.43.1: 1714060689
2024-04-25T22:58: