Skip to content

Instantly share code, notes, and snippets.

@llj098
llj098 / pa.vim
Created November 12, 2010 06:12
a small enhancement of vim
" File: pa.vim
" Author: llj098<llj098@gmail.com>
" Description: my plugin for myself
" Last Modified: 十一月 12, 2010
if exists('loaded_pa') || &cp || version < 700
finish
endif
let loaded_pa= 1
@llj098
llj098 / vimpress plus
Created November 22, 2010 08:28
vimpress multiuser support
" Copyright (C) 2007 Adrien Friggeri.
"
" This program is free software; you can redistribute it and/or modify
" it under the terms of the GNU General Public License as published by
" the Free Software Foundation; either version 2, or (at your option)
" any later version.
"
" This program is distributed in the hope that it will be useful,
" but WITHOUT ANY WARRANTY; without even the implied warranty of
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@llj098
llj098 / Makefile
Created November 27, 2010 03:07
a software switch written with the netfilter framework
obj-m += switch.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clear
@llj098
llj098 / Makefile
Created December 23, 2010 01:36
a sample tcp server runs in kernel
obj-m += tcp_svr_sample.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea
@llj098
llj098 / skiplist.h
Created December 20, 2011 10:19
a simple skiplist implementation
//author liulijin<llj098@gmail.com>
//licence New BSD
#ifndef __SKIPLIST_H_
#define __SKIPLIST_H_
#include <stdio.h>
#include <stdlib.h>
@llj098
llj098 / MonoSortedSet.cs
Created March 30, 2012 03:07
SortedSet<T> comparison between Mono and Microsoft
//
// SortedSet.cs
//
// Authors:
// Jb Evain <jbevain@novell.com>
//
// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@llj098
llj098 / AsyncEnumerator.cs
Created May 16, 2012 12:22
A Simple AsyncEnumerator Implementation
using System;
using System.Net;
using System.Collections;
using System.Collections.Generic;
class Test
{
public static void Main(string[] args) {
@llj098
llj098 / crc32.c
Created June 3, 2012 13:02
crc alg from freebsd source code
/*-
* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or
* code or tables extracted from it, as desired without restriction.
*/
/*
* First, the polynomial itself and its table of feedback terms. The
* polynomial is
* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0
*
@llj098
llj098 / pptp
Last active December 10, 2015 01:48
#!/bin/bash
if [ $(id -u) != "0" ]; then
printf "Error: You must be root to run this tool!\n"
exit 1
fi
clear
printf "
####################################################
# #
<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
<channel>
<generator>
clj-rss
</generator>
<link>
http://www.zhihu.com/read
</link>
<title>