Skip to content

Instantly share code, notes, and snippets.

View taufiqpsumarna's full-sized avatar
🏠
Work From Home

Taufiq Permana taufiqpsumarna

🏠
Work From Home
View GitHub Profile
@taufiqpsumarna
taufiqpsumarna / README.md
Last active August 29, 2022 09:24
Docker Mongodump Upload To S3 Automated Script & Mongorestore

Mongodump

docker exec <container_name> sh -c 'mongodump --authenticationDatabase admin -u <DB_USER> -p <DB_PASS> --db <DB_NAME> --archive' > /home/ubuntu/db.dump

Mongorestore

Rename file to db.dump than execute this command

docker exec -i sh -c 'mongorestore --authenticationDatabase admin -u -p --db --archive' < /home/ubuntu/db.dump

@taufiqpsumarna
taufiqpsumarna / .env
Last active September 6, 2022 02:27
Vaultwarden Docker Compose
#Apps Setting
WEBSOCKET_ENABLED=true
LOG_FILE=./vw-data/log
LOG_LEVEL=Info
## Web vault settings
WEB_VAULT_FOLDER=./vw-data/web-vault/
WEB_VAULT_ENABLED=true
#Signup Rule
@taufiqpsumarna
taufiqpsumarna / .gitlab-ci.yaml
Last active August 29, 2022 08:13
Gitlab Pipeline Remote SSH To Server Staging Auto Deploy & Production Manual Deploy
#Pipeline Created by Taufiq - 2022
image: alpine:latest
stages:
- build-server-stg
- deploy-server-stg
- build-server-prd
- deploy-server-prd
################################################
#Staging pipeline configuration : Auto Deployment
@taufiqpsumarna
taufiqpsumarna / README.md
Last active August 29, 2022 09:23
Simple Bashscript For Checking and Starting PM2 Process Automatically

Created By Taufiq - 2022

This simple script will check your PM2 process, if there existing PM2 it will stop the process and delete the process then start new PM2 process

install npm PM2 as user or globally

npm install pm2
npm install -g pm2
@taufiqpsumarna
taufiqpsumarna / nginx.conf
Created August 30, 2022 03:30 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@taufiqpsumarna
taufiqpsumarna / .gitlab-ci.yaml
Last active April 13, 2023 08:51
Mini Project: Gitlab CI/CD Pipeline For React Application | Part2
image: node:alpine3.17
stages:
- Build
- Test
- Deploy
variables:
SERVER_WEB_PATH: /var/www/apps/
@taufiqpsumarna
taufiqpsumarna / README.md
Last active September 24, 2024 18:34
Code Server Docker Compose File - Run VS Code on any machine anywhere and access it through the browser.

Code Server Docker Compose File

Run VS Code on any machine anywhere and access it through the browser.

Code anywhere: Code on your Chromebook, tablet, and laptop with a consistent dev environment. Develop on a Linux machine and pick up from any device with a web browser. Server-powered: Take advantage of large cloud servers to speed up tests, compilations, downloads, and more. Preserve battery life when you're on the go since all intensive tasks runs on your server. Make use of a spare computer you have lying around and turn it into a full development environment. See https://github.com/cdr/code-server for more docs.

Dockerhub: https://hub.docker.com/r/codercom/code-server

@taufiqpsumarna
taufiqpsumarna / clear-docker-cache.sh
Last active April 26, 2024 08:23
Used to cleanup unused docker containers and volumes in Gitlab Runner
#!/usr/bin/env bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
#########################################################################################
# SCRIPT: clear-docker-cache.sh
# Description: Used to cleanup unused docker containers and volumes
# Source: https://gitlab.com/gitlab-org/gitlab-runner/blob/main/packaging/root/usr/share/gitlab-runner/clear-docker-cache
######################################################################################
IFS=$'\n\t'
set -euo pipefail
@taufiqpsumarna
taufiqpsumarna / eks-admin.json
Last active November 24, 2023 02:37
AWS IAM Policies for provisioning EKS Cluster using terraform
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:*",
"eks:*",
"elasticloadbalancing:*",