sudo su - postgres
psql
CREATE USER wwwuser WITH PASSWORD 'password';
CREATE DATABASE wwwuser OWNER wwwuser;
GRANT ALL PRIVILEGES ON DATABASE wwwuser to wwwuser;
| require 'color' | |
| jqplot_colors = [ | |
| "240, 192, 19, 1", | |
| "217, 135, 20, 1", | |
| " 16, 178, 199, 1", | |
| " 15, 153, 168, 1", | |
| "235, 155, 220, 1", | |
| "247, 57, 197, 1", | |
| "220, 237, 203, 1", |
| require 'openssl' | |
| require 'base64' | |
| # 参考 http://qydev.weixin.qq.com/wiki/index.php?title=加解密方案的详细说明 | |
| AES_KEY = 'aaaa' | |
| encrypted_enchostr = 'bbbb' | |
| def parse_msg(text) | |
| random = text[0..16] |
| #!/bin/bash | |
| # Teamcity buildagent daemon start/stop script. | |
| ### BEGIN INIT INFO | |
| # Provides: Teamcity buildagent | |
| # Required-Start: $local_fs $network $remote_fs | |
| # Should-Start: ypbind nscd ldap ntpd xntpd | |
| # Required-Stop: $local_fs $network $remote_fs | |
| # Default-Start: 2 3 4 5 |
| # http://www.imagemagick.org/script/command-line-options.php#append | |
| # append two images vertically | |
| # conver -append first.png second.png result.png | |
| MiniMagick::Tool::Convert.new do |convert| | |
| convert.append.- | |
| convert << "first.png" | |
| convert << "second.png" | |
| convert << "result.png" | |
| end |
sudo su - postgres
psql
CREATE USER wwwuser WITH PASSWORD 'password';
CREATE DATABASE wwwuser OWNER wwwuser;
GRANT ALL PRIVILEGES ON DATABASE wwwuser to wwwuser;
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>系统升级中</title> | |
| <meta name="viewport" content="width=device-width,initial-scale=1"> | |
| <style> | |
| body { | |
| background-color: #EFEFEF; | |
| color: #2E2F30; | |
| text-align: center; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>test</title> | |
| <script type="text/javascript" src="//cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> | |
| <script type="text/javascript"> | |
| $(function(){ | |
| $.get('http://huimin-media0.smart-museum.cn/pano/bingmayong/one.html', function(html) { |
| # gem 'i18n_generators' | |
| # rails g i18n_translation zh-CN | |
| require 'yaml' | |
| local = YAML.load_file(Rails.root.join('config/locales/translation_zh-CN.yml')) | |
| models = local.dig('zh-CN', 'activerecord', 'models') | |
| attributes = local.dig('zh-CN', 'activerecord', 'attributes') | |
| models.each do |key, value| |
| class CustomError < StandardError | |
| # custom options to GraphQLError | |
| def options | |
| end | |
| end | |
| class MuationError < CustomError | |
| def initialize(key) | |
| @key = key | |
| message = I18n.t(key, scope: 'mutations.errors') |
| ActiveRecord::Base.connection.tables.each { |name| puts "VACUUM ANALYZE #{name}"; ActiveRecord::Base.connection.execute("VACUUM ANALYZE #{name};") } |