Skip to content

Instantly share code, notes, and snippets.

View linkerd_log_output.md
Timestamp Container Name Pod Name Message
2021-03-03 17:38:00 destination linkerd-destination-77d95c4b9-mx54s time="2021-03-03T17:38:00Z" level=info msg="Stopping watch on endpoint [default/nextcloud-cache:6379]" addr=":8086" component=endpoints-watcher
2021-03-03 17:38:00 destination linkerd-destination-77d95c4b9-mx54s time="2021-03-03T17:38:00Z" level=info msg="Stopping watch on profile default/nextcloud-cache.default.svc.cluster.local" addr=":8086" compo
@tyzbit
tyzbit / bootstrap-ubuntu.sh
Last active Jul 13, 2021
bootstrap-ubuntu-server
View bootstrap-ubuntu.sh
#!/bin/bash
# Install Docker
sudo apt-get update
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
@tyzbit
tyzbit / download-video-from-clipboard.sh
Last active Mar 11, 2021
Download a video from a URL in clipboard automatically (bind to keyboard shortcut) (Mac/Linux)
View download-video-from-clipboard.sh
#!/bin/bash
dir="$HOME/Videos"
opts="--add-metadata --no-mtime"
if [ -f /usr/local/bin/youtube-dl ]; then
youtube_dl="/usr/local/bin/youtube-dl"
else
youtube_dl="$(which youtube-dl)"
fi
@tyzbit
tyzbit / twitcher.cgi
Created Sep 29, 2020
A CGI script to show the top chat messages from IRC logs
View twitcher.cgi
#!/bin/bash
twitchroot="/home/eggdrop/twitcher/logs/"
alllogs=$(echo $twitchroot"*")
logpath="http://qtosw.com/pubfiles/twitchlogs/?C=M;O=D"
echo -e "Content-type: text/html; charset=utf-8\n"
echo "<html><head>"
echo "<meta charset=utf-8>"
echo "<link rel=\"stylesheet\" href=\"style.css\" />"
echo "</head><body>"
#initialize what we have to work with
@tyzbit
tyzbit / rprompt.zsh
Last active May 27, 2021
zsh RPROMPT with execution time and current time on the right hand side
View rprompt.zsh
# refreshes the prompt every $TMOUT seconds
TMOUT=15
function preexec() {
timer=$(($(date +%s%0N)/1000000))
}
function precmd() {
if [ $timer ]; then
now=$(($(date +%s%0N)/1000000))
View colorify.zsh
function colorify() {
#number=$(bc <<< "$(echo ${1} | od -An -vtu1 -w100000000 | tr -d ' ') % 28 + 1")
#number=$(bc <<< "ibase=16; $(echo ${1} | md5sum | awk '{print $1}'|tr '[[:lower:]]' '[[:upper:]]')" 2> /dev/null)
# md5sum is acceptable here because we don't need a strong hashing algo at all
# we just want the property of hashing algos that a given input always means the same output
hex=$(echo ${1} | md5sum | awk '{print $1}'|tr '[[:lower:]]' '[[:upper:]]')
# removing characters is done because zsh complains about the size of the number
# even though we do this, there's still more than enough 'randomness'
# doing this also ensures the value is positive which is cool
View onboard-to-k8s.sh
#!/bin/bash
## Use this script to configure kubectl for an EKS cluster using a role ARN.
function usage() {
echo "Usage: $0 [Amazon Role ARN]"
}
if [[ -z $1 ]]; then
usage
exit 1
@tyzbit
tyzbit / cache-eks-token.sh
Created Jan 23, 2020
Cache EKS tokens for kubectl
View cache-eks-token.sh
function usage() {
echo "Usage: $0 [region] [cluster name] [role arn]"
echo "If you're not using a role, [region] and [role arn] are optional"
echo "If you just use cluster name, you need aws-iam-authenticator installed"
}
if [ -z $1 ]; then
usage
exit 1
fi
@tyzbit
tyzbit / zoom-mute-status.scpt
Created Sep 14, 2019
Get Zoom Mute/Unmute Status
View zoom-mute-status.scpt
property btnTitle : "Mute audio"
tell application "System Events" to tell application process "zoom.us"
if exists (menu item btnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then
do shell script "echo Unmuted"
else
do shell script "echo Muted"
end if
end tell