Skip to content

Instantly share code, notes, and snippets.

View utarn's full-sized avatar

Utharn Buranasaksee utarn

View GitHub Profile
@utarn
utarn / firewallcmd-multiport.conf
Created February 7, 2018 23:12
Permanently Ban previously banned IP using Fail2ban with firwallcmd multiport
# Fail2Ban configuration file
#
# Author: Donald Yandt
# Because of the --remove-rules in stop this action requires firewalld-0.3.8+
[INCLUDES]
before = firewallcmd-common.conf
[Definition]
@utarn
utarn / failover-WLAN.bat
Last active May 17, 2018 01:05
Windows Batch Script for Switching between two SSID if one is failed (Change Leelawadee-Secure and TP-Link_OOH)
@echo off
set ipcheck="google.com"
set wifi1="Leelawadee-Secure"
set wifi2="TP-Link_OOH"
echo Check Internet Connection
ping -n 1 %ipcheck% | find "TTL" > nul
if %errorlevel% == 0 goto finish
@utarn
utarn / failover.vbs
Created May 17, 2018 00:57
Run failover.bat without window
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & ".\failover.bat" & Chr(34), 0
Set WshShell = Nothing
@utarn
utarn / failover-LAN-WLAN.bat
Created May 17, 2018 01:09
Windows Batch Script for Switching between two SSID if one is failed (Change Leelawadee-Secure and TP-Link_OOH)
@echo off
set ipcheck="google.com"
set lan_gateway="192.168.2.1"
set wlan_gateway="192.168.1.1"
set wifi="TP-Link_OOH"
echo Check Internet Connection
ping -n 1 %ipcheck% | find "TTL" > nul
if %errorlevel% == 0 goto finish
param(
[Parameter(Mandatory=$false)]
[Array]$NicehashWallet = ("3L32PcgfiBEsySLrJpJWYN2thjm2NNGBt2"),
[Parameter(Mandatory=$false)]
[Array]$AhashWallet,
[Parameter(Mandatory=$false)]
[Array]$PhiPhiWallet,
[Parameter(Mandatory=$false)]
[Array]$ZpoolWallet = ("3G1RpD6mumCf2Hgo6h78WSn41ALA1432c5"),
[Parameter(Mandatory=$false)]
@utarn
utarn / Profit.ps1
Last active October 14, 2018 12:19
Powershell script to compare Nicehash/Zergpool
# แก้ตรงบริเวณที่ใส่ตัวเลข
param(
[Parameter(Mandatory=$false)]
[Array]$Algo = (8,14,32,24,20,30,31,33),
[Parameter(Mandatory=$false)]
[Array]$Power = (11.5,400,32,4.2,178,5.4,5.8,150),
# Hashrate for Neoscrypt MH/s, Lyra2REv2 MH/s, Lyra2Z MH/s, Equihash KSol/s, Ethash MH/s, CryptoNightV7 GH/s, CryptoNightHeavy GH/s
# 1 แก้แรงขุด ถ้าไม่มีใส่ 0
[Parameter(Mandatory=$false)]
@utarn
utarn / disable-debugger.html
Created August 22, 2018 15:47
Disable Browser Debugger
<html>
<head>
</head>
<body>
<script type='text/javascript'>
function t() {
try {
// ESP8266-12E ArduCAM Mini Camera Server
//
// This program demonstrates using an ArduCAM Mini 2MP camera with an ESP8266-12E module.
// An OV2640 2MP ArduCAM Mini was used with this program.
//
// The program has a web interface that will allow:
// - storing and viewing of captured jpg files
// - viewing live streamed video
// - changing the resolution
//
@utarn
utarn / clone.sh
Created December 19, 2018 04:59
CLOUD COMPUTING CLASS: Script to bulk add CentOS7
for i in $(seq -w $1 $2)
do
num=$(printf %02d $i)
cd /vmfs/volumes/datastore1/CentOS7-Template
echo "Find the latest disk image"
lastDisk=`ls -t *.vmdk | grep -v sesparse | head -1`
echo -e $lastDisk
cd /vmfs/volumes/datastore1
mkdir -p CentOS7-$num
echo -e "Creating disk for CentOS7-$num"
@utarn
utarn / start.sh
Last active December 19, 2018 05:01
CLOUD COMPUTING CLASS: script to bulk start
for i in $(seq -w $1 $2)
do
num=$(printf %02d $i)
VMID=`vim-cmd vmsvc/getallvms |grep CentOS7-$num | cut -f1 -d' '`
vim-cmd vmsvc/power.on $VMID
done