Skip to content

Instantly share code, notes, and snippets.

@BenjaminRCooper
BenjaminRCooper / query.graphql
Created December 23, 2024 21:31
GraphQL introspection query Shopify Admin API
{
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
}
}
@rameerez
rameerez / kamal-production-server-setup.sh
Last active May 8, 2025 10:20
Set up a Ubuntu server to deploy Kamal 2.x Docker containers to, hardened security and production ready
#!/bin/bash
# Production Docker Host Hardening Script v2
# For Ubuntu Server 24.04 LTS (Noble)
# Suitable for both Kamal deployment and builder hosts
set -euo pipefail
IFS=$'\n\t'
# --- Constants ---
require 'sinatra'
require 'pp'
require 'redis'
require 'json'
configure do
redis = JSON.parse(ENV['VMC_SERVICES']).select {|srvc| srvc['name'] =~ /redis-.*?/ }.first['options']
redis_conf = {:host => redis['hostname'], :port => redis['port'], :password => redis['password']}
@@redis = Redis.new redis_conf