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 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
#!/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
#!/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 | |
shell=$(awk -F/ '{print $NF}'<<<$SHELL) | |
# Detect target rc file. | |
[[ -f $HOME/.bash_profile && $shell =~ "bash" ]] && targ="$HOME/.bash_profile" # MacOS Bash | |
[[ -f $HOME/.zshrc && $shell =~ "zsh" ]] && targ="$HOME/.zshrc" # MacOS ZSH | |
[[ -f $HOME/.bashrc && $shell =~ "bash" ]] && targ="$HOME/.bashrc" # Linux | |
if [[ ! -n ${targ+x} ]]; then |
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
# 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
name: Constructed Secrets | |
on: | |
workflow_dispatch: | |
inputs: | |
string: | |
description: "String" | |
required: true | |
secret: | |
description: "Secret" |
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
function os-info () { | |
keys=$@ | |
function help () { | |
echo -e "Try: NAME, PRETTY_NAME, VERSION_ID, VERSION, ID_LIKE" | |
echo -e "REF: https://www.freedesktop.org/software/systemd/man/os-release.html" | |
return 0 | |
} | |
[[ $keys == '-h' ]] && help | |
[[ $# -eq 0 ]] && help | |
for key in "$@"; do |
OlderNewer