Skip to content

Instantly share code, notes, and snippets.

View mani95lisa's full-sized avatar

Mani Wang mani95lisa

  • Pamakids
  • BeiJing
View GitHub Profile
#!/bin/sh
# Add MongoDB Package
echo "Add MongoDB Package"
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "MongoDB Package completed"
# Update System
echo "System Update"
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
@mani95lisa
mani95lisa / install inotify-tools on centos.sh
Created September 28, 2013 10:22
install inotify-tools on centos.sh
wget http://cloud.github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz
tar -zxvf inotify-tools-3.14.tar.gz
cd inotify-tools-3.14
./configure
make
make install
updatedb
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@mani95lisa
mani95lisa / redis
Created December 3, 2013 10:17
/etc/init.d/redis
#!/bin/sh
#
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis
REDISPORT=6379
wget http://devtools.qiniudn.com/qiniu-devtools-linux_amd64-current.zip
unzip qiniu*.zip
mv qrsync /usr/bin/qrsync
mv qboxrsctl /usr/bin/qboxrsctl
mv qetag /usr/bin/qetag
mv qrsboxcli /usr/bin/qrsboxcli
rm -f qiniu*.zip
//ActionScript3 upload file to qiniu.com
var u:URLRequest=new URLRequest('http://up.qiniu.com');
u.method=URLRequestMethod.POST;
u.requestHeaders=[new URLRequestHeader('enctype', 'multipart/form-data')];
var ur:URLVariables=new URLVariables();
ur.key='Your file name in qiniu.com';
ur.token='Your uptoken from server'; //Only this is required
ur['x:param'] = 'Your custom param and value';
u.data=ur;
var Hapi = require('hapi');
var internals = {};
internals.main = function () {
var server = new Hapi.Server(80, { files: { relativeTo: __dirname } });
server.route([
{ method: 'GET', path: '/{path*}', handler: { directory: { path: '/', listing:true } } },
{method: 'GET', path:'/', handler: {file:'/index.html'}}