console.log
# insert log here
#!/bin/bash | |
set -e | |
set -o pipefail | |
sudo dnf install -y jq fuse fuse-libs | |
curl -sL \ | |
$(curl -s 'https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release' \ | |
| jq -r '.TBA[0].downloads.linux.link') \ |
import socket | |
# patched socket.getfqdn() - see https://github.com/python/cpython/issues/49254 | |
def getfqdn(name=''): | |
"""Get fully qualified domain name from name. | |
An empty argument is interpreted as meaning the local host. | |
""" | |
name = name.strip() | |
if not name or name == '0.0.0.0': | |
name = socket.gethostname() |
# 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 |