Skip to content

Instantly share code, notes, and snippets.

View DoZator's full-sized avatar
😺
Working

Oleg Bogatenko DoZator

😺
Working
View GitHub Profile
@DoZator
DoZator / README.md
Last active April 8, 2025 07:54
Kubernetes cheatsheet

Cluster & Context

  • List all available contexts
kubectl config get-contexts
  • Show current context
@DoZator
DoZator / README.md
Created March 5, 2025 20:10
Generate OpenSSL private and public keys

Generate RSA 1024 bit key:

openssl genrsa -out private_key.pem 1024

Get public key from private:

openssl rsa -in private_key.pem -pubout -out public_key.pem
@DoZator
DoZator / README.md
Created October 24, 2024 11:34
Get public key of a pem file

Copy the public key to clipboard

Linux

ssh-keygen -f private.pem -y | xclip

macOS

@DoZator
DoZator / README.md
Last active April 8, 2024 13:31
Postgres (useful commands)

PostgreSQL

Connecting to database

psql -h <host> -U <username> <database-name>

or

psql -h <host> -U <username> -l
@DoZator
DoZator / README.md
Last active October 24, 2024 11:22
Show octal file permissions (Linux)

Show octal file permissions in Linux

stat -c '%A %a %n' *
@DoZator
DoZator / DocumentDBConfig.java
Last active October 2, 2023 07:54
DocumentDB configuration example
@Slf4j
@Configuration
@RequiredArgsConstructor
public class DocumentDBConfig extends AbstractMongoClientConfiguration {
private static final String CERT_FILE_PATH = "document-db-certs/rds-combined-ca-bundle.pem";
private static final String END_OF_CERTIFICATE_DELIMITER = "-----END CERTIFICATE-----";
private static final String CERTIFICATE_TYPE = "X.509";
private static final String TLS_PROTOCOL = "TLS";
@DoZator
DoZator / mongodb-cheat-sheet.md
Created August 29, 2023 13:28 — forked from devkiran/mongodb-cheat-sheet.md
MongoDB Cheat Sheet

1. Insert a single document

db.products.insertOne({ name: 'Product 1', price: 200 })

2. Insert multiple documents - Ordered

db.products.insertMany([{ name: 'Product 1', price: 200 }, { name: 'Product 2', price: 100 }])
@DoZator
DoZator / README.md
Created July 28, 2023 08:29
Using GPG

Make encrypted file with a gpg extension

When executing command, it prompts you to enter passphrase.

  gpg --symmetric --cipher-algo aes256 filename.ext

Decrypt file

@DoZator
DoZator / READMe.md
Last active March 5, 2025 20:04
Make SSH keys

SSH key types

RSA: It depends on key size. If it has 3072 or 4096-bit length, then you’re good. But 2048 bit keys are indeed acceptable until 2030.

How many bits my ssh key is:

    ssh-keygen -l -f ~/.ssh/{key_name}.pub
@DoZator
DoZator / README.md
Created May 4, 2023 05:37
AWS Lambda with go-chi
package main

import (
    "context"
    "net/http"

    "github.com/aws/aws-lambda-go/events"
    "github.com/aws/aws-lambda-go/lambda"