- http://serverfault.com/questions/416787/nginx-403-forbidden-error-hosting-in-user-home-directory
- rails deploy with rvm, capistrano, uniron, nginx
大家都知道,互联网上充斥着大量的明文传输方式,可以说绝对是不安全地带。那么,我们如何保证在不安全的互联网中更可靠的传输重要数据呢?个人认为最好的方式之一就是使用 GPG 工具进行加密。此文只是简单介绍了 GPG 的常规用法,重在推广和普及 GPG 加密工具,详细的使用请参见 GPG 手册。
RSA / DSA / ElGamal : 是指加密算法
GPG :(全称 GnuPG ) 是一款非对称加密(PGP)的免费软件,非对称加密方式简单讲就是指用公钥加密文件,用私钥解密文件。如果你想给谁发送加密信息,首先你要得到他的公钥,然后通过该公钥加密后传给他,对方利用自已的私钥就可解密并读取文件了。
2019-06-03
Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.
# encoding: UTF-8 | |
class GxApp | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
include Mongoid::Sequence | |
store_in session: "gxservice" | |
field :name, type: String, default: "Guanxi.me" | |
field :version, type: String |
Linux and Unix operating systems comes in a wide range of flavors often bundled as different distributions by different vendors. Every one of these distribution also comes with an often pre-defined and latest version of the Linux kernel. Sometimes you need to know the exact name and version of your operating system, machine as well as the kernel, be it to install the correct version of a software, find if a hardware is compatible or be it to upgrade your OS itself. There are several ways to check your operating system and linux kernel versions. As each distribution (or distros) are slightly different some of the commands might work in some distros while some maynot.
uname
is the linux command which prints out the name, versions and other details of the machine and kernel running on the machine. It is basically short for Unix Name. This is usually part of the core-utils package and should be available on almost all distros. There are several options available to print out just the kernel detail
class UserObserver < Mongoid::Observer | |
def after_save(record) | |
expire_cache(record) | |
end | |
private | |
def expire_cache(record) | |
Rails.cache.delete("user:#{record.id}") | |
end |
In this article, I'll walk through a basic Rails (3.2.x) setup for creating a nested resource for two models. Nested resources work well when you want to build out URL structure between two related models, and still maintain a RESTful convention. This code assumes you are running RVM to manage Ruby/Gem versions, and Git for version control.
$ mkdir family # create rvm gemset
$ echo "rvm use --create ruby-1.9.2@family" > family/.rvmrc
$ cd family # install rails
$ gem install rails # create new rails project
$ rails new . # version control
- execute the
top
command - one line is tasks:
- Example output:
Tasks: 63 total, 1 running, 61 sleeping, 0 stopped, 1 zombie
- Example output:
require 'axlsx' | |
Axlsx::Package.new do |package| | |
workbook = package.workbook | |
workbook.add_worksheet do |sheet| | |
wrap = workbook.styles.add_style alignment: {wrap_text: true} | |
sheet.add_row ["Foo\r\nBar", "Foo\rBar", "Foo\nBar", "Foo\n\r\nBar"], style: wrap | |
end | |
package.serialize "linebreak.xlsx" |
- 查看MySQL服务器配置信息
mysql> show variables;
- 查看MySQL服务器运行的各种状态值
mysql> show global status;