Skip to content

Instantly share code, notes, and snippets.

View alazyer's full-sized avatar

Yuliang Zhang alazyer

  • Nanjing
View GitHub Profile
@alazyer
alazyer / pprcd.py
Created March 11, 2014 03:12 — forked from dgleich/pprcd.py
import collections
import sys
# setup the graph
G = {
1:set([ 2, 3, 5, 6,]),
2:set([ 1, 4,]),
3:set([ 1, 6, 7,]),
4:set([ 2, 5, 7, 8,]),
5:set([ 1, 4, 6, 8, 9, 10,]),
Following the this [simple tmux tutorial](http://www.sitepoint.com/tmux-a-simple-start/)
# 1. install tmux1.8 in ubuntu
```sh
~$ sudo add-apt-repository ppa:pi-rho/dev
~$ sudo apt-get update
~$ sudo apt-get install tmux
```
@alazyer
alazyer / curl.md
Created March 10, 2014 00:39 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
安装完win7后,再安装Ubuntu默认启动项则成了ubuntu,要想改成默认启动win7的话需要对ubuntu中配置文件进行修改。
sudo gedit /boot/grub/grub.cfg
将 set default="0" 改为 set default="4"即可。
原来的0表示开机的时候选择的是第一个启动项,即Ubuntu,
改为4后就是我们想要的win7了。中间还有三个分别是
advanced option for Ubuntu,
Memory test (memtest86+)
1. create a mysite.conf file in the /etc/apache2/sites-available directory. Fill it with
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
# configure the wsgi script
WSGIScriptAlias / wsgi.py
WSGIPythonHome virtualenv dir
WSGIPythonPath project_root: site-packages_dir_in_the_virtualenv
<VirtualHost *:8000>
To get the version info of the Apache installed on my ubuntu,
open a terminal and type:
1. apache2 -v
or
2. /usr/sbin/apache2 -v
#!/usr/bin/env python
"""
"""
import random
import igraph
from numpy import mean, nan_to_num, nan
from pprint import pprint
import nose
import logging
logging.basicConfig(level=logging.DEBUG)
# The YUM package is too old for use with ruby-sqlite3, use the autoconf package from www.sqlite.org
cd /opt
wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
tar xvzf sqlite-autoconf-3070701.tar.gz
ln -s /opt/sqlite-autoconf-3070701 /opt/sqlite3
cd /opt/sqlite3
./configure --prefix=/opt/sqlite3
make
make install