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 May 31, 2024 10:40
Generate standalone SSL certs with certbot (nginx)

Install certbot from repo

$ sudo apt install certbot python3-certbot-nginx

Generate secret dhparam.pem

$ cd /etc/ssl
@DoZator
DoZator / Dockerfile
Created May 6, 2022 13:19
Run ganache-cli inside Docker Container
FROM node:16-alpine3.12
RUN npm install -g ganache-cli
CMD ["ganache-cli", "-h", "0.0.0.0"]
@DoZator
DoZator / README.md
Created October 12, 2022 08:30
Generate CSR and key in Linux

Generate CSR and key in Linux

Run the following command to generate a CSR and key

$ sudo openssl req -new -newkey rsa:2048 -nodes -keyout domainname.com.key -out domainname.com.csr
@DoZator
DoZator / README.md
Created November 2, 2022 10:18
Create a self-signed SSL Certificate

Creating the SSL Certificate and Key

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout selfsigned.key -out selfsigned.crt
@DoZator
DoZator / README.md
Last active December 13, 2022 07:34
Install CloudWatch agent on Ubuntu (setup AWS IAM role for EC2)

Download the Cloudwatch agent

$ wget https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb

Install Cloudwatch agent package

$ sudo dpkg -i -E ./amazon-cloudwatch-agent.deb
@DoZator
DoZator / README.md
Last active July 3, 2023 09:31
Enable Mongodb auth with Docker
  • Run mongodb without auth
  docker run --name mongo_db --cpus="1" -m 2G -e MONGODB_EXTRA_FLAGS='--wiredTigerCacheSizeGB=1' --restart always -v /home/$USER/.mongodata:/data/db -d mongo:3.6
  • Connect to mongodb without auth and create root user
 use admin
@DoZator
DoZator / README.md
Created April 20, 2023 06:13
Write an Ethereum smart contract
  • Install Truffle
    npm install -g truffle
  • Install Ganache

To install ganache globally as cli tool:

@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"
@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 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