Skip to content

Instantly share code, notes, and snippets.

@thefloweringash
thefloweringash / gist:1442127
Created December 7, 2011 09:20
Noppoo HID descriptors, original and modified with MacOS support.
#include <stdio.h>
#include <stdint.h>
#include "HIDReportData.h"
const uint8_t standard_descriptor_primary[] = {
HID_RI_USAGE_PAGE(8, 0x01),
HID_RI_USAGE(8, 0x06),
HID_RI_COLLECTION(8, 0x01),
HID_RI_USAGE_PAGE(8, 0x08),
@pklaus
pklaus / etc_config_network.md
Last active September 20, 2018 20:22
OpenWrt: Configure WiFi Client as WAN and set up a 2nd AP to redistribute the WAN-Access – http://goo.gl/bIVik

Please check here for an up-to-date config for a WISP (wireless ISP) setup on OpenWrt 14.07.

@Taehun
Taehun / nf.c
Created October 9, 2012 01:08
Linux Kernel Module Example: Netfilter
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netfilter_ipv4.h>
#include <linux/skbuff.h>
#include <linux/udp.h>
#include <linux/ip.h>
/* This function to be called by hook. */
static unsigned int
hook_func(unsigned int hooknum,
@rab
rab / .gitconfig
Last active May 14, 2024 07:05
A good starting point for ~/.gitconfig
# -*- Conf -*-
[color]
branch = auto
diff = auto
status = auto
showbranch = auto
ui = true
# color.branch
# A boolean to enable/disable color in the output of git-branch(1). May be set to always, false (or
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
@ShenXuGongZi
ShenXuGongZi / shadowsocksconfig
Created July 30, 2013 12:40
群共享shadowsocks
服务器资源由 www.host700.com 提供 欢迎选购host700 vps
服务器ip:198.35.44.61
服务器端口:8338
服务密码:host700
加密方式:aes-256-cfb"
客户端下载: http://sourceforge.net/projects/shadowsocksgui/files/dist/ #注意里面有win 跟 mac linux的是什么系统就选什么就好了
@elmariofredo
elmariofredo / Fill_mikrotik_config.bash
Last active September 6, 2023 11:25
L2TP IPSEC VPN Auto config for mikrotik based on following tutorial http://www.nasa-security.net/mikrotik/mikrotik-l2tp-with-ipsec/ !!! Edit user name/user pass and ipsec secret
# Fetch and fill config
mikrotik_vpn_config=$(curl https://gist.github.com/elmariofredo/7232556/raw/VPN-L2TP-IPSEC.mikrotik \
| sed -e '
s/IPSEC_PEER_SECRET/somesecret/g;
s/USER1_NAME/mario/g;
s/USER1_PASS/somepass/g;
s/IP_RANGE/172.16.24.100-172.16.24.200/g;
s/DNS_SERVER/172.16.22.1/g;
s/LOCAL_ADDRESS/172.16.22.1/g;
s/WINS_SERVER/172.16.22.1/g')
@badsyntax
badsyntax / .bashrc
Last active July 14, 2016 03:50
My new bash PS1 prompt (on osx)
alias ls='ls -G'
source /usr/share/git-core/git-prompt.sh
source /usr/share/git-core/git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWCOLORHINTS=true
GIT_PS1_SHOWUNTRACKEDFILES=true
PS1="\n\[\e[01;34m\]┌─(\[\e[01;35m\]\u@${HOSTNAME%%.*}\[\e[01;34m\])"'$(__git_ps1 "──(\[\e[01;31m\]%s\[\e[01;34m\])")'"\[\e[01;34m\]\n\[\e[01;34m\]└─(\[\e[01;32m\]\w\[\e[01;34m\])──(\[\e[01;32m\]$ \[\e[01;37m\]"
@soarez
soarez / ca.md
Last active May 28, 2024 02:57
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@lanceliao
lanceliao / 1-redsocks2-openwrt.md
Last active April 24, 2023 16:05
在OpenWrt上配置redsocks2

redsocks2是一款透明socks5代理工具,能够实现智能代理的功能,这里是redsocks2在OpenWrt上的配置,配合shadowsocks使用。

redsocks.conf 是配置文件,放在/etc目录,将192.168.1.1改成路由器的地址. redsocks2.sh 为自启动文件,改名为redsocks2放到/etc/init.d目录即可。自启动文件假设redsocks可执行文件在/opt/bin目录。

启动redsocks2: /etc/init.d/redsocks2 start 停止redsocks2: /etc/init.d/redsocks2 stop

redsocks2 git源