Skip to content

Instantly share code, notes, and snippets.

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

Attila Pinter apinter

🏠
Working from home
  • OpenStorage.xyz
  • Jakarta, Indonesia
View GitHub Profile
@apinter
apinter / k8s_learning_path.md
Last active November 14, 2024 07:13
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
Created August 6, 2024 10:59
demo pod
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-deployment
labels:
app: hello-world
spec:
selector:
matchLabels:

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
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:
@apinter
apinter / user_mongo_debug.md
Last active April 5, 2024 14:20
OVH mongo user creation fail
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # ovh_cloud_project_database_mongodb_user.xund_medres_admin will be created
  + resource "ovh_cloud_project_database_mongodb_user" "xund_medres_admin" {
      + cluster_id   = "0394a25e-f7b9-4d0c-99c6-c72c92c6acfe"
      + created_at   = (known after apply)
@apinter
apinter / db_deploy_debug.md
Created April 5, 2024 12:34
OVH TF debug
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # ovh_cloud_project_database.mongodb_medres will be created
  + resource "ovh_cloud_project_database" "mongodb_medres" {
      + advanced_configuration = (known after apply)
      + backup_regions         = (known after apply)
provider "ovh" {
  endpoint           = var.ovh_endpoint
  application_key    = var.ovh_application_key
  application_secret = var.ovh_application_secret
  consumer_key       = var.ovh_consumer_key
  alias              = "ovh"
}

provider "openstack" {