This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ops git:(main) ✗ irb | |
irb(main):001:0> m1 = Hash.new { |h1, k1| h1[k1] = Hash.new { |h2, k2| h2[k2] = 0 } } | |
=> {} | |
irb(main):002:0> m2 = {} | |
=> {} | |
irb(main):003:0> m1 == m2 | |
=> true | |
irb(main):004:0> m1[1][2] = 3 | |
=> 3 | |
irb(main):005:0> m2[1][2] = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as core from "@aws-cdk/core"; | |
import * as ec2 from "@aws-cdk/aws-ec2"; | |
export class MyStack extends core.Stack { | |
constructor(scope: core.Construct, id: string, props: core.StackProps) { | |
super(scope, id, props); | |
console.log(ec2.Vpc.fromLookup(this, "Vpc1", { isDefault: true }).vpcId); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const aws = require ('aws-sdk'); | |
async function test() { | |
const s3 = new aws.S3({ | |
apiVersion: '2006-03-01', | |
signatureVersion: 'v4', | |
httpOptions: { | |
connectionTimeout: 1000, | |
timeout: 1000 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'redis' | |
$redis = Redis.new({url: ENV['REDIS_HOST']}) | |
puts $redis.connected? | |
failed = false | |
starting = nil | |
ending = nil | |
loop do | |
$redis.ping |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aws-sdk-configservice' | |
require 'json' | |
require 'net/http' | |
module Enumaws | |
def self.run | |
uri = URI('https://raw.githubusercontent.com/aws/aws-sdk-ruby/master/apis/config/2014-11-12/api-2.json') | |
res = Net::HTTP.get_response(uri) | |
config_api_schema = JSON.load(res.body) | |
resource_types = config_api_schema["shapes"]["ResourceType"]["enum"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxDRdSFtK4vLZqijBKZN9SrX4wVIARLEU3QikT5Tn34e34M5PBoK3L7im5vdwv9hJUmD/lBicznNONkGEbrF0U/ILy6qOAEUV0kuRrAbq7uTIvNdHK9jiMH2GDsNttkQA+O0y/lQrCtmD7/gPiN0w72Mql/d17QQ15uGTqYDMdzX4usTnUxlIqGgh+nuvjLnK5aUmiI/I0adAw9WCMW4mPh3xffAtq6maI/kQ9cr6iKXQO4IgRAxRhl3atLDrlVzNqwg4IoIPmWxss825fP72Vzshkod5oBvej+h+tbjRrvMsgd628R/IaKkTR+HimPM/hTPrNR2zEXAp/2UhJ400SxTZQ9eRb4O6ZA8ySVogFDm2tIWR8y2bCCSZIg5ksG9eS1XuH/vnPkvilzGhHWUaBVrxTo2gD0vuL6qX/Ncd+XHIe2qUw68CcSKPScziuJ4VFy3ehJh5AnmmjGb7dW1cCqm8LFCrEJdcUgKHgb42NRSM97GbxnxbRwHHo4EqEbUyhAD/tYApidOOn6BNwhnwbnrGtbHpD1MjVpOgW9dmGhSyKM6PhXEBAMZh0ZUjqgMkDCSy88ob3vmmoiMcYJYjYe5cDR9mv9da83a8ckyG8rZ6RZ1kvACo/1XDgFZ4b0qhvIyfpExAFRd0yCjjLgwHyX2kiQtMZiwRKix+iPiCWHQ== cardno:000606705651 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function aws-code() { | |
ykman oath -s bastion-account | |
} | |
function aws-vault-exec() { | |
local role_name=$1 | |
export AWS_ACCOUNT=$role_name | |
shift | |
local command=$@ | |
local extra_args="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env es6 */ | |
'use strict'; | |
var assert = require('assert'); | |
let harness = (req, res, callback, next) => { | |
try { | |
assert.equal(typeof callback, 'function'); | |
} catch (E) { | |
return callback(E); | |
} | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
############################################################################## | |
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # | |
# # | |
# Licensed under the Amazon Software License (the 'License'). You may not # | |
# use this file except in compliance with the License. A copy of the # | |
# License is located at # | |
# # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INIT='eval $(docker-machine env docker5)' | |
PARSE = 'echo parse_url("http://google.com#@example.com/", PHP_URL_HOST);' | |
READ = 'echo readfile("http://google.com#@example.com/");' | |
versions = [] | |
14.upto 25 do |i| | |
versions << "7.0.#{i}" |
NewerOlder