SSH into Root
$ ssh [email protected]
Change Root Password
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "os" | |
| ) | |
| var path = "/Users/novalagung/Documents/temp/test.txt" |
SSH into Root
$ ssh [email protected]
Change Root Password
| # Usage: bundle exec rake sidekiq:restart RAILS_ENV=<environment name> | |
| namespace :sidekiq do | |
| sidekiq_pid_file = Rails.root+'tmp/pids/sidekiq.pid' | |
| desc "Sidekiq stop" | |
| task :stop do | |
| puts "#### Trying to stop Sidekiq Now !!! ####" | |
| if File.exist?(sidekiq_pid_file) | |
| puts "Stopping sidekiq now #PID-#{File.readlines(sidekiq_pid_file).first}..." |
| #!/bin/sh | |
| remove_dangling() { | |
| echo "Removing dangling images ..." | |
| docker rmi $(docker images -f dangling=true -q) | |
| } | |
| remove_stopped_containers() { | |
| echo "Removing stopped containers ..." | |
| docker rm $(docker ps -qa) |
$ cat ~/.ssh/id_rsa.pub | ssh USER@HOST "mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys; chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys"| source 'https://rubygems.org' | |
| gem 'puma' | |
| gem 'rails' | |
| ... |
| # Call scopes directly from your URL params: | |
| # | |
| # @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
| module Filterable | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| # Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
| # with their associated values. For example, "{ status: 'delayed' }" would call |
| BEFORE: | |
| sam@ubuntu discourse % rm -fr tmp/cache | |
| sam@ubuntu discourse % rm -fr public/assets | |
| sam@ubuntu discourse % time RAILS_ENV=production bin/rake assets:precompile | |
| 58.55s user 1.79s system 100% cpu 1:00.02 total | |
| AFTER: |
| CarrierWave.configure do |config| | |
| if Rails.env.development? || Rails.env.test? | |
| config.storage = :file | |
| else | |
| config.storage = :fog | |
| config.fog_credentials = { | |
| :provider => 'OpenStack', | |
| :openstack_auth_url => 'https://auth.selcdn.ru/v1.0', | |
| :openstack_username => Rails.application.secrets.openstack_username, | |
| :openstack_api_key => Rails.application.secrets.openstack_api_key |
| # | |
| # Acts as a nginx HTTPS proxy server | |
| # enabling CORS only to domains matched by regex | |
| # /https?://.*\.mckinsey\.com(:[0-9]+)?)/ | |
| # | |
| # Based on: | |
| # * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html | |
| # * http://enable-cors.org/server_nginx.html | |
| # | |
| server { |