Skip to content

Instantly share code, notes, and snippets.

View mani95lisa's full-sized avatar

Mani Wang mani95lisa

  • Pamakids
  • BeiJing
View GitHub Profile
<!DOCTYPE html>
<html ng-app="mgcrea.ngStrapDocs">
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<script>
document.write('<base href="' + document.location + '" />');
</script>
<link rel="stylesheet" href="style.css" />
mkdir /var/local/tmp
cd /var/local/tmp
wget https://gist.githubusercontent.com/mani95lisa/6520782/raw/493ff109988bde965dc2d37a653886ebd57bc529/install_nodejsV0.10.9.sh
sudo sh install_nodejsV0.10.9.sh
wget https://gist.githubusercontent.com/mani95lisa/6607004/raw/e0338f9861936c2a346ed68b7e6509884a77a923/redis.conf
mkdir /etc/redis
mv redis.conf /etc/redis
wget -O /etc/init.d/redis https://gist.githubusercontent.com/mani95lisa/7766989/raw/4d328f653a4196ceb1179b429f5180f23f82ff57/redis
chmod +x /etc/init.d/redis
cp /etc/rc.local /etc/rc.local.tmp
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'}}
//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;
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
@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
//
// 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
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'
@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
# 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