This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# get-total-pulls.sh | |
# ------------------------------------------------------------------------------ | |
# | |
# DESCRIPTION: | |
# Gets the total pulls for a dockerhub repo. | |
# This script iterates the image-list file and outputs a report. | |
# | |
# INPUT FILE: | |
# The input file is a list of docker images - one per line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prints a section header. | |
# | |
# Features | |
# - Autosizes to terminal if $width -gt $COLUMNS | |
# - Specifying width as 4000 works... | |
# - Adjust first two sanities for stricter usage | |
# * Currently sets width to half terminal width | |
# * Currently rounds down odd to even width automatically | |
# - Customizable outside and inside fill characters | |
# - Nofill style option |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
cat << EOF > epochInµsec.c | |
#include <stdio.h> | |
#include <sys/time.h> | |
__asm__(".symver realpath,realpath@GLIBC_2.0"); | |
int main(void) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# timestamp-helper.sh | |
# ------------------------------------------------------------------------------ | |
# Command perfs observed on localhost. | |
# date : ~0.001-0.002s | |
# gdate : unknown | |
# python : ~0.015-0.030s | |
# c : ~0.025-0.049s | |
# this.sh : ~0.005-0.015s (with date, so + ~0.004-0.013s) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# genMockData.sh | |
# ------------------------------------------------------------------------------ | |
# Gets some free sample data from: https://www.briandunning.com/sample-data/, | |
# Extracts Transformas and Loads the data. (ETL in BASH...) | |
# regions: us, ca, uk, au | |
region=${1:-ca} # ca (default), us, uk, au - supply as arg1 | |
size=500 # 500 sample size is free | |
file="${region}-${size}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# ts-helper.sh | |
# ------------------------------------------------------------------------------ | |
# This is a demo of how to get aligned timestamps across any OS with python in | |
# the $PATH. | |
# ------------------------------------------------------------------------------ | |
function ts() { | |
local s_int=$(date +'%s') | |
local s_len=${#s_int} | |
local sns=$(python -c 'import time; print(int(time.time_ns()))') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HTOP Weather Overlay | |
# NOTES: | |
# - STOP! Not a script. | |
# - Add to ~/.bashrc or similar. | |
# - Refreshes the weather "overlay" every ~10s | |
# - Pulls from wttr.in ONLY every 300s (5m) | |
# - has a kill-htop-weather command to break the while loop if needed | |
# | |
# Requires an empty space in the htop meters setup to be added. | |
# Recommended Meters layout (F2): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Include simple dependnecy checks for aliases. | |
# Set aliases only if dependnecy is available. | |
# An IF statement may makes more sense... | |
dep='xclip' | |
[[ ! $(command -v $dep) ]] && echo -e "\e[01;31mERROR:\e[0m ${BASH_SOURCE[0]} - $dep not available!" | |
[[ $(command -v $dep) ]] && alias clipc="xclip -selection c" | |
[[ $(command -v $dep) ]] && alias clipp="xclip -selection c -o" | |
[[ $(command -v $dep) ]] && alias clipv="clipp | less" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ssh-key_rounds-benchmark.sh | |
# ------------------------------------------------------------------------------ | |
# Tests ed25519 performance. | |
# | |
# Usage: | |
# ./ssh-key_rounds-benchmark.sh | |
# ./ssh-key_rounds-benchmark.sh <type> <passphrase length> <sample size> | |
# ./ssh-key_rounds-benchmark.sh ed25519 32 10 | |
# Original work by Luc in this stackexchange answer: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# A simple hello world script for testing the handling of remote scripts. | |
# HINT: Hit the 'Raw' button at the top-right to get the url for this script. It changes with every edit. | |
# source <(curl -s <url>) | |
# bash <(curl -s <url>) | |
echo 'Hello World!' | |
shopt -s expand_aliases |
OlderNewer