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
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
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
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
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
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 / 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
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 / README.md
Created May 20, 2021 09:34
Golang modules

Creating a Go module

Inside our project directory, we're going to initialize our project as a Go module.

$ go mod init github.com/DoZator/my-new-project

Directly adding dependency to the go.mod file

@DoZator
DoZator / README.md
Created May 3, 2019 08:21
Saver docker image as a tar file

Saver docker image as a tar file

docker save -o <path_for_tar_file> <image_name>

Load the image into Docker

docker load -i 
@DoZator
DoZator / README.md
Created April 18, 2019 08:51
Using Amazon ECR

ECR Container Repository

Create repository

aws ecr create-repository --repository-name myproject/appname

Delete repository