Skip to content

Instantly share code, notes, and snippets.

View alexfornuto's full-sized avatar
🏠
Writing Docs

Alex Fornuto alexfornuto

🏠
Writing Docs
View GitHub Profile
@alexfornuto
alexfornuto / messageServer.sh
Last active February 14, 2024 22:33
Broadcast messages to a Palworld server
#!/bin/bash
#
# messageServer: A simple script to split input and format it for broadcast to
# a Palworld server using ARRCON (https://github.com/radj307/ARRCON).
#
# Author: Alex Fornuto 2024 <[email protected]>
input=$1
# For Debugging
#printf 'You entered: "%s"\n' "$input"
@alexfornuto
alexfornuto / jellycheck.sh
Last active October 27, 2024 03:22
Script to monitor Jellyfin GPU Access
#!/bin/bash
#
# Author: Alex Fornuto <[email protected]>
#
##############################################################
# This script checks if the Jellyfin docker container #
# has access to the GPU, and restarts it if not. it #
# assumes an nvidia GPU and the native docker compose plugin #
##############################################################
@alexfornuto
alexfornuto / immersed-config.sh
Created December 1, 2023 22:11
Install Immersed on Pop!_OS
#!/bin/bash
# Immersed on Pop!_OS
###############################################################################
# This script serves as documentation for how I installed Immersed and #
# configured the v42loopback device to load as needed by Immersed for the #
# virtual webcam on my system running Pop!_OS 22.04 LTS. It's provided as a #
# script so that others can read the comments to learn, and modify it as #
# needed to configure their systems automagically after a fresh install. #
<?php
// Important constants :)
$pantheon_yellow = '#EFD01B';
// Default values for parameters - this will assume the channel you define the webhook for.
// The full Slack Message API allows you to specify other channels and enhance the messagge further
// if you like: https://api.slack.com/docs/messages/builder
$defaults = array(
'slack_username' => 'Pantheon-Quicksilver',
@alexfornuto
alexfornuto / try3.sh
Last active May 1, 2020 15:28
A bash function that tries a command 3 times before failing with exit code 1
try3 () {
for ((n=1;n<4;n++)); do
if ! "$@"
then
echo "failed $n times..."
if [[ $n = 3 ]]
then exit 1
fi
sleep 1
else
❯ make
UUID is "[email protected]"
if ! command -v tsc >/dev/null; then \
echo 'You must install TypeScript >= 3.8 to transpile: (node-typescript on Debian systems)'; \
exit 1; \
fi
tsc
tsconfig.json(14,9): error TS5023: Unknown compiler option 'incremental'.
src/active_hint.ts:4:13 - error TS1005: '=' expected.
@alexfornuto
alexfornuto / javascript-query-string.js
Created March 11, 2020 16:32 — forked from DavidWells/javascript-query-string.js
JavaScript :: Regex trick: Parse a query string into an object
// http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
// JavaScript regex trick: Parse a query string into an object
var queryString = {};
anchor.href.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) { queryString[$1] = $3; }
);
// Usage
Drupal 8.7.x sites that have modified the following the `config_sync_directory` value in `settings.php` must update as follows before upgrading to Drupal 8.8.x:
1. Locate:
```php:title=settings.php
$config_directories = array(
CONFIG_SYNC_DIRECTORY => dirname(DRUPAL_ROOT) . '/config',
);
```

Keybase proof

I hereby claim:

  • I am alexfornuto on github.
  • I am alexfornuto (https://keybase.io/alexfornuto) on keybase.
  • I have a public key ASCpRqV7tAq1Zv_Fhzqcr__IE5LnuBeIFCkdwbLaQbL7KQo

To claim this, I am signing this object:

$ ~ $ cd tmp/
$ ~/tmp $ ls
$ ~/tmp $ mkdir rsync-dir
$ ~/tmp $ mkdir not-rsynced
$ ~/tmp $ echo "Derp" > not-rsynced/file.txt
$ ~/tmp $ echo "Herp" > rsync-dir/localfile.txt
$ ~/tmp $ cd rsync-dir/
$ ~/tmp/rsync-dir $ ln -s localfile.txt local-symlink.txt
$ ~/tmp/rsync-dir $ cat local-symlink.txt
Herp