Skip to content

Instantly share code, notes, and snippets.

@jlintz
jlintz / MFA API
Created September 29, 2015 15:26
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyStopAndTerminateWhenMFAIsFalse",
"Effect": "Deny",
"Action": [
"ec2:StopInstances",
"ec2:TerminateInstances"
],
@jlintz
jlintz / gist:1377d69e8717fcf54849
Created December 9, 2015 22:28
logstash error
justin@logstashidx03:~$ sudo /opt/logstash/bin/logstash -t -f /etc/logstash/conf.d/logstash.conf
Bundler::GemNotFound: Could not find nokogiri-1.6.7-java in any of the sources
materialize at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/spec_set.rb:92
map! at org/jruby/RubyArray.java:2446
materialize at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/spec_set.rb:85
specs at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:132
specs_for at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:177
requested_specs at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:166
requested_specs at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/environment.rb:18
setup at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/runtime.rb:13
from boto import connect_ec2
def get_ri_costs(connection):
"""
@connection: EC2Connection obj
returns: list
"""
ri_costs = []
ris = connection.get_all_reserved_instances_offerings(include_marketplace=False,
@jlintz
jlintz / sync_ec2_tags_ebs.py
Created May 31, 2018 20:58
Sync tags from EC2 instances to attached EBS volumes
#!/usr/bin/env python
"""
Sync tags from ec2 instances onto the volumes that are attached to them
"""
from boto import connect_ec2
def main():
conn = connect_ec2()
volumes = conn.get_all_volumes(filters={
@jlintz
jlintz / gist:c9e8cb6fccaaefd5e401cdb55cf28e4f
Created December 2, 2019 01:15
Jets and Giants combined record against the number of games they at the same time in a season
Year: Wins - Losses, # of games at same time
2000: 21 - 11, 0
2001: 17 - 15, 0
2002: 19 - 13, 0
2003: 10 - 22, 1
2004: 16 - 16, 0
2005: 15 - 17, 0
2006: 18 - 14, 0
2007: 14 - 18, 1