Skip to content

Instantly share code, notes, and snippets.

View myugan's full-sized avatar
☁️
Working from cloud

Muhammad Yuga N. myugan

☁️
Working from cloud
View GitHub Profile
#!/bin/bash
wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz
tar -xvf go1.14.4.linux-amd64.tar.gz
mv go /usr/local
tee -a ~/.profile << END
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
@myugan
myugan / docker-setup.sh
Last active March 14, 2021 02:16
Setup Docker and Compose on Ubuntu 18.04 machine
#!/bin/bash
# Install dependency
apt install -y apt-transport-https ca-certificates curl software-properties-common
# Add GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Add docker repository to APT sources
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" -y
input {
beats {
port => 5044
}
}
filter {
if [message] =~ /^#/ {
drop { }
}
@myugan
myugan / steghide-extract.sh
Created March 24, 2020 10:22
Extract all hidden files on spesific directory with password using steghide
#!/bin/bash
dir="Stego\ Files"
for i in $dir/*;do
# password list
pass=( "christmastree" "darksky123" "goldenwatch")
for x in "${pass[@]}";do
steghide extract -sf "${i}" -p "${x}" 2>/dev/null
done
@myugan
myugan / autobackup.sh
Last active June 6, 2020 11:24
Bash script for databases daily backup
#!/bin/bash
# CRED
DB_USER="user"
DB_PASS="user"
DB_NAME="dbname"
# PATH/DIR
SRCDIR="/path/to/backups"
EXPDIR="$SRCDIR/$DB_NAME_$(date +"%H%M-%d-%m-%Y").sql"
@myugan
myugan / monitoring.py
Created July 15, 2018 17:28
Python 3 - Simple script to show system info, load avg, cpu, memory, storage and packet data.
#!/usr/bin/env python
import os, platform, subprocess, socket, psutil, netifaces, cpuinfo
#command = "cat /proc/cpuinfo"
#print(subprocess.check_output(command, shell=True).strip())
kb = float(1024)
mb = float(kb ** 2)
gb = float(kb ** 3)