Skip to content

Instantly share code, notes, and snippets.

View jamnaughty's full-sized avatar

JSD jamnaughty

View GitHub Profile
@andrewmkhoury
andrewmkhoury / 1 - Fix Versions.md
Last active July 28, 2021 05:26
Fix Corrupt Jackrabbit Oak Version Histories
@Jhyeok-lee
Jhyeok-lee / iterm2-solarized.md
Created December 8, 2017 21:29 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package:

@aih
aih / update-bundles.sh
Last active November 17, 2019 06:24 — forked from janlay/update-repos.sh
Update all Vim bundles for Pathogen
#/bin/sh
cd ~/.vim/bundle
for i in `\ls -p -d */`; do
cd "$i"
echo "Updating $i..."
git pull --recurse-submodules | grep -v 'Already up-to-date' | sed 's/^/ /'
[ -f .git/.gitmodules ] && git submodule update | sed 's/^/ /'
cd ..
done
@lukeplausin
lukeplausin / bash_aws_jq_cheatsheet.sh
Last active July 2, 2024 20:14
AWS, JQ and bash command cheat sheet. How to query, cut and munge things in JSON generally.
# Count total EBS based storage in AWS
aws ec2 describe-volumes | jq "[.Volumes[].Size] | add"
# Count total EBS storage with a tag filter
aws ec2 describe-volumes --filters "Name=tag:Name,Values=CloudEndure Volume qjenc" | jq "[.Volumes[].Size] | add"
# Describe instances concisely
aws ec2 describe-instances | jq '[.Reservations | .[] | .Instances | .[] | {InstanceId: .InstanceId, State: .State, SubnetId: .SubnetId, VpcId: .VpcId, Name: (.Tags[]|select(.Key=="Name")|.Value)}]'
# Wait until $instance_id is running and then immediately stop it again
aws ec2 wait instance-running --instance-id $instance_id && aws ec2 stop-instances --instance-id $instance_id
# Get 10th instance in the account
@tianchaijz
tianchaijz / tips_lsof.sh
Last active January 24, 2022 02:41 — forked from sergepetit/tips_lsof.sh
Shell command lsof : see open files and ports; Selection is OR by default, use -a for AND; Tested on OSX
#list all ports for tcp
sudo lsof -itcp
#find all things listening on ports
lsof -Pnl +M -i4 | grep LISTEN
#all ports for tcp, dont resolve port name from numbers
sudo lsof -itcp -P
#open files and ports of process #$PID
@warking
warking / install_linuxbrew_on_centos7.sh
Last active August 19, 2023 19:26
standalone linuxbrew setup script for CentOS 7
# Non-root account is recommended for this process
# centos-specific prepration
sudo yum -y update && sudo yum -y groupinstall 'Development Tools' && sudo yum -y install curl irb m4 ruby
# Sanitize the environment
PATH=~/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
unset LD_LIBRARY_PATH PKG_CONFIG_PATH
# install linuxbrew

AEM6.x Migration

  • How to Rebuild a Pre-Existing AEM+Mongo Cluster
  • or migrate from Tar to MongoDB or MongoDB to Tar"
  • or migrate from 5.6.1 or 6.x to 6.x via data migration instead of jar upgrade
  1. (Mongo to Mongo only) Remove one replica from the replica set and delete/recreate the db
    1. Remove the replica node from the set: http://docs.mongodb.org/master/tutorial/remove-replica-set-member/
    2. Validate that no other nodes in the set consider that node to be part of the set anymore. Log into each node in the cluster via mongo shell and run rs.status() to validate that the node that was taken out is not in the cluster any longer.
    3. Drop the aem database on that node http://docs.mongodb.org/manual/reference/command/dropDatabase/
  2. Re-add the database with the correct user permissions (do not add the mongo instance back to the replica set)
@joemaffia
joemaffia / AEM cURL
Last active July 18, 2023 00:09
AEM cURL commands
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
bundlefile=@"name of jar.jar" http://localhost:4505/system/console/bundles
Build a bundle
curl -u admin:admin -F bundleHome=/apps/centrica/bundles/name of bundle -F
descriptor=/apps/centrica/bundles/com.centrica.cq.wcm.core-bundle/name_of_bundle.bnd
@wataruoguchi
wataruoguchi / How to make your website to maintenance mode.md
Last active January 7, 2024 14:28
How to make your website to maintenance mode - Apache

Apache

How to make your website to maintenance mode

  1. Put maintenance.html into your root directory

  2. Open .htaccess file

  3. Insert this block in the first line of the file

     ErrorDocument 503 /maintenance.html
     <IfModule mod_rewrite.c>
    

RewriteEngine On