Skip to content

Instantly share code, notes, and snippets.

View huzhifeng's full-sized avatar

Zhifeng Hu huzhifeng

View GitHub Profile
@huzhifeng
huzhifeng / _service.md
Created January 10, 2017 01:26 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@huzhifeng
huzhifeng / 0-openwrt-auto-mount-readme.md
Last active September 14, 2016 23:53 — forked from lanceliao/0-openwrt-auto-mount-readme.md
Auto mount USB storage device by uuid on OpenWrt
  1. Install USB device support;
opkg install kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-storage e2fsprogs fdisk usbutils mount-utils block-mount kmod-fs-ext4 kmod-fs-vfat kmod-nls-utf8 kmod-nls-cp437 kmod-nls-iso8859-1

reboot
  1. Install blkid, run opkg update && opkg install blkid;
  2. Copy block.sh to directory /lib/functions;
  3. Copy 10-mount and 20-swap to directory /etc/hotplug.d/block;
  4. That's it! run logread -f command then plug in a USB stick to test.
@huzhifeng
huzhifeng / Linux Static IP
Created August 10, 2016 09:13 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static

Specs

  • CoovaChilli 是一个开源的软件访问控制工具(access controller), 基于曾经流行的ChilliSpot项目, 并且被原来的ChilliSpot贡献者们维护.
  • CoovaChilli 是一个功能丰富的软件访问控制工具提供一个网页认证(captive portal) / walled-garden 环境和使用RADIUS或者HTTP协议来访问控制(access provisioning)和账户认证(accounting).
  • CoovaChillis是CoovaAP OpenWRT固件的一部分, 专门用于热点.

Details

拓扑图

References

#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
struct {
char buffer[1024];