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 / fck_drm_ebook.md
Last active March 21, 2025 02:01
Opening LEGALLY PURCHASED ebooks in calibre on Linux
  1. Install Calibre
  2. Install the DeASCM plugin, follow the README
  3. Download and EXTRACT the NoDRM plugin
  4. Install the DeDRM plugin from the extracted folder.

Telling people about how to remove DRM from their legally purchased content so they can read wherever, on whatever is not illegal ;)

@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 [email protected]
### 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.
[email protected]'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