Skip to content

Instantly share code, notes, and snippets.

View lstellway's full-sized avatar

Logan Stellway lstellway

View GitHub Profile


⚠️ I have since created lstellway/synology-dev-env to provide a local development environment for Synology via containers. There is an included example for building vim.
 

Compile VIM for Synology NAS

Let me start by saying: this is not a happy story..
This process was a bit painful, and I definitely stumbled through it.
Would love to hear if I missed anything or if anybody has ideas.

Synology provides a package developer guide. I primariliy referenced the prepare environment and your first package sections.

@lstellway
lstellway / shopify-gtm-pixel.js
Last active January 11, 2024 23:27
dime-shopify-gtm-pixel.js
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : "";
j.async = true;
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, "script", "dataLayer", "GTM-5ZDJX4V");
@lstellway
lstellway / dime-order-confirmation.liquid
Last active October 31, 2023 17:43
Shopify - GTM order confirmation
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
{% if first_time_accessed %}
dataLayer.push({
event: "dime_purchase",
ecommerce: {
transaction_id: "{{ order.order_number }}",
value: {{ total_price | times: 0.01 }},
@lstellway
lstellway / macos-change-ssh-port.sh
Last active June 10, 2023 21:49
Change the default SSH port on macOS
# Setup SSH port
SYSTEM_SSH_PLIST="/System/Library/LaunchDaemons/ssh.plist"
ssh_set_port() {
# Ensure a port is specified
if [ -z "$1" ]; then
printf "No port specified...\n"
return 1
fi
@lstellway
lstellway / vin-data.json
Created January 18, 2023 04:08
Example VIN response
{
"Count": 136,
"Message": "Results returned successfully. NOTE: Any missing decoded values should be interpreted as NHTSA does not have data on the specific variable. Missing value should NOT be interpreted as an indication that a feature or technology is unavailable for a vehicle.",
"SearchCriteria": "VIN(s): WVWWF7AUXHW160687",
"Results": [
{
"ABS": "Standard",
"ActiveSafetySysNote": "Park Distance Control (Park Pilot): Standard",
"AdaptiveCruiseControl": "Standard",
"AdaptiveDrivingBeam": "Standard",
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td
style="
border-right: 3px solid #586b59;
vertical-align: middle;
padding: 0;
"
vertical-align="middle"
@lstellway
lstellway / NGINX Config - IP Address JSON
Created January 15, 2021 21:19
Simple NGINX config to return real client IP address
map ":$http_x_forwarded_for" $IP_ADDR {
":" $remote_addr; # Forwarded for not set
default $http_x_forwarded_for; # Forwarded for is set
}
server {
server_name example.com;
listen 80;
listen [::]:80;
@lstellway
lstellway / timer.sh
Last active March 2, 2022 23:41
Shell-based timer for `bash` and `zsh`
# Read a message using the OSX `say` command
#
# In my opinion, the best voices for American English seem to be:
# 'Daniel', 'Karen', 'Rishi', 'Tessa'
export TIMER_COMMAND="say -v Karen --interactive=bold '%s'"
# Hide tty input while command is running
_timer_tty_off() {
[ -t 0 ] && stty -echo -icanon time 0 min 0
}
@lstellway
lstellway / synology-dsm-getcert.sh
Last active February 23, 2022 02:45
Shell utility to help find the certificates used by a specified FQDN on Synology NAS
#!/bin/sh
# Help
if [ "$1" == "-h" -o "$1" == "--help" ]; then
SCRIPT="$(basename ${0})"
cat <<EOF
${SCRIPT}
Shell utility to help find the certificates used by a specified FQDN on Synology NAS
Usage
@lstellway
lstellway / update-mysql-letsencrypt
Created February 23, 2022 02:35
Helper script to update MySQL / MariaDB TLS after renewing LetsEncrypt certificate
#!/bin/bash
DOMAIN="$1"
SOURCE="/etc/letsencrypt/live/${DOMAIN}"
DESTINATION="/var/lib/mysql/pki"
USER="mysql."
# Validate provided domain
if [ -z "${DOMAIN}" ] || [ ! -d "${SOURCE}" ]; then
printf "Please enter a valid domain (provided '%s')\n" "${DOMAIN}"