Skip to content

Instantly share code, notes, and snippets.

View azmankudus's full-sized avatar
🎯
Focusing

Azman Kudus azmankudus

🎯
Focusing
View GitHub Profile
@azmankudus
azmankudus / Vagrantfile
Last active August 15, 2021 21:29
Vagrant base to spawn a cluster
require 'date'
require_relative 'vagrant_utils'
CLUSTER_NAME = "cluster"
MANAGER_COUNT = 2
MANAGER_PREFIX = 'manager'
MANAGER_BOX = 'almalinux/8'
MANAGER_CPU = '2'
MANAGER_RAM = '4096'
@azmankudus
azmankudus / putty.txt
Last active August 3, 2021 03:26
SSH Tunnel / Port Forwarding
1. Run PuTTY
2. Go to "Connection" -> "SSH" -> "Tunnels"
3. Enter "Source Port" with local port number. e.g.: 10022
4. Enter "Destination" with remote IP address and port number. e.g.: 192.168.101.101:22
5. Click "Add"
6. Go to "Session"
7. Enter "Host Name (or IP address)" with remote intermediary server host/IP. e.g.: 192.168.100.100
8. Enter "Port" with remote intermediary server port. e.g.: 22
9. Click "Open"
10. Enter username
@azmankudus
azmankudus / 00-readme.txt
Last active July 28, 2021 03:55
Oracle Weblogic Server Silent Installation
# install
java -jar wls_121200.jar -silent -invPtrLoc /tmp/01-inventory.loc -responseFile /tmp/02-isntall.resp
@azmankudus
azmankudus / logger.sh
Last active July 18, 2021 08:25
Shell logger
#!/bin/bash
LOG_LEVEL=$LOG_LEVEL
LOG_FILE=$LOG_FILE
if [ "$LOG_LEVEL" == "" ]
then
LOG_LEVEL=2
fi
@azmankudus
azmankudus / Vagrantfile
Last active July 5, 2021 08:02
Vagrant sample (VirtualBox, X11). Provision with Shell/Ansible
require 'date'
$HOSTNAME = "alma8"
$IMAGE_NAME = "almalinux/8"
$BOX_IP = "192.168.100.10/24"
$BOX_CPU = "2"
$BOX_RAM = "4096" # in megabytes
$PORT_FORWARD = Hash[ # host port => guest port
"8080" => "8080"
@azmankudus
azmankudus / setup.sh
Last active January 27, 2021 13:45
x11vnc ubuntu
sudo apt install x11vnc net-tools -y
x11vnc -storepasswd
vi /etc/systemd/system/x11vnc.service
sudo systemctl daemon-reload
sudo systemctl enable x11vnc
sudo systemctl start x11vnc
@azmankudus
azmankudus / create.sh
Last active January 27, 2021 01:51
ReactJS sample
npm install -g yarn
yarn create react-app hello-react
cd hello-react
vi package.json
##################################################
"dependencies": {
"react": "^16.14.0",
"react-dom": "^16.14.0",
@azmankudus
azmankudus / keytool-selfsign.sh
Last active November 17, 2020 18:06
Create Self Sign Certificate (EC/RSA) using Java Keytool
keytool -genkeypair -alias keypair01 -keyalg rsa -keysize 4096 -validity 36500 -keystore local_host.p12 -storetype pkcs12 -storepass password -dname "C=MY, ST=Kuala Lumpur, L=Kuala Lumpur, O=Local Host, OU=IT, CN=local.host" -ext "eku=serverAuth" -ext "ku=digitalSignature,keyEncipherment" -ext "san=dns:local.host"
keytool -genkeypair -alias keypair02 -keyalg ec -keysize 521 -validity 36500 -keystore local_host.p12 -storetype pkcs12 -storepass password -dname "C=MY, ST=Kuala Lumpur, L=Kuala Lumpur, O=Local Host, OU=IT, CN=local.host" -ext "eku=serverAuth" -ext "ku=digitalSignature,keyEncipherment" -ext "san=dns:local.host"
keytool -importkeystore -srckeystore local_host.p12 -srcstorepass password -srcalias keypair01 -destkeystore local_host-keypair01.p12 -deststoretype pkcs12 -deststorepass password -destalias keypair01 -noprompt
openssl pkcs12 -in local_host-keypair01.p12 -out local_host-keypair01.key -nocerts
openssl pkcs12 -in local_host-keypair01.p12 -out local_host-keypair01.crt -nokeys
@azmankudus
azmankudus / 01-banner.sh
Last active June 13, 2021 04:24
Print info after login (/etc/profile.d)
#!/bin/sh
echo
echo "************************************************************************"
echo " _ _ ____ ____ _ _"
echo " / \ _ _ / \ _ __ ___ / ___| ___ | _ \ ___| \ | | __ _"
echo " / _ \| | | | / _ \ | '_ \` _ \| | _ / _ \| |_) / _ \ \| |/ _\` |"
echo " / ___ \ |_| |/ ___ \| | | | | | |_| | (_) | _ < __/ |\ | (_| |"
echo " /_/ \_\__, /_/ \_\_| |_| |_|\____|\___/|_| \_\___|_| \_|\__, |"
echo " |___/ |___/"
@azmankudus
azmankudus / build.gradle
Created October 19, 2020 15:54
Gradle Fat JAR build
plugins {
id 'application'
id 'java'
}
repositories {
mavenCentral()
jcenter()
}