Skip to content

Instantly share code, notes, and snippets.

View kbbgl's full-sized avatar

Ko Ga kbbgl

View GitHub Profile
@kbbgl
kbbgl / loc.md
Last active May 7, 2020 17:08
[Erlang cookie location in Windows] #rabbitmq #windows

C:\Windows\system32\config\systemprofile\.erlang.cookie

If there are any authentication issues when running rabbitmqctl, copy cookie from above to %USERPROFILE%.

@kbbgl
kbbgl / remcmd.ps1
Created May 7, 2020 17:07
[Windows | run remote commands] #windows #remote
# Enable remoting on server where RPC will run in
Enable-PSRemoting -Force
# Check if WinRM is running on remote server
Test-WsMan QUERY_NODE1_HOSTNAME
$username = "corp\myuser"
$password = ConvertTo-SecureString -String "mypswd" -AsPlainText -Force
$cred = [pscredential]::new($username,$password)
@kbbgl
kbbgl / nslookup.sh
Created May 7, 2020 17:05
[check hostname resolution] #it #network
nslookup HOSTNAME
@kbbgl
kbbgl / gulpTasks.sh
Created May 7, 2020 17:05
[gulpjs list tasks] #gulp #gulpjs #node #nodejs
node gulp.js --tasks
@kbbgl
kbbgl / dict.md
Last active May 20, 2020 13:28
[ec logs dictionary] List of useful texts to look in ec logs #sisense #logs #ec #build

Custom table start

"starting to write N custom columns for table"

Custom table end

"finished writing 1 custom column for table"

Start build

"StartBuild"

Starting of copy

@kbbgl
kbbgl / proc_bg.sh
Created May 7, 2020 17:02
[run script in background] #linux #bash
# give executable permissions to script
chmod u+x run_monitoring
# run script in background and get pid for killing to stdout
nohup ./run_monitoring.sh > monitor_metrics.txt 2>&1 &
# save PID to kill
echo $! > save_pid.txt
# to kill process
@kbbgl
kbbgl / a.sh
Last active May 7, 2020 17:06
[Linux | run remote commands] #linux #bash #ssh
ssh -i /path/to/pem.pem user@IP 'df -h'
@kbbgl
kbbgl / a.sh
Created May 7, 2020 17:01
[output regex matches in new line] #bash #grep #regex
echo "12341234444344412354444" | grep -P "4{2,4}?" -o
44
44
44
44
44
@kbbgl
kbbgl / regex.sh
Created May 7, 2020 16:59
[pattern to match string between <>] #regex
(?<=<).*?(?=>)
@kbbgl
kbbgl / a.sh
Created May 7, 2020 16:59
[match character classes] #regex
# Vowels
echo abcdefghijk | grep -e "[aeiou]"
# will find a,e,i
# Range
echo abcdefghijkAC04 | grep -e "[a-zA-D0-9]"
# Negation character ^ - don't match