Skip to content

Instantly share code, notes, and snippets.

View reski-rukmantiyo's full-sized avatar

Reski Rukmantiyo reski-rukmantiyo

View GitHub Profile
@reski-rukmantiyo
reski-rukmantiyo / environment.go
Created January 21, 2021 20:29
Taken Environment Variables Default
/**
* Taken from https://dev.to/craicoverflow/a-no-nonsense-guide-to-environment-variables-in-go-a2f
*/
package tools
import (
"os"
"strconv"
"strings"
@reski-rukmantiyo
reski-rukmantiyo / Install Mosquitto MQTT.txt
Last active August 23, 2021 14:54
Integrasi Zigbee2MQTT to HA
Instalasi
------------------------
sudo mkdir docker-mosquitto
cd docker-mosquitto
sudo mkdir mosquitto
sudo mkdir mosquitto/config/
sudo mkdir mosquitto/data/
sudo mkdir mosquitto/log/
sudo touch mosquitto/config/mosquitto.conf
@reski-rukmantiyo
reski-rukmantiyo / kolla-build-script.sh
Last active November 29, 2020 13:34
Kolla Ansible Script
kolla-build -b ubuntu --push --registry 192.168.31.27:5000 --tag ussuri -t binary keystone
#!/bin/bash
echo Update system
apt update -y && apt upgrade -y
echo Stop rsyslog
service rsyslog stop
echo Empty log files
find /var/log/ -type f -exec cp /dev/null {} \;
echo Remove tmp files
rm -rf /tmp/*
rm -rf /var/tmp/*
### Debug a variable
- name: Debug VM info
debug:
msg: "{{info}}"
when: info is defined
### Check apps installed or not
- name: Check if Docker already exists
shell: >
docker -v
##------------------------------
## Applicable on on Ubuntu 18.04
## Never tested on other OS
##------------------------------
#!/bin/bash
sudo apt update -y
sudo apt upgrade -y
sudo apt install software-properties-common -y
sudo apt-add-repository --yes --update ppa:ansible/ansible
#!/bin/bash
images=$(sudo docker images | awk '{print $1":"$2}')
registry_server="192.168.31.27:5000"
for image in $images
do
echo "Image: $image"
sudo docker tag $image $registry_server/$image
sudo docker push $registry_server/$image
sudo docker rmi $registry_server/$image
@reski-rukmantiyo
reski-rukmantiyo / download-docker-compose-amd64.sh
Last active May 4, 2024 04:01
Download and Install Docker Compose
sudo curl -LO https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-linux-x86_64
sudo mv docker-compose-linux-x86_64 docker-compose
sudo mv docker-compose /usr/local/bin/
sudo chmod +x /usr/local/bin/docker-compose
How to Benchmark
------------------------
wget -qO- bench.sh | bash
bash <(wget --no-check-certificate -O - https://raw.github.com/mgutz/vpsbench/master/vpsbench)
@reski-rukmantiyo
reski-rukmantiyo / check-config.sh
Last active December 13, 2021 22:55
Script to Install Docker
curl -L0 https://github.com/moby/moby/blob/master/contrib/check-config.sh > check-config.sh
chmod +x check-config.sh
./check-config.sh