This file contains hidden or 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
| // Demonstration video can be found at: https://youtu.be/roAerKVfq-Y | |
| // StopEC2Instance | |
| const AWS = require('aws-sdk'); | |
| exports.handler = (event, context, callback) => { | |
| const ec2 = new AWS.EC2({ region: event.instanceRegion }); | |
| ec2.stopInstances({ InstanceIds: [event.instanceId] }).promise() |
This file contains hidden or 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
| Vagrant.configure(2) do |config| | |
| ... | |
| id_rsa_pub = File.read("#{Dir.home}/.ssh/id_rsa.pub") | |
| config.vm.provision "copy ssh public key", type: "shell", | |
| inline: "echo \"#{id_rsa_pub}\" >> /home/vagrant/.ssh/authorized_keys" | |
| end |
This file contains hidden or 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/env ruby | |
| # encoding: utf-8 | |
| # By Uğur Özyılmazel, @vigobronx | @ugurozyilmazel | |
| # http://vigodome.com | http://ugur.ozyilmazel.com | https://github.com/vigo | |
| def get_paged_memory_usage(match_string, paging=4096) | |
| mvar = 3 | |
| if match_string.split(/[^\w]/).length > 1 | |
| mvar = 4 |