Skip to content

Instantly share code, notes, and snippets.

# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL
<alignment jcr:primaryType="nt:unstructured"
name="./alignChildren"
fieldLabel="Alignment of components"
required="{Boolean}true"
selectionMode="single"
sling:resourceType="granite/ui/components/coral/foundation/form/buttongroup">
<items jcr:primaryType="nt:unstructured">
<default jcr:primaryType="nt:unstructured"
name="./default"
Standard:
-Xmx -- Increase heap size to 50% total machine ram, or 24gb -- whichever is smaller
-XX:+UseG1GC -- More efficient server GC in Java 8
-XX:+UseAES -XX:+UseAESIntrinsics -- Use Hardware crypto features for AES if available
-XX:+AggressiveOpts -- Experimental faster JVM tunings
-Djava.awt.headless=true -- Required for headless unix boxes for Java2D support to work properly
-Djava.io.tmpdir=/tmp -- Recommended to set somewhere with fast i/o
Debugging:
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -- Used for triaging heap full errors
#!/bin/bash
#set -x
#==========================================================================
# NAME
# aem-control - start, stop, restart or check the status of
# an AEM instance (>= 5.5.0)
#
# SYNOPSIS
# aem-control [start|stop|restart|status|activate|sweep|help|version]
@Systerr
Systerr / crontab
Last active April 8, 2021 12:44
Backup
# Execute :crontab -e
# add folow lines (create backup at 4-30 o'clock every day):
30 04 * * * /root/mysql-dump.sh
@floriankraft
floriankraft / JcrQueryLibrary.md
Last active May 3, 2024 05:50
Some useful JCR queries (XPATH, SQL2) for AEM/CQ development.

SQL2

All nodes with a specific name

SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND NAME() = "nodeName"

All pages below content path