SSH into Root
$ ssh [email protected]
Change Root Password
| class AddAuthenticationTokenToUsers < ActiveRecord::Migration | |
| def change | |
| add_column :users, :authentication_token, :string | |
| end | |
| end |
| # app/controllers/api/v1/api_controller.rb | |
| module Api::V1 | |
| class ApiController < ApplicationController | |
| rescue_from ActiveRecord::RecordNotFound, :with => :request_not_found | |
| before_filter :authenticate_user_from_token! | |
| before_filter :authenticate_user! | |
| def invalid_request | |
| @response = Hash.new |
| set-option -g xterm-keys on | |
| set -g default-terminal "xterm" | |
| set -g utf8 | |
| set-window-option -g utf8 on | |
| # ---------------------- | |
| # set some pretty colors | |
| # ---------------------- | |
| # set pane colors - hilight the active pane |
| class Dropbox | |
| constructor: -> | |
| @options = | |
| success: @success | |
| cancel: -> | |
| # Do something | |
| linkType: 'direct' | |
| multiselect: true | |
| extensions: [ | |
| '.jpg' |
| # Sidekiq interaction and startup script | |
| files: | |
| "/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh": | |
| mode: "000755" | |
| content: | | |
| #!/bin/bash | |
| . /opt/elasticbeanstalk/hooks/common.sh | |
| . /opt/elasticbeanstalk/support/envvars |
| class RealtiesController < ApplicationController | |
| before_action :set_realty, :only => [:update] | |
| def update | |
| @realty.status = 3 | |
| if @realty.update_attributes(realty_update_params) | |
| redirect_to conta_imoveis_path | |
| end |
SSH into Root
$ ssh [email protected]
Change Root Password
| $ lsof -i:8090 | |
| COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
| ssh 75782 eoin 5u IPv6 0x01c1c234 0t0 TCP localhost:8090 (LISTEN) | |
| $ kill -9 75782 |
| import random | |
| def encontrar_saida_on2(parede, posicao, porta): | |
| """Procura uma valor True no vetor fazendo um loop entre faixas | |
| A faixa inicial e 0, ou seja, a busca inicial sera posicao - faixa => posicao + faixa | |
| 0,0 | |
| Se a porta nao for encontrada a faixa e incrementada | |
| Args: |
| AuthName "Admins Only" | |
| AuthUserFile /home/path/to/.htpasswds/public_html/wp-admin/passwd | |
| AuthGroupFile /dev/null | |
| AuthType basic | |
| require user username |