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 / 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 / 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 / create_aws_user.sh
Last active April 16, 2022 20:52
Simple shell script to create a user on AWS with an initial password (required to be changed) and a group
#!/bin/bash
set -e
aws_username=<your_username>
aws_password=<your_password>
create_user() {
user=${1}
password=${2}
@cliffano
cliffano / couchdb2couchpenter.js
Created September 2, 2015 23:11
Retrieve all database names in a CouchDB database and create a Couchpenter config.
var fs = require('fs');
var http = require('http');
var url = require('url');
if (process.argv.length !== 3) {
console.error('Usage: node couchdb2couchpenter.js https://host:port');
process.exit(1);
}
var _url = url.parse(process.argv[2]);
@cliffano
cliffano / gist:b268c090f905eccf35fe
Last active August 29, 2015 14:17
npmjs registry intermitten failure
> openssl s_client -connect registry.npmjs.org:443 -prexit
CONNECTED(00000003)
write:errno=54
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 130 bytes
@cliffano
cliffano / gist:b47b389721fe5a3403f9
Created November 5, 2014 15:26
pkjutil traverse-dependencies
* pkjutil@0.1.1
- dependencies:
- async: ~0.9.0
- bagofcli: ~0.2.0
- bagofrequest: ~0.1.0
- colors: ~1.0.3
- lodash: ~2.4.1
- prod: ~1.0.0
- semver: ~4.1.0
- devDependencies:
@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>
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@cliffano
cliffano / gist:5931066
Last active December 19, 2015 09:09
child_process bg
>>> cat blah.js
var cp = require('child_process');
var c = cp.exec('./blah.sh &', function (err) {
if (err) {
console.error('err: ' + err.message);
} else {
console.log('done');
}
});
@cliffano
cliffano / gist:5726639
Created June 7, 2013 02:14
NPM registry request
GET http://isaacs.iriscouch.com/registry/apis?atts_since=%5B%224-037b8021362c3319a7597c48c971a6e5%22%2C%224-05089c4258ba04259c89b3f2a8c97612%22%2C%224-0552d46c24ecdb65dd2d6c240797a56d%22%2C%224-0704025b6930979628cfc6c3e7cf7f7e%22%2C%224-08b2044a733715af4fa07417056ec78e%22%2C%224-08bd7afaad62b4baba0da5de8ff910e7%22%2C%224-0a526c7b6335f392d2cda8b8b3e8e13b%22%2C%224-0a6715d362d8a867e09f17165365dfbf%22%2C%224-0ceeacc9ca07e3c345811ec11a0ae472%22%2C%224-10ca136fcc95facdc28177cce97fb3ce%22%2C%224-124e9df218dfdb574de8b6441280090d%22%2C%224-160368532f9278a6929860c2471765af%22%2C%224-163142f0ffa5c7dd6bf5a3125fd45ebb%22%2C%224-18bdb5783ae063d6887bea6affd7514f%22%2C%224-18de5df4942206690c8163871f4f1432%22%2C%224-18f32ae20fcfd91ae634e13690cca4dd%22%2C%224-1a471de9368c2528b6ea3447e804ae83%22%2C%224-1ac85e92696815871c0a58390fc54b95%22%2C%224-1df874a5a797befbda068825aa3f1611%22%2C%224-207cddd8a6183df0f4e26dfb17aa8eb4%22%2C%224-2358faef216a5afe65d06e2702e9c8a0%22%2C%224-276856c6619a4fbaf298b8a3dd4cb56f%22%2C%224-2a39aa2d16a74