Skip to content

Instantly share code, notes, and snippets.

@ronald
ronald / check_net.rb
Last active June 6, 2019 11:44
simple script for checking network stabilty by using curl http requests
#!/usr/bin/env ruby
# simple script for checking network stabilty
# cron me like:
# */15 * * * * ruby /home/user/check_net.rb URL >> /home/user/check_net.log
# set URL to https://... to check dns resolution, tls handshake and http request at once
# output
# <public-ip-of-checking-host>/<reverse-ip-lookup-of-checking-host>/<time>/status
@ronald
ronald / sshpod.sh
Last active September 11, 2018 10:15
sshpod - shell function to access kubernetes pod
# add to .bashrc or .bash_profile
# usage:
# sshpod <podlabel>
# sshpod <podlabel> --namespace=<namespace>
sshpod() {
POD_NAME=$(kubectl get pods --selector "app=$1" -o jsonpath="{.items[0].metadata.name}" $2)
kubectl exec -it $POD_NAME /bin/bash
}
class Rort1 < RTanque::Bot::Brain
include RTanque::Bot::BrainHelper
NAME = self.to_s
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 15.0
WALL_DETECTION_DISTANCE = 50
def tick!
check_hit!
@friendly_fire = true if sensors.button_down?('f')