Skip to content

Instantly share code, notes, and snippets.

View jim3ma's full-sized avatar
🎯
Focusing

Jim Ma jim3ma

🎯
Focusing
View GitHub Profile
@RichardWithnell
RichardWithnell / RPi
Last active August 2, 2017 20:56
MPTCP Raspberry Pi
git clone http://github.com/richardwithnell/mptcp-rpi
make mrproper
# 64 Bit
# export CCPREFIX=/home/richard/Software/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
# 32 Bit
export CCPREFIX=/home/richard/Software/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-
make ARCH=arm CROSS_COMPILE=$CCPREFIX bcmrpi_defconfig
make ARCH=arm CROSS_COMPILE=$CCPREFIX menuconfig
make -j3 ARCH=arm CROSS_COMPILE=$CCPREFIX
anonymous
anonymous / gist:5543343
Created May 8, 2013 20:22
Golang major minor device numbers
package main
import (
"flag"
"fmt"
"syscall"
// #include <sys/sysmacros.h>
"C"
)
# coding: utf-8
# 更新于2017/10/02,python3测试通过
import re
import requests
# 领取 X 铜币
# 每日登录奖励已领取
base_headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.57 Safari/537.36 OPR/40.0.2308.15 (Edition beta)', 'Referer': 'https://www.v2ex.com/signin', 'Origin': 'https://www.v2ex.com'}
@arturo-c
arturo-c / python-to-es.py
Created August 26, 2016 19:45
sample python to es
import base64
import datetime
import json
import os
import time
import traceback
import urlparse
import botocore.auth
import botocore.awsrequest
@nak3
nak3 / mptcp_rpm_install.md
Last active October 26, 2021 08:58
mptcp kernel RPM package install instructions

Description

mptcp_kernel is the kernel package which built with mptcp (MultiPath TCP) function. The source code is hosted in github .

The RPM package is hosted on Fedora copr. It can be used on Fedora and CentOS (only x86_64) and their some versions..

####WARNING

This package is now still working in progress and being tested by Kenjiro Nakayama. Please don't use it in your production system. And this is not official repository and please take full responsibility for your actions.

?: your client unchoked the peer but the peer is not interested
D: currently downloading from the peer (interested and not choked)
d: your client wants to download, but peer doesn't want to send (interested and choked)
E: peer is using Protocol Encryption (all traffic)
e: peer is using Protocol Encryption (handshake)
F: peer was involved in a hashfailed piece (not necessarily a bad peer, just involved)
H: peer was obtained through DHT
h: peer connection established via UDP hole-punching
I: peer established an incoming connection
K: peer unchoked your client, but your client is not interested
@ekalinin
ekalinin / linux.sh
Created January 9, 2017 06:17 — forked from marcan/linux.sh
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@nazgee
nazgee / main.cpp
Created April 16, 2012 07:52
linux file descriptors passing between processes
#include <errno.h>
#include <string.h>
#include <iostream>
#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@zaius
zaius / background.sh
Created January 16, 2011 23:29
How to redirect a running process output to a file and log out
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
@vkobel
vkobel / hash_kernel_module.c
Last active August 19, 2023 13:35
Example of using the Linux Kernel Crypto API for SHA256 hashing (tested with 5.6)
#include <linux/module.h>
#include <crypto/hash.h>
struct sdesc {
struct shash_desc shash;
char ctx[];
};
static struct sdesc *init_sdesc(struct crypto_shash *alg)
{