Skip to content

Instantly share code, notes, and snippets.

@rwunsch
rwunsch / start.sh
Created July 8, 2025 09:18
AEM 6.5 START script with Java 11 check
#!/usr/bin/env bash
# export OAUTH_INTEGRATION_ENABLED_ENVIRONMENTS=true
SCRIPT_DIR=$(dirname "$(realpath "$0")")
DIRECTORY=$SCRIPT_DIR/crx-quickstart
ADMIN_PASSWORD="admin"
LOG_FILE="$DIRECTORY/logs/error.log"
INSTALL_DIR="$DIRECTORY/install"
INSTALL_DIR_FROM="$SCRIPT_DIR/install"
@rwunsch
rwunsch / deploy-to-rde.sh
Created March 31, 2025 18:07
Deeploy to Adobe AEM Cloud Services (AEMaaCS) Rapid Development Environments (RDEs) - Shelly Script
#!/bin/bash
# ============================================================================
# AEM RDE Deployment Script
# ============================================================================
# This script automates the deployment of AEM packages to a Rapid Development
# Environment (RDE) using the Adobe I/O CLI.
#
# Usage:
# ./deploy-to-rde.sh [options]
@rwunsch
rwunsch / stop.sh
Last active March 20, 2025 11:03
AEM Cloud Services SDK - Local Stop Script
#!/usr/bin/env bash
# Define the AEM role (set this to "author" or "publish")
aem_role="author"
# Default behavior for repository deletion (unset when no parameter is given)
delete_repo=""
# Check for parameter input
if [ $# -gt 0 ]; then
@rwunsch
rwunsch / start.sh
Created January 29, 2025 19:33
AEM Cloud Services SDK - Local Start Script
#!/usr/bin/env bash
# export OAUTH_INTEGRATION_ENABLED_ENVIRONMENTS=true
SCRIPT_DIR=$(dirname "$(realpath "$0")")
DIRECTORY=$SCRIPT_DIR/crx-quickstart
ADMIN_PASSWORD="admin"
cd "$SCRIPT_DIR"
@rwunsch
rwunsch / jfr.sh
Last active January 22, 2025 19:05
Java Flight Recorder - execution script
#!/bin/bash
LOG_FILE="/var/log/jfr_recorder.log"
choose_profile() {
echo "Select a JFR profile or custom settings file:"
echo "1) profile - Captures detailed performance metrics, useful for profiling applications."
echo "2) default - Standard JFR configuration, collects essential runtime data."
# Detect custom .jfc files in the script directory
@rwunsch
rwunsch / loadtest.config
Last active January 22, 2025 13:51
Simple loadtest shell script
# AEM Load Test Configuration
# URL file containing multiple target URLs (one per line)
URL_FILE="urls.txt"
# Optional authentication (leave empty if not needed)
USERNAME="" # AEM username (if authentication required)
PASSWORD=""
CONCURRENT_REQUESTS=5 # Number of parallel requests
@rwunsch
rwunsch / reverse-scp.sh
Last active January 22, 2025 12:22
reverse-scp.sh - This script lists remote files, lets the user select them, and downloads them via SCP.
#!/bin/bash
# Function to display help message
show_help() {
echo "Usage: $0 [REMOTE_USER REMOTE_HOST REMOTE_DIR]"
echo
echo "Arguments:"
echo " REMOTE_USER SSH username for the remote connection"
echo " REMOTE_HOST Remote host (IP or domain)"
echo " REMOTE_DIR Directory on the remote server"
@rwunsch
rwunsch / aem-folder-tree.py
Last active March 19, 2024 11:49
Python script to create a "tree"-like view (file) as output of all folders and subfolders for AEM Cloud Service (AEMaaCS) - uses ASSETS API .
import requests
import json
def get_folder_structure(token, base_url, debug_mode=False, path="/api/assets"):
if debug_mode:
print(f"Fetching folder structure from {base_url}{path}")
else:
print(".", end="", flush=True)
headers = {
@rwunsch
rwunsch / Bridge-WslPorts.ps1
Created January 26, 2024 13:15
Bridge external Ports on Windows into WSL2 - Bridge-WslPorts.ps1
## https://jwstanly.com/blog/article/Port+Forwarding+WSL+2+to+Your+LAN/
## Execute with: powershell.exe -File "C:\Users\wunsch\Bridge-WslPorts.ps1"
Start-Transcript -Path "C:\Users\wunsch\Bridge-WslPorts.log" -Append
$ports = @(80, 443, 1234, 3000, 4502, 4503, 4326, 4327, 5000, 10000, 25565, 25575);
$wslAddress = bash.exe -c "ifconfig eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'"
if ($wslAddress -match '^(\d{1,3}\.){3}\d{1,3}$') {
@rwunsch
rwunsch / aem-cloud-migration-republish.py
Last active January 16, 2024 14:17
AEM Cloud Service | Python script to query for published items on one instance and to publish these items on another instance (instance migration)
#!/usr/bin/python3
import requests
import json
def load_config(filename="config.json"):
try:
with open(filename, 'r') as file:
config = json.load(file)
return config