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
#!/bin/bash
echo "Update repository and upgrade package"
apt update && apt upgrade -y
echo "Install Docker Package"
curl -fsSLv https://releases.rancher.com/install-docker/24.0.9.sh | sudo bash
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
@taufiqpsumarna
taufiqpsumarna / config.toml
Last active December 20, 2023 01:58
Gitlab Runner Config EC2Machine
concurrent = 4
check_interval = 0
[[runners]]
name = "gitlab-runner-autoscaler"
url = "https://gitlab.com" #TODO_1: Change with your gitlab repository URL
token = "" #TODO_2: Fill with your Gitlab Token
executor = "docker+machine"
limit = 4
[runners.docker]
@taufiqpsumarna
taufiqpsumarna / install_gitlab_runner_manager.sh
Last active December 13, 2023 06:37
How to optimize GitLab runner cost usage and saving cost up to 90% using spot instance | Install Docker Engine and Gitlab Runner Config
#!/bin/bash
echo "Update repository and upgrade package"
apt update && apt upgrade -y
echo "Install Docker Package"
curl -fsSLv https://releases.rancher.com/install-docker/20.10.24.sh | sudo bash
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
@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:*",
@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 / 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 / .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 / 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 / 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