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
# frozen_string_literal: true | |
require "stackprof" | |
require "optparse" | |
require "yaml" | |
require "json" | |
# To use run the script with: ruby cleanup_io_wait_and_gc_stacks.rb -s source_file.json -d destination_file.json | |
# To avoid interrupting the root frames when IO wait or garbage collection happens we modify the raw data to merge |
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
module ChoicesHelpers | |
def select_from_choices(item_text, options) | |
field = find_field(options[:from], visible: false) | |
within(find("##{field[:id]}", visible: false).ancestor(".choices")) do | |
find(".choices__inner").click | |
find("input").send_keys(item_text, :return) | |
end | |
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
# Using nsenter you will be able to attach to a running docker container | |
# SSH into the EBS instance | |
# See what containers are running | |
docker ps | |
# Install nsenter | |
docker run -v /usr/local/bin:/target jpetazzo/nsenter |
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
<?php | |
class Conf { | |
public static $SERVER_NAME; | |
public static $SERVER_DB; | |
public static function init_values() { | |
self::$SERVER_NAME = "$NAME"; | |
self::$SERVER_DB = "$DB"; | |
} |
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
// I could not find a easy way to mass insert environment variables when migrating a project to EBS, | |
// this variables were in a config file so I decided to transform them into a array and write this script | |
// to allow easy insertion and update. | |
// To use this script fill the variables_array with your variables and then go to AWS Console, | |
// open your EBS environment, go to Configuration tab and then Software Configuration, | |
// you should see a table of Environment Properties. Open the browser console and use the scripts below. | |
// NOTICE: The combined size of all environment variables defined for an environment is limited to 4096 bytes. | |
// NOTICE: This script was done in January 2016, it might not work if AWS console is updated. |