Rails 3.0 introduced support for routing constrained by subdomains.
A subdomain can be specified explicitly, like this:
match '/' => 'home#index', :constraints => { :subdomain => 'www' }
tls: | |
certificates: | |
- certFile: /configuration/certs/domain.com.crt | |
keyFile: /configuration/certs/domain.com.key |
sudo apt-get update | |
sudo apt-get install libjemalloc-dev | |
RUBY_CONFIGURE_OPTS='--with-jemalloc' rbenv install 2.6.3 | |
# test (look for jemalloc warnings) | |
MALLOC_CONF=invalid_flag:foo ruby -v |
# lib/custom_logger.rb | |
class CustomLogger < Logger | |
def format_message(severity, timestamp, progname, msg) | |
"#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n" | |
end | |
end | |
logfile = File.open("#{Rails.root}/log/custom.log", 'a') # create log file | |
logfile.sync = true # automatically flushes data to file | |
CUSTOM_LOGGER = CustomLogger.new(logfile) # constant accessible anywhere |
--[[ | |
redis_factory.lua | |
Redis factory method. | |
You can also find it at https://gist.github.com/karminski/33fa9149d2f95ff5d802 | |
@version 151019:5 | |
@author karminski <[email protected]> | |
@license MIT |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# | |
# See http://www.cnblogs.com/ma6174/archive/2012/05/25/2508378.html | |
import pexpect | |
import paramiko | |
import threading | |
import yaml |
require_relative 'customer.rb' | |
require_relative 'contact.rb' | |
require_relative 'agent.rb' | |
module Api | |
module V1 | |
module Entities | |
class Ticket < Grape::Entity | |
expose :id |
2.1 原厂固件中,直接web页面升级 2.2 已刷openwrt的话,telent/ssh登录,下载bin文件到/tmp,运行'sysupgrade -i /tmp/openwrt-ar71xx-ubnt-rspro-squashfs-sysupgrade.bin'
/* ------------------------------ | |
Author: Fred Wu | |
------------------------------ */ | |
// colours | |
$error_colour: #e3302c; | |
$primary_colour: #0e3399; | |
$primary_colour_h: darken($primary_colour, 15%); |