Skip to content

Instantly share code, notes, and snippets.

Still Learning

Gilang Virga Perdana gilangvperdana

Still Learning
View GitHub Profile
gilangvperdana /
Created February 22, 2023 06:57 — forked from romach/
Run Ubuntu in docker container
# run with connected bash with closing after exit
docker run -it --rm --name ubuntu ubuntu:18.04 /bin/bash
# run in detached mode
docker run -id --name ubuntu ubuntu:18.04
docker exec -it ubuntu /bin/bash
# run in detached mode with mounted directories
docker run -v /dir-on-host:/dir-in-container -id --name ubuntu ubuntu:18.04
docker exec -it ubuntu /bin/bash
gilangvperdana /
Last active February 22, 2023 02:17 — forked from thomasn/
Fix ssh error : SSH2_MSG_KEX_ECDH_REPLY


I once had a problem with an instance running on Openstack, namely that it could not ssh to other nodes, but other nodes could ssh to the said node. It turns out that this is because the MTU is different at the instance or at the server host level, please check the MTU again on each interface related to openstack's neutron external.

From some machines (with latest openssh) ssh to muddy fails -

  • ssh -vvv -p $MUDDYPORT $MUDDYIP
  • hangs at expecting SSH2_MSG_KEX_ECDH_REPLY

Quick Check

ping node2 -c 8000
gilangvperdana /
Created February 12, 2023 12:09 — forked from 1hakr/
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
gilangvperdana /
Created February 5, 2023 18:29 — forked from robsonke/
This Bash script will loop through all running docker containers on a host and list the disk usage per mount. In case it's breaching the 65%, it will email you.
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
# loop through all containers
for container in $containers
echo "Container: $container"
gilangvperdana /
Created February 5, 2023 18:26 — forked from ekristen/
Bash Script for Nagios to Check Status of Docker Container
# Author: Erik Kristensen
# Email:
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./ _container_id_
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
gilangvperdana /
Created January 2, 2023 17:37 — forked from sethwebster/
Creating a PEM for HaProxy from GoDaddy SSL Certificate

GoDaddy SSL Certificates PEM Creation for HaProxy (Ubuntu 14.04)

1 Acquire your SSL Certificate

Generate your CSR This generates a unique private key, skip this if you already have one.

sudo openssl genrsa -out  etc/ssl/ 1024

Next generate your CSR (Certificate Signing Request), required by GoDaddy:

gilangvperdana / backup-and-restore.rst
Created December 31, 2022 07:10 — forked from yankcrime/backup-and-restore.rst
Kolla-Ansible Backup and Restore
View backup-and-restore.rst

Backup and Restore of MariaDB

Kolla can facilitate either full or incremental backups of data hosted in MariaDB. It achieves this using Percona's Xtrabackup, a tool designed with hot backups in mind - an approach which means that consistent backups can be taken without any downtime for your cloud.

gilangvperdana /
Created October 10, 2022 03:13 — forked from dfedorov-ciena/
List of things for hardening Ubuntu

System Updates

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
gilangvperdana / manifests.yaml
Created September 20, 2022 02:37 — forked from tapih/manifests.yaml
Loki manifests
View manifests.yaml
apiVersion: v1
kind: Namespace
name: loki-stack
apiVersion: apps/v1
kind: StatefulSet
name: loki
namespace: loki-stack