Skip to content

Instantly share code, notes, and snippets.

View cliffano's full-sized avatar
🎧
Hustlin' hustlin' hustlin' hustlin' hustlin'

Cliffano Subagio cliffano

🎧
Hustlin' hustlin' hustlin' hustlin' hustlin'
View GitHub Profile
@cliffano
cliffano / set_stash_group_permission.sh
Created April 19, 2016 01:27
Add group permission to multiple Stash repositories
#!/bin/bash
user=<user>
pass=<pass>
base_url=<http://stash_host:stash_port>
project=<project>
repos="<repo1> <repo2> ... <repoN>"
permission=<REPO_READ|REPO_WRITE|REPO_ADMIN>
group=<group>
@cliffano
cliffano / clean_puppetdb.sh
Created April 27, 2016 00:25
Deactivate and clean nodes in PuppetDB
#!/bin/bash
domains="domain1.xyz domain2.xyz"
for DOMAIN in ${domains}; do
puppet node deactivate ${DOMAIN}
puppet node clean ${DOMAIN}
done
@cliffano
cliffano / wait-for-fact.sh
Created July 29, 2016 01:20
wait for the existence of a facter fact via shell
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: check-fact <fact_name>" >&2
exit 1
fi
name=${1}
max_retries=60
@cliffano
cliffano / gist:b86e7a6ddf4d1c451e3e
Created June 2, 2014 08:44
app.js dynamic list
The html page:
<div class="app-page" data-page="blah">
<div class="app-topbar">
<div class="app-title">Blah</div>
</div>
<div class="app-content">
<ul id="somelist" class="app-list">
<li class="app-button" data-target="sometarget">Foo</li>
</ul>
@cliffano
cliffano / gource-multi-repos.sh
Created March 11, 2017 13:13
Gource shell script for visualizing multiple GitHub repositories
#!/bin/bash
set -e
set -u
# brew install gource ffmpeg
user=<github_user/org>
repos="<repo1> <repo2> ... <repoN>"
rm -rf repos logs out
@cliffano
cliffano / command-ps-gnuplot.script
Last active May 30, 2017 01:12
chart a process
set term png small size 800,600
set output "command-ps-graph.png"
set ylabel "%CPU"
set y2label "MEM"
set ytics nomirror
set y2tics nomirror in
set yrange [0:*]
@cliffano
cliffano / gist:5465541
Created April 26, 2013 07:29
Node modules with latest version having gypfile: true
kingkong:/tmp/gypfilecheck$ time couchtato iterate -u http://host/registry -p 5000
retrieved 5000 docs - 0
>> LDAP 1.1.4 has gypfile: true
>> airtunes 0.1.3 has gypfile: true
>> aligned-buffer 0.1.2 has gypfile: true
>> allsync 0.0.3b has gypfile: true
>> ancillary 2.0.0 has gypfile: true
>> aplus 0.1.0 has gypfile: true
>> base128 0.1.0 has gypfile: true
>> bcrypt 0.7.5 has gypfile: true
@cliffano
cliffano / enable-crxde-64-inconsistency
Last active June 8, 2018 07:27
Enable CRXDE outputs AEM 6.2, 6.3, 6.4
Based on https://helpx.adobe.com/experience-manager/6-4/sites/administering/using/enabling-crxde-lite.html
================================================================================================
AEM 6.3 and AEM 6.2
================================================================================================
[aem-6.3] curl -u admin:admin -F "jcr:primaryType=sling:OsgiConfig" -F "alias=/crx/server" -F "dav.create-absolute-uri=true" -F "dav.create-absolute-uri@TypeHint=Boolean" http://localhost:4502/apps/system/config/org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet
<html>
<head>
<title>Content created /apps/system/config/org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet</title>
@cliffano
cliffano / s3staticsite_route53a.tf
Created May 26, 2016 22:42
Terraform configuration for setting up S3 static site bucket with a Route53 A record.
variable "bucket_site" {}
variable "region" {}
variable "route53_domain_name" {}
variable "route53_domain_zoneid" {}
variable "route53_domain_alias_name" {}
variable "route53_domain_alias_zoneid" {}
provider "aws" {
region = "${var.region}"
}
@cliffano
cliffano / gist:4545061
Last active September 13, 2020 07:23
CouchDB delete followed by bulk fetch against _replicator database
========================================================================
Step 1: Delete an existing doc in _replicator database.
request:
{ method: 'POST',
headers:
{ 'content-type': 'application/json',
accept: 'application/json' },
uri: 'http://user:pass@localhost:5984/_replicator/_bulk_docs',
body: '{"docs":[{"_id":"foo1","source":"http://user:pass@localhost:5984/mydb","target":"http://user:pass@localhost:5984/mydb2","continuous":true,"_rev":"59-abb0482eb5a5730d6a290a4c38206e96","_deleted":true}]}' }