Skip to content

Instantly share code, notes, and snippets.

Sandy Xu sandyxu

  • Shanghai, China
Block or report user

Report or block sandyxu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sandyxu /
Created Jul 8, 2016
SSHKit::Runner::ExecuteError: Exception while executing git stderr: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).


SSHKit::Runner::ExecuteError: Exception while executing as gdw_dev@ git exit status: 128
git stdout: Nothing written
git stderr: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: The remote end hung up unexpectedly

SSHKit::Command::Failed: git exit status: 128
git stdout: Nothing written
sandyxu / gem-env-path
Last active Oct 28, 2015
Display information about the RubyGems environment
View gem-env-path
gem help environment
packageversion display the package version
gemdir display the path where gems are installed
gempath display path used to search for gems
version display the gem format version
remotesources display the remote gem servers
platform display the supported gem platforms
<omitted> display everything
sandyxu /
Created Jun 11, 2015
seo 优化细节

一、链接伪静态问题 1、分类链接,如:应伪静态重写成 2、标签链接,如:应伪静态重写成 3、分页标签,如:应为伪静态重写为

二、标签使用问题 1、h1标签,每个页面有且仅可使用一次;h2标签每个页面可使用多次。(全站所有页面均须自从此规则) 2、首页h1标签重复使用 3、首页新闻列表页未使用h2标签,新闻标题使用h2标签 4、新闻中心(标签应分配给每条新闻标题

sandyxu / _form.html.erb
Created Jun 11, 2015
how to use carrierwave
View _form.html.erb
<%= form_for do |f| %>
<%= f.label :file, '上传文档', class: 'btn btn-primary btn-sm' %>
<%= f.file_field :file %>
<span class="text-danger">文件大小不能超过20M</span>
<%= f.submit 'save', class: 'btn btn-primary btn-sm' %>
<% end %>
sandyxu / nginx.conf
Last active Aug 29, 2015
config and redirect all http to https in nginx
View nginx.conf
upstream ikcrm_www_development_unicorn {
server unix:/tmp/unicorn.ikcrm_www_development.sock fail_timeout=0;
server {
listen 80;
return 301 https://$server_name$request_uri;
server {
sandyxu /
Last active Aug 29, 2015 — forked from rajraj/
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
sandyxu / Linux 系统中的目录
Created Feb 26, 2015
Linux 系统中的目录
View Linux 系统中的目录
目录 评论
/ 根目录,万物起源。
/bin 包含系统启动和运行所必须的二进制程序。
包含 Linux 内核,最初的 RMA 磁盘映像(系统启动时,由驱动程序所需),和 启动加载程序。
/boot/grub/grub.conf or menu.lst, 被用来配置启动加载程序。
/boot/vmlinuz,Linux 内核。
sandyxu /
Last active Aug 29, 2015
config elasticsearch and ik Analysis (Chinese word)
View commands.txt
#1 Generate Public & Private Keypair
#2 Create receipt.json - eg below - careful with line-endings, etc if line breaks
#3 Create signature & Encode
openssl dgst -binary -sha1 -sign private.pem receipt.json | openssl base64 > signature.txt
#4 Verify using OpenSSL & public key
openssl base64 -d -in signature.txt -out signature.sha1 | openssl dgst -sha1 -verify public.pem -signature signature.sha1 receipt.json
View verify_appstore_in_app.php
function verify_app_store_in_app($receipt, $is_sandbox)
//$sandbox should be TRUE if you want to test against itunes sandbox servers
if ($is_sandbox)
$verify_host = "ssl://";
$verify_host = "ssl://";
$json='{"receipt-data" : "'.$receipt.'" }';
//opening socket to itunes
You can’t perform that action at this time.