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
# Encoding file | |
perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' < file | |
# Decoding file | |
perl -MMIME::Base64 -ne 'print decode_base64($_)' < file.b64 | |
# HMAC-SHA1 | |
perl -MDigest::HMAC_SHA1 -le '$_=Digest::HMAC_SHA1->new($ARGV[0])->add($ARGV[1])->b64digest; $_.="=" x length % 4; print' TestKey TestString |
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
# udev | |
wget https://gist.githubusercontent.com/dex4er/1354710/raw/0f9738c7439cdfb9e4446663d137f91ee153b4d8/etc_udev_rules.d_90-hid-eToken.rules | |
sudo cp etc_udev_rules.d_90-hid-eToken.rules /etc/udev/rules.d | |
sudo service udev reload | |
# required packages | |
sudo apt-get -yy install pcscd opensc | |
# legacy library | |
wget http://mirrors.kernel.org/ubuntu/pool/universe/h/hal/libhal1_0.5.14-8_amd64.deb |
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 | |
## ssm | |
## | |
## Copyright (c) 2023 Piotr Roszatycki <piotr.roszatycki@gmail.com>, MIT | |
set -e | |
if ! command -v aws >/dev/null; then | |
echo "Needs aws command." |
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
#!/bin/bash | |
set -euo pipefail | |
shopt -s inherit_errexit 2>/dev/null || true | |
prefix=${prefix:-} | |
operation=${operation:-=} | |
while true; do | |
kubectl get node -L node.kubernetes.io/instance-type,eks.amazonaws.com/nodegroup,karpenter.sh/provisioner-name | |
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 | |
FILE="$1" | |
if [[ -z $FILE ]]; then | |
echo "$0 run-XXX.mocks.tar.gz" | |
exit 1 | |
fi | |
if command -v colordiff >/dev/null; 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 bash | |
## gitlab_clone_all.sh | |
## | |
## Copyright (c) 2023 Piotr Roszatycki <piotr.roszatycki@gmail.com>, MIT | |
## | |
## Requires curl and jq | |
GROUP_NAME="$1" | |
shift |
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
#!/bin/bash | |
trap 'rm -rf terraform.tfplan' EXIT | |
trap '' INT | |
function filter_manifest_short() { | |
grep --line-buffered -v -P '\(known after apply\)|\(\d+ unchanged \w+ hidden\)' | |
} | |
function filter_manifest_compact() { |
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
#!/bin/bash | |
if [ -z "$1" ]; then | |
gcloud compute images list --project $PROJECT | |
else | |
gcloud compute images export --project $PROJECT \ | |
--async \ | |
--image "$1" \ | |
--destination-uri "gs://$BUCKET/$1.vmdk" \ | |
--export-format=vmdk \ |
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
git filter-branch --index-filter "cp $PWD/.gitattributes . && git add .gitattributes" --tag-name-filter cat --prune-empty -- --all |
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
# Extracts mpeg files. | |
# Depends on avconv | |
4 string ftypisom | |
extension mp4 | |
command dd of="$1.tmp" bs=1024k count=40; avconv -i "$1.tmp" -c:v copy "$1"; rm -f "$1.tmp" | |
min_output_file 102400 |
NewerOlder