Skip to content

Instantly share code, notes, and snippets.

View gnuhub's full-sized avatar
🎯
Focusing

gnuhub gnuhub

🎯
Focusing
  • Mars
View GitHub Profile

测试平台: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     #编译所需要的软件
@timsutton
timsutton / issues.txt
Created February 24, 2014 19:44
Start of a VirtualBox OS X Packer template.
Two main issues:
1) Packer currently always uses an IDE storage controller, but in VBox only a SATA DVD image seems to be useful to boot the installer.
2) The disk device in the guest shows up as removable drive rather than an internal SATA, and this seems to confuse AutoPartition.app and make it not see a drive to partition. I'm not sure if there are some options that could be passed to AutoPartition to make it see the drive as partition-able. This is just one more reason why switching to some auto-partitioning shell code in /etc/rc.common might be better off than relying on AutoPartition.
@lukewpatterson
lukewpatterson / gist:6491377
Last active January 27, 2016 08:19
db2 in docker
FROM base
RUN echo "deb http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list
RUN echo "deb-src http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list
RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list
RUN echo "deb-src http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get --yes install ksh
Locate the section for your github remote in the `.git/config` file. It looks like this:
```
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
```
Now add the line `fetch = +refs/pull/*/head:refs/remotes/origin/pr/*` to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
@ecarreras
ecarreras / pr.md
Created September 17, 2012 09:50 — forked from kennethreitz/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

Now add this lines:

[remote "github"]
	url = [email protected]:joyent/node.git
	fetch = +refs/pull/*/head:refs/remotes/github/pr/*
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@isao
isao / git-pullrequest.sh
Created June 6, 2012 17:57 — forked from CyberShadow/git-pullrequest.sh
Easy GitHub pull requests
#!/bin/bash -e
# based on Vladimir Panteleev's https://gist.github.com/1885859
die() {
echo "$@" >&2
exit 1
}
branch=$(git name-rev --name-only HEAD 2>/dev/null)
ghusr=$(git config --get github.user)
@DamienCassou
DamienCassou / update-emacs-ppa.sh
Last active February 20, 2016 21:26
Emacs-snapshot and emacs24 build script for Ubuntu PPA
#! /usr/bin/env bash
# Author: Damien Cassou
#
# This is the script I use to build Emacs packages for Ubuntu. These
# packages are uploaded to
# https://launchpad.net/~cassou/+archive/emacs/. Each package is
# either build from a Debian package or from
# http://emacs.naquadah.org/.
@fujin
fujin / foo.rb
Created January 31, 2012 21:49
template override between cookbooks
template "/tmp/foo.rb"
source "foo.rb.erb"
cookbook "banana"
end
@jbenet
jbenet / current_utc_time.c
Created July 17, 2011 16:17
work around lack of clock_gettime in os x
/*
author: jbenet
os x, compile with: gcc -o testo test.c
linux, compile with: gcc -o testo test.c -lrt
*/
#include <time.h>
#include <sys/time.h>
#include <stdio.h>