Skip to content

Instantly share code, notes, and snippets.

View denzfarid's full-sized avatar
:shipit:
On vacation

denzfarid denzfarid

:shipit:
On vacation
  • Rndc
  • Indonesia , Jakarta
View GitHub Profile
FROM golang:1.23.0-bookworm AS build
ARG upx_version=4.2.4
RUN apt-get update && apt-get install -y --no-install-recommends xz-utils && \
curl -Ls https://github.com/upx/upx/releases/download/v${upx_version}/upx-${upx_version}-amd64_linux.tar.xz -o - | tar xvJf - -C /tmp && \
cp /tmp/upx-${upx_version}-amd64_linux/upx /usr/local/bin/ && \
chmod +x /usr/local/bin/upx && \
apt-get remove -y xz-utils && \
rm -rf /var/lib/apt/lists/*
@denzfarid
denzfarid / cloud-config.yml
Created February 22, 2022 21:35
[AWS EFS Cloud-Config] Mount an Elastic Filesystem on CoreOS #coreos #aws #efs #cloud-config
#cloud-config
write_files:
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
OPTS_RPC_MOUNTD=""
coreos:
units:
- name: rpc-statd.service
command: start
@denzfarid
denzfarid / coreos-efs-cloud-config
Created February 22, 2022 21:35 — forked from kgorskowski/coreos-efs-cloud-config
coreos cloud-config file for dynamically mount aws efs in the right availability zone
#cloud-config
write-files:
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
OPTS_RPC_MOUNTD=""
users:
- name: XYZ
groups:
#!/bin/bash
echo ECS_CLUSTER=your_ecs_cluser_name > /etc/ecs/ecs.config
INSTANCE=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
hostname $INSTANCE
sed -i.bak "s/\\(HOSTNAME=\\).*/\\1$INSTANCE/" /etc/sysconfig/network
# https://aws.amazon.com/blogs/compute/using-amazon-efs-to-persist-data-from-amazon-ecs-containers/
yum -y install jq
@denzfarid
denzfarid / unused-amis.sh
Created January 12, 2017 01:23 — forked from ashb/unused-amis.sh
Find un-used AMIs
#!/bin/bash -e
set -o pipefail
# File 1 is the list of our AMIs
# File 2 is the list of AMIs used by our instances
# Column 1 is an image of ours that is not in use
# Column 2 is an AMI that is in use that isn't one of ours
# Column 3 is the list of our AMIs that are in use.
comm -23 \
@denzfarid
denzfarid / delete-ami
Created January 12, 2017 00:29 — forked from elasticdog/delete-ami
Deregister an Amazon Machine Image (AMI) and delete its corresponding root device snapshot
#!/usr/bin/env bash
#
# delete-ami
#
# A script to deregister an Amazon Machine Image (AMI) and
# delete its corresponding root device snapshot.
#
##### Functions