Skip to content

Instantly share code, notes, and snippets.

View hgontijo's full-sized avatar

Henrique M. Gontijo hgontijo

  • Intuit
  • Mill Valley, CA
View GitHub Profile
docker run --entrypoint '' <image> sh -c "<repete o entrypoint> && <comando adicional>"
2016/10/26 17:25:28.276042 [DEBUG] sched: <Eval 'e6708a61-9759-0dfe-f7a0-621c24799fd9' JobID: 'CC-Continuous-177_ABV3ServerDocuments'>: allocs: (place 1) (update 0) (migrate 0) (stop 0) (ignore 0)
2016/10/26 17:25:28.282386 [DEBUG] sched: <Eval 'e6708a61-9759-0dfe-f7a0-621c24799fd9' JobID: 'CC-Continuous-177_ABV3ServerDocuments'>: setting status to complete
2016/10/26 17:25:28.291441 [DEBUG] worker: updated evaluation <Eval 'e6708a61-9759-0dfe-f7a0-621c24799fd9' JobID: 'CC-Continuous-177_ABV3ServerDocuments'>
2016/10/26 17:26:02 [DEBUG] http: Request /v1/job/CC-Continuous-177_ABV3ServerDocuments?region=aws-us (1.263067ms)
2016/10/26 17:26:02 [DEBUG] http: Request /v1/job/CC-Continuous-177_ABV3ServerJaJP?region=aws-us (1.434157ms)
2016/10/26 17:26:21 [DEBUG] http: Request /v1/job/CC-Continuous-177_ABV3ServerFrFR?region=aws-us (1.329661ms)
2016/10/26 17:26:31 [DEBUG] http: Request /v1/job/CC-Continuous-177_ABV3Server?region=aws-us (1.271405ms)
2016/10/26 17:26:41 [DEBUG] http: Re
@hgontijo
hgontijo / terraform_destroy
Last active September 26, 2016 22:40
terraform destroy failing with aws_instance and aws_volume_attachment resources. it applies to terraform v0.7.4
There are warnings and/or errors related to your configuration. Please
fix these before continuing.
Warnings:
* template_file.nomad_server_user_data: using template_file as a resource is deprecated; consider using the data source instead
* template_file.consul_server_user_data: using template_file as a resource is deprecated; consider using the data source instead
* template_file.nomad_client_user_data: using template_file as a resource is deprecated; consider using the data source instead
* template_file.teamcity_agent_init: using template_file as a resource is deprecated; consider using the data source instead
* template_file.teamcity_agent_ansible: using template_file as a resource is deprecated; consider using the data source instead
@hgontijo
hgontijo / nomad_server_ping.log
Last active June 28, 2016 22:47
Nomad cluster - latency between servers
us-west-2a -> us-west-2a
========================
[root@ip-10-60-1-110 centos]# ping -c 5 10.60.1.165
PING 10.60.1.165 (10.60.1.165) 56(84) bytes of data.
64 bytes from 10.60.1.165: icmp_seq=1 ttl=64 time=0.182 ms
64 bytes from 10.60.1.165: icmp_seq=2 ttl=64 time=0.232 ms
64 bytes from 10.60.1.165: icmp_seq=3 ttl=64 time=0.206 ms
64 bytes from 10.60.1.165: icmp_seq=4 ttl=64 time=0.304 ms
64 bytes from 10.60.1.165: icmp_seq=5 ttl=64 time=0.286 ms
@hgontijo
hgontijo / nomad_cluster_server.log
Created June 28, 2016 22:30
Nomad Cluster - Nomad server leader logs
-- Logs begin at Thu 2016-06-16 23:57:12 UTC, end at Tue 2016-06-28 22:23:41 UTC. --
Jun 16 23:58:21 ip-10-60-1-110 systemd[1]: Started Nomad Agent.
Jun 16 23:58:21 ip-10-60-1-110 systemd[1]: Starting Nomad Agent...
Jun 16 23:58:21 ip-10-60-1-110 nomad[9615]: Loaded configuration from /etc/nomad.d/nomad.hcl, /etc/nomad.d/server.hcl
Jun 16 23:58:21 ip-10-60-1-110 nomad[9615]: ==> Starting Nomad agent...
Jun 16 23:58:21 ip-10-60-1-110 nomad[9615]: ==> Nomad agent configuration:
Jun 16 23:58:21 ip-10-60-1-110 nomad[9615]: Atlas: <disabled>
Jun 16 23:58:21 ip-10-60-1-110 nomad[9615]: Client: false
Jun 16 23:58:21 ip-10-60-1-110 nomad[9615]: Log Level: INFO
Jun 16 23:58:21 ip-10-60-1-110 nomad[9615]: Region: aws-us (DC: us-west-2)
@hgontijo
hgontijo / asg-policy-configure.sh
Created April 21, 2016 04:15
example: aws cli configure asg policy scaling-adjustment 0
$ aws autoscaling put-scaling-policy \
--auto-scaling-group-name my-asg \
--policy-name asg-scaledown \
--scaling-adjustment 0 \
--adjustment-type ExactCapacity
{
"PolicyARN": "arn:aws:autoscaling:us-west-2:636651215756:scalingPolicy:f1a7c313-f73f-4b5c-acdc-318d3fb01f90:autoScalingGroupName/my-asg:policyName/asg-scaledown"
}
@hgontijo
hgontijo / gist:5005e78944ccffe8b87410269804680e
Created April 21, 2016 04:11
terraform aws_autoscaling_policy issue with scaling_adjustment: "1" => "0"
$ terraform apply
...
aws_autoscaling_policy.ci_scaledown_conf: Modifying...
scaling_adjustment: "1" => "0"
Error applying plan:
1 error(s) occurred:
* aws_autoscaling_policy.ci_scaledown_conf: ValidationError: Scaling increment must be specified for a SimpleScaling policy
status code: 400, request id: 85d5865b-0775-11e6-9ea3-31a009569bc8

On the server with tmux

Create a new tmux session:

tmux new-session -s my-session # launch `top`, `htop`, or anything that will regularly updates, then detach

Stream your session:

@hgontijo
hgontijo / build2.gradle
Created June 23, 2015 14:24
gradle script to execute tests by consuming an external jar.
apply plugin: 'java'
project.ext.set('testIncludeDefault', 'com/vmware/ui/login/**')
repositories {
mavenCentral()
}
dependencies {
runtime fileTree(dir: 'libs', include: ['*.jar'])
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies { }
task expandDependencies << {
FileTree tree = fileTree(dir: 'lib', include: '*.jar')