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
| # script has to be run as root | |
| apt-get update | |
| apt-get install postgresql postgresql-contrib | |
| apt-get install libpq-dev | |
| su - postgres | |
| createuser --interactive |
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
| --- | |
| # The paths in which to look for gems | |
| # :gempath: | |
| # Force specification of gem server host on push | |
| # disable_default_gem_server: | |
| sources: | |
| - http://gems.rubyforge.org/ | |
| - http://rubygems.org/ |
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
| # Check if a port is open using iptables | |
| $ iptables -nL | grep |
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
| require "active_record" | |
| namespace :db do | |
| db_config = YAML::load(File.open('config/database.yml')) | |
| db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
| desc "Create the database" | |
| task :create do | |
| ActiveRecord::Base.establish_connection(db_config_admin) |
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
| #!/bin/bash | |
| # REQUIRES SUDO | |
| # Benchmark runner | |
| repeats=20 | |
| output_file='benchmark_results.csv' | |
| command_to_run='echo 1' | |
| run_tests() { | |
| # -------------------------------------------------------------------------- |
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
| What is docker ? | |
| Docker is a container runner/manager. Docker containers wrap up a piece of software | |
| in a complete filesystem that contains everything it needs to run: code, runtime, | |
| system tools, system libraries – anything you can install on a server. This guarantees | |
| that it will always run the same, regardless of the environment it is running in. | |
| ## Install (ubuntu 14.04) | |
| $ uname -a |
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
| What is docker ? | |
| Docker is a container runner/manager. Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in. |
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
| if Moped.logger == Rails.logger | |
| Moped.logger = Logger.new($stdout) | |
| true | |
| else | |
| Moped.logger = Rails.logger | |
| false | |
| 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
| PRECDENCE = { | |
| '(' => 0, | |
| ')' => 0, | |
| '+' => 1, | |
| '-' => 1, | |
| '*' => 2, | |
| '/' => 2 | |
| } | |
| class Expression |
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
| ... | |
| # possible options and possible values | |
| # use nil to use any values | |
| VALID_OPTIONS = { | |
| type: %w(default success info warning danger), | |
| name: nil | |
| } | |
| ... |