Skip to content

Instantly share code, notes, and snippets.

View zheplusplus's full-sized avatar

Zhe Lin zheplusplus

View GitHub Profile
@zheplusplus
zheplusplus / ifcfg-enp0s8
Created August 17, 2015 06:58
ceph-virtualbox-guide-network-config
HWADDR=
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
function $extend(inherit, b) {
var base = b.$class;
for (var m in base) {
if (base.hasOwnProperty(k)) {
inherit[k] = base[k];
}
}
function ctor() {
this.constructor = inherit;
@zheplusplus
zheplusplus / setinterval.c
Created November 12, 2015 02:37
C timer example
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/epoll.h>
#include <sys/timerfd.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
void setnonblock(int sockfd)