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 / 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 / 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: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 / 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 / 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 / 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 / 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 / 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 / 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