require "socket"
server = TCPServer.open(2626)
loop do
Thread.fork(server.accept) do |client|
client.puts("Hello, I'm Ruby TCP server", "I'm disconnecting, bye :*")
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
| # Export | |
| mysqldump -u [uname] -p[pass] db_name > db_backup.sql | |
| # Import | |
| mysql -u <username> -p <databasename> < <filename.sql> | |
| # Pull file from server | |
| scp -P 10000 -i ~/.ssh/framgia/id_rsa edu@113.164.228.14:/home/edu/ac_backup.sql ~/ |
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 puma | |
| threads_max = ENV.fetch("RAILS_MAX_THREADS"){ 5 }.to_i | |
| threads_min = ENV.fetch("RAILS_MIN_THREADS"){ 1 }.to_i | |
| threads threads_min, threads_max | |
| # Specifies the `port` that Puma will listen on to receive requests, default is 3000. | |
| # | |
| # port ENV.fetch("PORT") { 3000 }.to_i | |
| # Specifies the `environment` that Puma will run 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
| #!/usr/bin/env puma | |
| directory "/home/deploy/wsm_production/current" | |
| rackup "/home/deploy/wsm_production/current/config.ru" | |
| # Default to production | |
| rails_env = "production" | |
| environment rails_env |
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
| params = [] | |
| questions = $('div[style="background-color: white; box-sizing: border-box; color: #444444; font-family: Arial, sans-serif; font-size: 16px; line-height: 25.6px; margin-bottom: 1.5em; padding: 0px; text-rendering: auto !important; vertical-align: baseline; word-wrap: break-word;"]'); | |
| questions.each(function() { | |
| if ($(this).text().indexOf('Answers:') < 0) { | |
| question_params = {} | |
| question_params.content = $(this).text(); | |
| question_params.subject_id = 18; | |
| question_params.user_id = 7; |
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
| {"user":{"avatar":"iVBORw0KGgoAAAANSUhEUgAAA8AAAAPACAIAAAB1tIfMAAAAYXpUWHRSYXcgcHJvZmlsZSB0eXBlIGlwdGMAAHjaPYaxEYBACARzqrAE/jkOvh40MDOw/xEN3Ju5XTmvu2T7sBRLTCzsit7PWKN0MrqAQKGc7pE2w3mwyLa/171b0iWoKg+hExPxXW453gAAARRpQ0NQaWNtAAAokWNgYOLJSc4tZhJgYMjNKykKcndSiIiMUmC/w8DIIMnAzKDJYJmYXFzgGBDgw4ATfLsGVA0El3VBZuFWhxVwpaQWJwPpP0Acl1xQVMLAwBgDZHOXlxSA2BlAtkhSNphdA2IXAR0IZE8AsdMh7CVgNRD2DrCakCBnIPsMkO2QjsROQmJD7QUB5mQjEl1NBChJrSgB0W5ODAygMIWIIsIKIcYsBsTGDAxMSxBi+YsYGCy+AsUnIMSSZjIwbG9lYJC4hRBTWcDAwN/CwLDtfHJpURnUaikgPs14kjmZdRJHNvc3AXvRQGkTxY+aE4wkrCe5sQaWx77NLqhi7dw4q2ZN5v7ay4dfGvz/DwDeQVN9MTo3JgAAIABJREFUeF7s3XmcZFV5PvDnPbe23peZYUYQUBAFNYoSIbjGxC2aX6JGTTSJiRHXxC1xRUWBEBc0LC644YJCRCEuqKjBiAYRRRAQFGTfhtlneq27nHPe3x9V1dMz0z23qru2W/V8P2NPT3tu01331r1PnXrve0RVQURERERE9TFpA4iIiIiIaDcGaCIiIiKiBjBAExERERE1gAGaiIiIiKgBDNBERERERA1ggCYiIiIiagADNBERERFRAxigiYiIiIgawABNRERERNQABmgiIiIiogYwQBMRERERNYABmoiIiIioAQzQREREREQNYIAmIiIiImoAAzQRERERUQMYoImIiIiIGsAATURERETUAAZoIiIiIqIGMEATERERETWAAZqIiIiIqAEM0EREREREDWCAJiIiIiJqAAM0EREREVEDG |
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 -l | |
| mkdir -p reports/xml | |
| #source /var/jenkins/.env | |
| rvm use 2.3.0 | |
| RAILS_ENV=test | |
| if [ ! bundle exec gem list bundler -i ]; |
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
| rails_env = ENV["RAILS_ENV"] || "development" | |
| workers_procs = {production: 4, staging: 2} | |
| workers_procs.default = 2 | |
| worker_processes workers_procs[rails_env.to_sym] | |
| app_directory = "/home/nguyen.binh.dieu/ranking_#{rails_env}/current" | |
| working_directory app_directory # available in 0.94.0+ | |
| listen "#{app_directory}/tmp/sockets/unicorn.sock", backlog: 128 |
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
| INSERT INTO hr_ranking_development.users (`email`, `display_name`, `uid`, `division_id`, `section_id`, `group_id`, `team_id`, `join_date`, `resigned_date`, `position`, `created_at`, `updated_at`, `avatar`) SELECT `email`, `display_name`, `uid`, `division_id`, `section_id`, `group_id`, `team_id`, `join_date`, `resigned_date`, `position`, `created_at`, `updated_at`, `avatar` FROM hr_production.users; |
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
| set :sync_directories, ["public/assets", "public/galleries"] | |
| set :sync_backups, 3 |