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 / CodebuildPolicy.json
Created June 10, 2024 08:10
AWS CodeBuild Build Docker Image, push to AWS ECR and deploy to AWS ECS
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
"ecr:BatchCheckLayerAvailability",
"ecr:PutImage",
#!/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 December 31, 2023 17:06
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