This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bash script to trigger AEM Blob GC on localhost using curl via JMX | |
# Author : Jayan Kandathil (Adobe Managed Services) | |
# Version : 0.3 | |
# Version Notes: | |
# 0.1 - Initial version | |
# 0.2 - autodetect environment and adjust port accordingly; handle and report errors appropriately | |
# 0.3 - update for AEM 6.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundlecsr() { | |
today=`date +%Y-%m-%d` | |
find /etc/httpd/conf.d/* -maxdepth 0 -mtime -1 | tar cvf /home/<username>/csrs_"$today".tar -T - | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newcsr() { | |
if [ $# -eq 0 ] | |
then | |
echo "Usage: newcsr www.my.sitename"; return | |
fi | |
mkdir /etc/httpd/conf.d/"$1".ssl | |
cd /etc/httpd/conf.d/"$1".ssl | |
openssl req -new -newkey rsa:2048 -nodes -out "$1".csr -keyout "$1".key | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#usage | |
#multiscp source_file.zip destination_ip_list.txt | |
#destination_ip_list.txt should only have IP addresses | |
multiscp(){ | |
for dest in $(cat "$2"); do | |
scp "$1" ${dest}:/home/username | |
done | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## serverlist should be FQDN or IP addresses, one server per line, no delimiters | |
## command will fail if serverlist.txt is not in UNIX format | |
while read name || [[ -n $name ]]; do sshpass -f ~/<yourpassword>.txt ssh-copy-id -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pub $name; done <serverlist.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## be sure your AWS default profile is set up, otherwise use --profile <profilename> to point it to the right account | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=<wildcard-name-query-here>" --query "Reservations[*].Instances[*].[Tags[?Key=='Name'].Value[],PublicIpAddress]" | tr -d ' ["\r\n' | sed 's/\]\]\,/\r\n/g' | sed 's/\]\,/ 300 A /g' | tr -d ']' | sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git status | grep modified | grep json | sed 's/\(.*modified:\s*\)//' | while IFS='' read filename; do knife environment from file $(echo $filename); done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep "<thecommonURL>" <thefile> | awk '{print $2}' | cut -c 2- | cut -f2-3 -d"/" | sort | tr '\n' '|' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# add the "-x" option to the shebang line if you want a more verbose output | |
# | |
# | |
OPTSPEC=":hp:t:k:" | |
show_help() { | |
cat << EOF | |
Usage: $0 [-p PATH] [-t TARGET_HOST] [-k API_KEY] |
OlderNewer