Skip to content

Instantly share code, notes, and snippets.

View mani95lisa's full-sized avatar

Mani Wang mani95lisa

  • Pamakids
  • BeiJing
View GitHub Profile
@mani95lisa
mani95lisa / enable.swap
Created November 29, 2016 01:23
To enable the swap you can use for example:
To enable the swap you can use for example:
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
@mani95lisa
mani95lisa / node_init.sh
Last active August 29, 2015 14:25
node init
apt-get install nodejs npm git nginx curl imagemagick software-properties-common
npm install -g nrm
nrm use cnpm
ln -s `which nodejs` /usr/bin/node
#install new redis-server
sudo apt-add-repository ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get install redis-server
@mani95lisa
mani95lisa / yf.sh
Last active August 29, 2015 14:11
centos
#!/bin/sh
yum repolist
rpm -Uvh http://download-i2.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo yum install nodejs npm --enablerepo=epel
{
"log":{
"user":"gz7EgT4sfNInjv75Pe6MhGzd",
"passwd":"pGH1vBSeycEH9ZWCj9QkOt0pTYCEUpfP"
},
"mongo": "mongodb://bae:xt6e5Qrx93m1ebGHUpxHh7qB4CjnlKti@svridf3zd2q93fi.mongodb.duapp.com:10204/svridf3zd2q93fi",
"express": {
"view cache": false,
"view engine": "js",
"views": "path:./.build/templates",
{
"name": "research",
"version": "0.1.0",
"description": "User research platform",
"author": "Mani",
"main": "index.js",
"scripts": {
"test": "grunt test",
"start": "node index.js"
},
// Generated by CoffeeScript 1.7.1
(function() {
var XLSX, sheet_from_array_of_arrays, ws_name;
XLSX = require('xlsx');
sheet_from_array_of_arrays = function(data, opts) {
var C, R, cell, cell_ref, range, ws;
ws = {};
range = {
XLSX = require('xlsx')
sheet_from_array_of_arrays = (data, opts) ->
ws = {}
range =
s:
c: 10000000
r: 10000000
e:
@mani95lisa
mani95lisa / install_solr.sh
Created July 19, 2014 12:12
Ubuntu install solr
sudo apt-get -y install openjdk-7-jdk
mkdir /usr/java
ln -s /usr/lib/jvm/java-7-openjdk-amd64 /usr/java/default
sudo apt-get -y install solr-tomcat
//变量、常量、字符串、println
var 变量 = "变量" //可以用Unicode编码声明变量或常量了,但不推荐
var variable : String
var variableWithoutType = "无类型必初始化,自动继承值的类型"
let const = "常量必须初始化"
var interpolation = "字符串插入\(const)"
println("输出结果到控制台:\(interpolation)");println("分号仅用于分隔一行里的多语句,不建议这样使用")
//数
println(UInt8.min, UInt8.max) //(0, 255)
###################################################
# mongosback configuration file
##################################################
###################################################
# general settings
###################################################
PID_FILE="/var/run/mongosback.pid"