Skip to content

Instantly share code, notes, and snippets.

View dsalazar-carecloud's full-sized avatar

David Salazar dsalazar-carecloud

View GitHub Profile
@dsalazar-carecloud
dsalazar-carecloud / knife.rb
Last active August 29, 2015 14:25
knife.rb template.
log_level :info
log_location STDOUT
node_name USERNAME
client_key PATH_TO_CLIENT_KEY_PEM
validation_client_name VALIDATOR_NAME
validation_key PATH_TO_ORGANIZATION_PEM
chef_server_url CHEF_SERVER_URL
syntax_check_cache_path SYNTAX_CHECK_CACHE_PATH
# CONFIG FOR AWS ACCOUNT
@dsalazar-carecloud
dsalazar-carecloud / config
Created July 27, 2015 20:55
~/.ssh/config
Host <10.?>.*.*
User <User>
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentityFile <Production Identity File>
ProxyCommand ssh -W %h:%p <Bastion-Jump-Host-Name>
Host <Bastion-Jump-Host-Name>
HostName <Public-IP>
@dsalazar-carecloud
dsalazar-carecloud / create.sh
Last active August 29, 2015 14:26
Knife server create
# Optional
# --server-connect-attribute and --ssh-gateway flags are only required when target server is behind an ssh Gateway.
# --iam-profile
# Only applies to AWS based environments.
knife ec2 server create \
--node-name $node_name \
--flavor $ec2_flavour \
--image $ami \
--run-list "$run_list" \
--json-attributes '$json_attributes'
@dsalazar-carecloud
dsalazar-carecloud / gcurl.sh
Created January 29, 2016 13:47
Granular Curl
curl -w "@formatfile" -k -o /dev/null -s "URI"
time_namelookup: 0.064
time_connect: 0.089
time_pretransfer: 0.089
time_redirect: 0.000
time_starttransfer: 0.117
----------
time_total: 0.117
[admin@cc-tm01-cc01 rg-tmp]$ cat formatfile
time_namelookup: %{time_namelookup}\n
@dsalazar-carecloud
dsalazar-carecloud / put-cmd.sh
Last active October 26, 2018 21:31
S3 Bucket Lifecycle Configuration (AWS CLI s3api cmd)
# AWS CLI required.
# s3api: http://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-lifecycle-configuration.html
aws s3api put-bucket-lifecycle-configuration --bucket <bucket-name> --lifecycle-configuration file://<path-to-policy-json>
# Policy file example
# {
# "Rules": [
# {
# "ID": "Expires in 120 DAYS",
# "Prefix": "",