Skip to content

Instantly share code, notes, and snippets.


Carl Youngblood cayblood

View GitHub Profile
cayblood / requirements.txt
Last active Oct 27, 2020
Example of how to sign an API Gateway request using Signature Version 4 IAM-based authentication
View requirements.txt
cayblood /
Last active Oct 9, 2020 — forked from wongcyrus/
Cloud9 Disk Resize
# Specify the desired volume size in GiB as a command-line argument. If not specified, default to 20 GiB.
# Get the ID of the environment host Amazon EC2 instance.
# Get the ID of the Amazon EBS volume associated with the instance.
VOLUMEID=$(aws ec2 describe-instances \
View useAmplifyAuth.js
// The code in this source file is licensed under the Creative Commons
// Attribution 4.0 International Public License. License text can be found at
// It may be shared and
// used freely for any purpose, as long as author attribution is included with
// the source code.
// written by Sophia Brandt
View gist:f6a4c01509fe7e54685b8b24a1ae9199
∴ sudo jamf recon
Retrieving inventory preferences from
Finding extension attributes...
Locating applications...
Locating hard drive information...
Locating accounts...
Locating printers...
Searching path: /System/Applications
Searching path: /Applications
cayblood / basic-chaincode.js
Created Mar 19, 2020
Basic chaincode example
View basic-chaincode.js
'use strict';
const shim = require('fabric-shim');
let Chaincode = class {
async Init(stub) {'============= Init called =============');
return shim.success();
async Invoke(stub) {
View docker-compose-cli.yaml
version: '2'
container_name: cli
image: hyperledger/fabric-tools:1.2.0
tty: true
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_LOGGING_LEVEL=info # Set logging level to debug for more verbose logging
cayblood / permissions-example.js
Last active Feb 26, 2020
example of how to use hyperledger fabric permissions
View permissions-example.js
'use strict';
const shim = require('fabric-shim');
async function requireRole(stub, role) {
const ClientIdentity = shim.ClientIdentity;
let cid = new ClientIdentity(stub);
if (!cid.assertAttributeValue('role', role))
throw new Error(`Unauthorized access: ${role} required`);
cayblood / AMBManagementMachinePolicy.json
Created Feb 26, 2020
Policy attached to fabric client machine role that connects to Amazon Managed Blockchain networks.
View AMBManagementMachinePolicy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "ManageNetworkResources",
"Effect": "Allow",
"Action": [
View prompt.bash
# display user@host and current working dir
PS1='\[$(tput setaf 2)\]\u\[$(tput sgr0)\]@\[$(tput setaf 3)\]\h\[$(tput sgr0)\] \w'
# display git info if applicable
PS1=$PS1'\[$(tput setaf 5)\]`if [ "$(vcprompt)" != "" ]; then echo " $(vcprompt | tr -d '"'"'[:space:]'"'"')"; fi`'
# display rvm info if applicable
PS1=$PS1'\[$(tput setaf 1)\] [`if [ "$(~/.rvm/bin/rvm-prompt)" != "" ]; then echo "$(~/.rvm/bin/rvm-prompt)"; fi`]\[$(tput sgr0)\]'
# display nvm info if available