Ctrl+KB | toggle side bar |
Ctrl+Shift+P | command prompt |
Ctrl+` | python console |
Ctrl+N | new file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in /etc/sysctl.conf | |
# net.ipv4.ip_forward=1 | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT | |
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT | |
iptables -A FORWARD -j REJECT | |
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ryu.base import app_manager | |
from ryu.controller import ofp_event | |
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER | |
from ryu.controller.handler import set_ev_cls | |
from ryu.ofproto import ofproto_v1_3 | |
from ryu.lib.packet import packet | |
from ryu.lib.packet import ethernet | |
class SimpleSwitch13(app_manager.RyuApp): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- | |
Linux 基于策略的路由(Linux Policy Routing) | |
Linux 有传统的基于数据包目的地址的路由算法,和新的基于策略的路由算法 | |
新算法优点:支持多个路由表,支持按数据报属性(源地址、目的地址、协议、端口、数据包大小、内容等)选择不同路由表 | |
# 查看规则命令,后面可跟其它参数,默认为 show(list) 显示全部 | |
ip rule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef int heap_elem_t; | |
typedef struct heap_t | |
{ | |
int size; | |
int capacity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int s,temp,i,j,a[20]; | |
printf("Enter total no. of elements:"); | |
scanf("%d",&s); | |
printf("Enter %d elements:",s); | |
for(i=0;i<s;i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf8 -*- | |
# 下载速度很慢, | |
import urllib2, urllib | |
import sys | |
import os | |
import socket | |
import re | |
import socks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SHORTCUT="[Desktop Entry] | |
Name=Sublime Text 2 | |
Comment=Edit text files | |
Exec=/usr/local/sublime-text-2/sublime_text | |
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png | |
Terminal=false | |
Type=Application | |
Encoding=UTF-8 | |
Categories=Utility;TextEditor;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SHORTCUT="[Desktop Entry] | |
Name=Sublime Text 2 | |
Comment=Edit text files | |
Exec=/usr/local/sublime-text-2/sublime_text | |
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png | |
Terminal=false | |
Type=Application | |
Encoding=UTF-8 | |
Categories=Utility;TextEditor;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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/. |
NewerOlder