Skip to content

Instantly share code, notes, and snippets.

View anir's full-sized avatar

Anirban Das anir

  • Ontario, Canada
View GitHub Profile
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
@anir
anir / Jenkins+Script+Console.md
Created July 11, 2018 22:53 — forked from mubbashir/Jenkins+Script+Console.md
jenkins groovy scripts collection.
// serviceConfig.each {
// serviceName, config ->
// println serviceName
// println config
// def plan = config.plan
// def label = config.label
//
// def createServiceCmd = "cf create-service ${label} ${plan} ${serviceName}"
// def isServiceAvailable = "cf services | grep -w \'${serviceName}\' | wc -l"
//
@anir
anir / gist:917aa7a34df145c7e6ce7a925cdb5664
Created December 26, 2018 20:08
jenkins save all jobs
def jobs = Jenkins.instance.getAllItems(Job.class)
jobs.each{it.save()}
@anir
anir / gist:c6abdc39014cb10dbef066d52d2d8152
Created December 26, 2018 20:09
jenkins enable all jobs
def jobs = Jenkins.instance.getAllItems(Job.class)
def jobPattern = ""
// Should we be disabling or enabling jobs? "disable" or "enable", case-insensitive.
def disableOrEnable = "enable"
//Permission config = new Permission(CONFIGURE)
def lcFlag = disableOrEnable.toLowerCase()
if (lcFlag.equals("disable") || lcFlag.equals("enable")) {
def matchedJobs = jobs.each{ job ->
job.isBuildable()
}
for i in 1 2 3; do
docker-machine create -d virtualbox node-$i
done
eval $(docker-machine env node-1)
docker swarm init \
--advertise-addr $(docker-machine ip node-1)
TOKEN=$(docker swarm join-token -q worker)
@anir
anir / ckad-learning.md
Created January 23, 2020 20:55 — forked from benc-uk/ckad-learning.md
Certified Kubernetes Application Developer (CKAD)
@anir
anir / 2repos-sync.sh
Created April 2, 2020 16:08 — forked from yorammi/2repos-sync.sh
Sync 2 remote repositories script - Just define the 3 variables (use export command for that!)
#!/bin/bash
# REPO_NAME=<repo>.git
# ORIGIN_URL=git@<host>:<project>/$REPO_NAME
# REPO1_URL=git@<host>:<project>/$REPO_NAME
rm -rf $REPO_NAME
git clone --bare $ORIGIN_URL
if [ "$?" != "0" ]; then
echo "ERROR: failed clone of $ORIGIN_URL"