Skip to content

Instantly share code, notes, and snippets.

@lyndell
lyndell / parachute.py
Created Mar 4, 2021 — forked from adithyabsk/parachute.py
NASA Perseverance Parachute Code
View parachute.py
"""Python Script to solve the perseverence parachute
code
Output:
DARE¿¿¿¿
MIGHTY¿¿
THINGS¿¿
34°11'58'' N 14°118'10'' W
"""
@lyndell
lyndell / Debug_DaemonSet.yaml
Created Nov 11, 2020
deploy plain Ubuntu image for debugging on all nodes in a Kubernetes cluster
View Debug_DaemonSet.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: debug
spec:
selector:
matchLabels:
name: debug
template:
metadata:
@lyndell
lyndell / OSTYPE test
Last active Jun 13, 2019
test for the OS with the shell environment variable $OSTYPE
View OSTYPE test
#!/bin/bash -x
#
# From: http://stackoverflow.com/questions/394230/detect-the-os-from-a-bash-script
PLATFORM=$(uname)
case "$PLATFORM" in
"Darwin")
# macOS
;;
"Linux")
@lyndell
lyndell / LIFE.BAS
Last active Mar 20, 2018
write life code in tweet
View LIFE.BAS
#!/usr/local/bin/cbmbasic
10 PRINT "eat "
20 PRINT "workout"
30 PRINT "sleep "
40 GOTO 10
@lyndell
lyndell / check_up-time.sh
Last active Feb 12, 2018
check_up-time.sh
View check_up-time.sh
#/bin/bash +x
#
# High dependent on my ssh.config file.
#
LIST="z0h p0h pz0h apih"
LIST="z0 p0 pz0 api"
for I in $LIST
do
#
@lyndell
lyndell / pingtimer.sh
Last active Nov 7, 2017
Monitor network, gathering ping and HTTP headers
View pingtimer.sh
#!/bin/bash
#
# Name: pingtimer.sh
# Desc: Monitor network, gathering ping and HTTP headers
# URL: https://gist.github.com/lyndell/21d7ada9774784b03da1
#
# Author: Lyndell Rottmann
# WWW: http://Lyndell.US
# Copyright (c) 2015 Lyndell Rottmann
#
@lyndell
lyndell / ptr6.sh
Created Mar 6, 2017
Breakdown IPv6 reverse DNS strings
View ptr6.sh
IPv6=$1
host ${IPv6} | awk '{ip = substr($1,1,31); ptr = substr($1,33); printf("Search for zone:\n%s\n\nAdd Name:\n%s\nWith the requested value\n", ptr, ip);}'
@lyndell
lyndell / infinite_ping.sh
Last active Feb 10, 2017
Infinite ping with time stamps
View infinite_ping.sh
#!/bin/bash
set -x
# replace "localhost.example.com" with the domain you may ping.
#
I="localhost.example.com"
while true ; do date; ping -c4 -i10 $I ; echo; done
@lyndell
lyndell / mtr_loop.sh
Last active Aug 2, 2016
repeatedly run MTR
View mtr_loop.sh
#!/bin/bash
#
function quit ()
{
echo -e "\n*** Exiting by user keystroke ***\n"
exit $?
}
# trap keyboard interrupt (control-c)
@lyndell
lyndell / by.sh
Last active Jul 10, 2016
Open a new file in ByWord
View by.sh
#/bin/bash -x
#
# Copyright (c) 2015 Lyndell Rottmann
#
# Debug mode on/off: (default off)
set +x
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ ! $1 ]