Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View daimajia's full-sized avatar
🏓
Ping <--> Pong

代码家 daimajia

🏓
Ping <--> Pong
View GitHub Profile
@daimajia
daimajia / awesome-php.md
Last active December 17, 2015 16:49 — forked from sineld/awesome-php.md

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should be using:

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

@daimajia
daimajia / useful-css-snippets.css
Created May 25, 2013 14:19
useful css snippets
/*
*reset css
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
@daimajia
daimajia / appjs-express-jade-example.js
Last active December 18, 2015 00:19
nodejs / appjs / express / jade example
/*
author: daimajia
name: appjs Express example
email: daimajia@gmail.com
any question feel free to email me :)
*/
@daimajia
daimajia / gist:8205945
Last active January 1, 2016 21:49
Machine Learning Library Collection
public class Solution {
private Map<Integer, ArrayList<Integer>> maps = new TreeMap<Integer, ArrayList<Integer>>();
public List<List<Integer>> zigzagLevelOrder(TreeNode root) {
zigzag(root, 0);
return new ArrayList<List<Integer>>(maps.values());
}
public void zigzag(TreeNode node, int level){
// http://www.v2ex.com/t/139818#reply90
var start = Date.now();
var sum = 0;
for(var i = 0; i <= 1000000000; ++i){
sum += i;
}
var end = Date.now();
var span = end - start;
console.log(span / 1000 + " seconds");

测试平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2

运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件