This file contains 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
# Package generated configuration file | |
# See the sshd_config(5) manpage for details | |
# What ports, IPs and protocols we listen for | |
Port 22 | |
# Use these options to restrict which interfaces/protocols sshd will bind to | |
#ListenAddress :: | |
#ListenAddress 0.0.0.0 | |
Protocol 2 | |
# HostKeys for protocol version 2 |
This file contains 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
ActiveAdmin.setup do |config| | |
# == Site Title | |
# | |
# Set the title that is displayed on the main layout | |
# for each of the active admin pages. | |
# | |
config.site_title = "污妖王的后台,比你硬而且粗" | |
config.authorization_adapter = "AdminPermissionAdapter" | |
config.current_user_method = :current_user | |
config.authentication_method = :authenticate_admin! |
This file contains 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
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf | |
set-option -g status-bg colour235 #base02 | |
set-option -g status-fg colour136 #yellow | |
set-option -g status-attr default | |
# set window split | |
bind-key v split-window -h | |
bind-key b split-window | |
# default window title colors |
This file contains 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
## try_files all request except /api, /admin/api | |
upstream backend_api { | |
server ip_address; | |
} | |
server { | |
listen 80; | |
server_name t66y.domain.com; | |
index index.html; | |
charset utf-8; |
This file contains 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
use Rack::Session::Cookie, key: 'sidekiq.session', secret: ENV['secret_base_key'] | |
Sidekiq::Web.class_eval do | |
use Rack::Protection, origin_whitelist: [ENV['domain']] # resolve Rack Protection HttpOrigin | |
end |
This file contains 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
class Ability | |
include CanCan::Ability | |
def marshal_dump | |
@rules.reject{|rule| rule.instance_variable_get :@block }.map {|rule| Marshal.dump(rule)} | |
end | |
def marshal_load _binary_arr | |
@rules ||= [] | |
_binary_arr.map do |rule| |
This file contains 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 'bundler' | |
Bundler.require(:default, ENV.fetch("RACK_ENV")) | |
SOCK_FILEPATH = "./rack.sock" | |
Rack::Handler::FastCGI.run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ["It Works"]] }, File: SOCK_FILEPATH |
This file contains 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
## query condition and display line | |
## select line number | |
cat puma.stdout.log | grep '<condition>' -n | awk '{split($0, a, ":I"); print a[1]}' | |
## select range | |
export h=head -n1 | |
export t=tail -n1 | |
sed -n '$(h),$(t)p' puma.stdout.log | less -N |
This file contains 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
initdb -D /usr/local/var/postgres # create database cluster directory for postgresql | |
createuser -s postgres # create postgre role |
This file contains 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
cat file.log | grep 'matcher' | |
export line_number=12333 | |
sed -n '${line_number},$p' file.log | less |
OlderNewer