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
``` | |
activity_bonus_record = ActivityBonusRecord.create( | |
activity_id: activity_user.activity_id, | |
user_id: parent.id, | |
bonus: bonus, | |
response: response, | |
redpack_url: response["redpack_url"], | |
redpack_sn: response["redpack_sn"] | |
) | |
template = { |
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
Just got it working after 2 hours of tinkering. | |
For Ubuntu 14.04, libgeos 3.4.2, and RGeo 0.3.20 in Rails 4.2.1: | |
sudo apt-get -y install libgeos-3.4.2 libgeos-dev libproj0 libproj-dev | |
sudo ln -s /usr/lib/libgeos-3.4.2.so /usr/lib/libgeos.so | |
sudo ln -s /usr/lib/libgeos-3.4.2.so /usr/lib/libgeos.so.1 | |
In the Gemfile: | |
gem 'rgeo', require: false | |
Good luck! |
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
Steps that worked for me on Ubuntu 8.04.2 to remove postgres 8.3 | |
List All Postgres related packages | |
dpkg -l | grep postgres | |
ii postgresql 8.3.17-0ubuntu0.8.04.1 object-relational SQL database (latest versi | |
ii postgresql-8.3 8.3.9-0ubuntu8.04 object-relational SQL database, version 8.3 | |
ii postgresql-client 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL (latest ve | |
ii postgresql-client-8.3 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL 8.3 |
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
如果系统是ubuntu12,系统默认自带Postgresql9.1,首先我们把它删除了! | |
步骤: | |
1、列出关于postgre9.1的包 | |
dpkg -l | grep postgres | |
如果是9.1,下面列表的8.3就是9.1,有一些包可能没有,是系统而定。 | |
ii postgresql 8.3.17-0ubuntu0.8.04.1 object-relational SQL database (latest versi | |
ii postgresql-8.3 8.3.9-0ubuntu8.04 object-relational SQL database, version 8.3 | |
ii postgresql-client 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL (latest ve | |
ii postgresql-client-8.3 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL 8.3 | |
ii postgresql-client-common 87ubuntu2 manager for multiple PostgreSQL client versi |
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
一、键盘风格 | |
UIKit框架支持8种风格键盘 | |
``` | |
typedef enum { | |
UIKeyboardTypeDefault, // 默认键盘:支持所有字符 | |
UIKeyboardTypeASCIICapable, // 支持ASCII的默认键盘 | |
UIKeyboardTypeNumbersAndPunctuation, // 标准电话键盘,支持+*#等符号 | |
UIKeyboardTypeURL, // URL键盘,有.com按钮;只支持URL字符 | |
UIKeyboardTypeNumberPad, //数字键盘 |
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
新建源文件列表,把postgresql源单独添加在一个列表文件中 | |
sudo vi /etc/apt/sources.list.d/pgdg.list | |
在文件中添加内容(只适用于Ubuntu 12,发行版本名称为precise) | |
deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main | |
保存,退出。 | |
导入apt key | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \ | |
sudo apt-key add - | |
执行安装 | |
apt-get install postgresql libpq-dev |
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
使用rsync在两台VPS间传输文件 | |
如果你的VPS上有个文件要传到另一个VPS上,最最简单的方法有两种。一个是先下载到本地,然后上传到另一个VPS,这个方法的缺点是速度慢。另一个方法是放到http可以访问的目录下,然后在另一台VPS上使用wget命令下载,这个方法的缺点是操作较为麻烦,需要分别登陆两台VPS,而且无法使用自动脚本。当然还有一个方法,可以克服上面两个方法的缺点,这就是本文要讲的rsync。 | |
rsync介绍 | |
rsync是通过SSH的方法,将VPS上的文件传输到另一台VPS,它需要建立密钥认证。其最大的优点在于,建立了密钥认证以后,只需要在一台VPS操作,就可以实现两台VPS间的数据同步。这个优点主要是针对于自动脚本,这样可以很方便地用于数据定时备份同步。 | |
rsync使用方法 | |
首先假设在VPS1中有个文件/root/file.tar要传到VPS2的home目录中。 |
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
配置 Ubuntu Server 系统 | |
1 更新系统,有些教程建议修改网易的源,但是现在国内的vps提供商,都会提供快捷的源用作更新,所以可以系统默认就可以。 | |
``sudo apt-get update`` | |
2 安装必要的三方库 | |
``sudo apt-get install -y wget vim build-essential openssl libreadline6 libreadline6-dev libmysqlclient-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev libcurl4-openssl-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev nodejs libpq-dev`` | |
3 按照rbenv | |
``git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
# 用来编译安装 ruby | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build |
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
# STEP 1: VERIFY THAT YOU DO NOT ALREADY HAVE POSTGRESQL INSTALLED ON YOUR SYSTEM | |
ps ax | grep postgres | |
# STEP 2: INSTALL POSTGRESQL ON YOUR SYSTEM | |
sudo apt-get update | |
sudo apt-get install postgresql-9.1 | |
# List All Postgres related packages | |
dpkg -l | grep postgres |