console.log
# insert log here
# insert log here
# NetworkManager connection config does not like custom ports for DNS servers | |
# we work around this by using a dispatcher to configure this on up events | |
# change these to your desired configs | |
CONNECTION_ID=wg0 | |
DNS_TARGET=10.10.0.1:5300 | |
DNS_SEARCH_DOMAIN=~testing | |
cat > /etc/NetworkManager/dispatcher.d/99-${CONNECTION_ID}.sh <<EOF | |
#!/usr/bin/env bash |
#!/usr/bin/env bash | |
FNMODE=0 | |
# session fix | |
echo $FNMODE | sudo tee /sys/module/hid_apple/parameters/fnmode | |
# permanent fix | |
# https://ask.fedoraproject.org/t/getting-the-function-keys-to-work-properly-with-a-varmilo-keyboard/11297 | |
echo "options hid_apple fnmode=$FNMODE" | sudo tee /etc/modprobe.d/hid_apple.conf |
#!/usr/bin/env bash | |
# this is not extensively tested, worked for personal use case. | |
# script is intentionally aggressive, use at your own peril :) | |
# reference: https://github.com/Jigsaw-Code/outline-client/issues/648 | |
function uninstall-outline() { | |
set -x | |
sudo systemctl disable --now outline_proxy_controller |
PULL_ID=3147 | |
PYTHON_VERSION=${PYTHON_VERSION:-3.8} | |
podman run --rm -i --entrypoint bash python:${PYTHON_VERSION} <<EOF | |
set -e | |
python -m pip install -q git+https://github.com/python-poetry/poetry.git@refs/pull/${PULL_ID}/head | |
python -m poetry new foobar | |
pushd foobar | |
sed -i /pytest/d pyproject.toml | |
python -m poetry add pycowsay |
-- https://stackoverflow.com/a/45244285 | |
CREATE OR REPLACE FUNCTION public.jsonb_array_to_text_array( | |
JSONB | |
) RETURNS TEXT[] AS | |
$f$ | |
SELECT array_agg(x::TEXT) FROM jsonb_array_elements($1) t(x); | |
$f$ | |
LANGUAGE sql | |
IMMUTABLE; |
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) | |
ROOT_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH))) | |
BASH_ENV := $(ROOT_DIR)/.bashrc | |
export BASH_ENV | |
SHELL := $(shell which bash) -e |
-- original source: https://medium.com/adhawk-engineering/using-postgresql-to-generate-slugs-5ec9dd759e88 | |
-- https://www.postgresql.org/docs/9.6/unaccent.html | |
CREATE EXTENSION IF NOT EXISTS unaccent; | |
-- create the function in the public schema | |
CREATE OR REPLACE FUNCTION public.slugify( | |
v TEXT | |
) RETURNS TEXT | |
LANGUAGE plpgsql |
#!/usr/bin/env bash | |
# This script lists all blobs in all containers in all storage accounts of a specified resource group | |
for storageAccount in `az storage account list -g ${1} | jq -r '.[] | .name'`; do | |
for containerName in `az storage container list --account-name ${storageAccount} | jq -r '.[] | .name'`; do | |
blobName=`az storage blob list -c ${containerName} --account-name ${storageAccount} | jq -r '.[] | .name'` | |
[[ ! -z "${blobName}" ]] && echo "${storageAccount}/${containerName}/${blobName}" | |
done | |
done |
#!/usr/bin/env bash | |
# Reference: https://github.com/nagygergo/jetbrains-toolbox-install/blob/master/jetbrains-toolbox.sh | |
# Note that we grep for linux here, if you are using this on mac/windows please see json output | |
TOOLBOX_URL=$(curl --silent 'https://data.services.jetbrains.com//products/releases?code=TBA&latest=true&type=release' \ | |
-H 'Origin: https://www.jetbrains.com' \ | |
-H 'Accept-Encoding: gzip, deflate, br' \ | |
-H 'Accept-Language: en-US,en;q=0.8' \ | |
-H 'Accept: application/json, text/javascript, */*; q=0.01' \ | |
-H 'Referer: https://www.jetbrains.com/toolbox/download/' \ |