Skip to content

Instantly share code, notes, and snippets.

View kbbgl's full-sized avatar

Ko Ga kbbgl

View GitHub Profile
@kbbgl
kbbgl / timeformatconvert.sh
Last active May 11, 2020 13:48
[replace HH-mm-ss to HH:mm:ss] #regex
# Find time in format 16-58-56:
(\d{2})-(\d{2})-(\d{2}),
# Replace to 16:58:56:
$1:$2:$3,
@kbbgl
kbbgl / untaint.sh
Created May 11, 2020 10:20
[untaint node when NodeWithImpairedVolumes] #kubectl #bash
kubectl taint nodes ip-172-31-192-216.ec2.internal NodeWithImpairedVolumes-
@kbbgl
kbbgl / pods_per_node.sh
Created May 11, 2020 09:34
[pods per node] #bash #kubectl
kubectl get pod -o=custom-columns=NODE:.spec.nodeName,NAME:.metadata.name --all-namespaces
@kbbgl
kbbgl / findfile.sh
Created May 10, 2020 20:56
[full path to file] #linux #bash
readlink -f file
@kbbgl
kbbgl / inline.sh
Last active May 10, 2020 18:12
[inline for look in bash] #bash
#!/bin/bash
# If iplist.txt contains a list of IPs in each line:
# 192.168.1.1
# 192.168.1.2
# ...
# & runs each ping in different thread
for ip in $(cat iplist.txt): do ping $ip & done
@kbbgl
kbbgl / pingOnce.sh
Created May 10, 2020 17:54
[ping only once] #network #bash #hacking
#!/bin/bash
# Ping only once
ping 10.10.10.0 -c 1
@kbbgl
kbbgl / noconsumers.sh
Last active May 8, 2020 09:01
[find queues with 0 consumers] #rabbitmq #grep #bash
grep -E '[[:space:]]0' queue_statusQ*
@kbbgl
kbbgl / net.md
Last active May 7, 2020 21:37
[linux network commands] #linux #pentest #network

List the network interfaces

ifconfig

List the wireless interfaces

iwconfig
@kbbgl
kbbgl / qsconsumers.md
Created May 7, 2020 17:10
[List RabbitMQ queues and consumers]

rabbitmqctl list_queues name consumers

@kbbgl
kbbgl / sn.md
Created May 7, 2020 17:09
[Remove node from RabbitMQ cluster] #rabbitmq

rabbitmqctl forget_cluster_node $node