-
Delete all containers
$ docker ps -q -a | xargs docker rm
-q prints only the container IDs -a prints all containers
Notice that it uses xargs to issue a remove container command for each container ID
- Delete all untagged images
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
#!/usr/bin/env bash | |
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-08-25 | |
# | |
# _______________| httpstatus : get HTTP status code | |
# | |
# Usage: httpstatus URL [timeout] [--code or --status] [see 4.] | |
# ^message with code (default) | |
# ^code (numeric only) | |
# ^in secs (default: 3) | |
# ^URL without "http://" prefix works fine. |
/etc/map | |
+-- http | |
+-- example.com.80 | |
| +-- sling:redirect = "http://www.example.com/" | |
+-- www.example.com.80 | |
| +-- sling:internalRedirect = "/example" | |
+-- any_example.com.80 | |
| +-- sling:match = ".+\.example\.com\.80" | |
| +-- sling:redirect = "http://www.example.com/" | |
+-- localhost_any |
This scripts provide details related to various caches used in Oak MongoMK module while running within Sling OSGi Container | |
The script is based on (JAMM) [1]. Steps are provided below | |
1. Download JAMM from Maven | |
$wget http://repo1.maven.org/maven2/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar | |
2. Modify the Quickstart launching by specifying agent and bootdelegation list | |
$java -javaagent:<path to>/jamm.jar -Dorg.apache.sling.launcher.bootdelegation=,org.github.jamm -jar | |
3. Deploy the Script Console jar | |
$wget http://repo1.maven.org/maven2/org/apache/sling/org.apache.sling.scripting.console/1.0.0/org.apache.sling.scripting.console-1.0.0.jar | |
$wget http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.1.3/groovy-all-2.1.3.jar |
Delete all containers
$ docker ps -q -a | xargs docker rm
-q prints only the container IDs -a prints all containers
Notice that it uses xargs to issue a remove container command for each container ID
Note 1: The following CQ curl commands assumes a admin:admin username and password. | |
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command. | |
Example: -F"":operation=delete"" | |
Note 3: Quotes around name of package (or name of zip file, or jar) should be included. | |
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 |
Following js file can be load at start of mongo shell and then the functions can be accessed
$ wget https://gist.githubusercontent.com/chetanmeh/836ca8fffc4c410daed2/raw/oak-mongo.js
$ mongo localhost/oak --shell oak-mongo.js
MongoDB shell version: 2.6.3
connecting to: localhost/oak
type "help" for help
> oak.countChildren('/oak:index/')
356787
> oak.getChildStats('/oak:index')
# Adding include/exclude rules to CQ/AEM package filters through cURL. | |
# Through a simple search, you will find numerous lists of CQ/AEM cURL commands. | |
# However, I haven't seen an example of adding rules to package filters. The | |
# JSON "rules" key takes an array value. You can leave the array empty if you | |
# don't need to include any rules. The array is of JSON objects with a | |
# "modifier" key and value of "include" or "exclude", and a "pattern" key with | |
# your path or regular expression as the value. | |
# create package |
11 #Bundle Id | |
slinginstall:/path/to/foo.jar #Bundle original location | |
32 #Persistence State (INSTALLED, RESOLVED etc) | |
1 #Start level | |
1358768421064 #Last modified | |
0 #Refresh Count |
import groovy.json.JsonSlurper | |
//Get data from here: /system/sling/monitoring/mbeans/org/apache/jackrabbit/oak/%2522SessionStatistics%2522.2.json | |
def file = '/Users/brobert/Desktop/all_sessions.json' as File | |
def sanitizeStacktrace = {trace-> | |
if (trace.contains("loginAdministrative")) { | |
def lines = trace.split("\n") | |
def startIdx; | |
for (def idx=0; idx < lines.length; idx++) { |