View covid-vaccine-scheduling-check.sh
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 | |
while true | |
do | |
RESP="$(curl -fsS 'https://covid19.min-saude.pt/pedido-de-agendamento' \ | |
-H 'Connection: keep-alive' \ | |
-H 'Cache-Control: max-age=0' \ | |
-H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"' \ | |
-H 'sec-ch-ua-mobile: ?0' \ | |
-H 'Origin: https://covid19.min-saude.pt' \ |
View nextdns.js
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
// ID of the config, e.g. A1234BCD. | |
const configID = "A1234BCD"; | |
// API key, found at the bottom of your account page in https://my.nextdns.io/account | |
const APIKey = "xxxxxxxxxxxxxxxxxxxxxxxxxx"; | |
// Mark true or false. If true, failed links will be retried 3 times at progressively increasing intervals. | |
// If false, failed links will not be retried. | |
const retryFailedLinks = true; | |
// Time delay between requests in milliseconds. | |
// 800 seems to not give any errors but is rather slow while anything faster will give errors (in limited testing). | |
// If you want to go lower, it is recommended that "retryFailedLinks" is true |
View estimate-costs.sh
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 | |
# Runs https://github.com/antonbabenko/terraform-cost-estimation with sanitization | |
# | |
# Depends on: | |
# - terraform cli >= 0.12 | |
# - curl | |
# - jq >= 1.6 | |
set -eo pipefail |
View Dockerfile
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
FROM oracle/graalvm-ce:20.2.0-java11 | |
# Sourced from: https://docs.oracle.com/en/graalvm/enterprise/20/docs/reference-manual/native-image/StaticImages/ | |
RUN \ | |
# musl | |
curl -fsSL -o musl-1.2.1.tar.gz https://musl.libc.org/releases/musl-1.2.1.tar.gz && \ | |
tar -xvf musl-1.2.1.tar.gz && \ | |
cd musl-1.2.1 && \ | |
./configure --disable-shared --prefix=/usr && \ |
View fix-grub-encrypted.sh
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 | |
# | |
# Sources: | |
# - https://askubuntu.com/questions/844132/how-to-repair-boot-on-luks-encrypted-harddrive | |
# - https://gist.github.com/samuelcolvin/43c5ed2807e7db004b1058d0c9bfb068 | |
# - https://unix.stackexchange.com/questions/178666/sbin-cryptsetup-not-found-on-boot | |
# | |
View CryptoAESGCM.scala
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
import java.security.SecureRandom | |
import cats.Monad | |
import cats.effect.IO | |
import tsec.cipher.symmetric.jca._ | |
import tsec.cipher.symmetric.{AAD, _} | |
import tsec.common._ | |
import scala.util.Random |
View tvi-player-downloader.sh
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 | |
set -eux | |
for SEASON_NUMBER in 1 2; do | |
for EPISODE_NUMBER in 1 2; do | |
EPISODE_URL="http://tviplayer.iol.pt/programa/pesadelo-na-cozinha/58bd77b50cf26a3bdcfca690/episodio/t${SEASON_NUMBER}e${EPISODE_NUMBER}" | |
PLAYLISTS_BY_QUALITY_URLS=$(curl -L $EPISODE_URL 2>/dev/null | grep 'vod/_definst_' | awk -F, '{print $3}' | sed -E 's/"videoUrl":"(.*)"/\1/') | |
youtube-dl -f best --audio-quality 0 -o pesadelo-na-cozinha-S01E0${EPISODE_NUMBER}.ts --prefer-ffmpeg $PLAYLISTS_BY_QUALITY_URLS & |
View docker-api-v2-example.sh
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 | |
# | |
# Simple Docker Registry API v2 Wrapper | |
# | |
REPOSITORY="doplicated/client" | |
get_from_dh() { | |
URL="$1" |
View getopts_long.sh
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 | |
# | |
# getopts_long -- POSIX shell getopts with GNU-style long option support | |
# | |
# Copyright 2005-2009 Stephane Chazelas <stephane_chazelas@yahoo.fr> | |
# | |
# Permission to use, copy, modify, distribute, and sell this software and | |
# its documentation for any purpose is hereby granted without fee, provided | |
# that the above copyright notice appear in all copies and that both that |
View brew-cask-upgrade.sh
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/sh | |
help=0 | |
latest=0 | |
verbose=0 | |
status=0 | |
usage() { | |
cat <<-EOF | |
${0##*/} [options] |
NewerOlder