Skip to content

Instantly share code, notes, and snippets.

View z4yx's full-sized avatar
☢️

Yuxiang Zhang z4yx

☢️
View GitHub Profile
@z4yx
z4yx / gogs.c
Created October 13, 2014 15:38
fix LD_LIBRARY_PATH and set user id
#include <sys/types.h>
#include <sys/types.h>
#include <pwd.h>
#include <limits.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int main(int argc, char **argv_src)
{
@z4yx
z4yx / ip
Last active August 29, 2015 14:10
Tsinghua IPv6 Tunnel
#!/bin/sh
echo "Content-type: text/plain"
echo ""
ifconfig eth0.2
-- =================================================
--
-- =================================================
proto = Proto("tible","TI BLE CC2540Dongle")
-- =================================================
-- Read reserve other protocol fileds
-- =================================================
usb_transtype_f = Field.new("usb.transfer_type") -- BULK=0x03
usb_datalen_f = Field.new("usb.data_len")
//libusb+ch340 data transfer demo
//gcc usb.c `pkg-config libusb-1.0 --libs --cflags` -o usb
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/select.h>
#! /usr/bin/env python
import sys
from optparse import OptionParser
import random
import math
def hfunc(index):
if index == -1:
return 'MISS'
#include <stdio.h>
#include <unistd.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <linux/if_ether.h>
#include <linux/if_tun.h>
#include <assert.h>
#include <memory.h>
#include <fcntl.h>
#include <poll.h>
@z4yx
z4yx / render.c
Created December 13, 2016 13:33
simple text render
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <locale.h>
#include <glib.h>
#include <glib/gstdio.h>
@z4yx
z4yx / u-boot.log
Last active March 3, 2019 14:54
u-boot on NaiveMIPS
initcall: 8000da50
initcall: 80033c4c
initcall: 8001b610
initcall: 8000de70
initcall: 8000daa8
initcall: 80000808
initcall: 8000deb4
initcall: 8000de58
malloc_simple: size=18, ptr=18, limit=600: 807fe950
malloc_simple: size=54, ptr=6c, limit=600: 807fe968
#!/usr/bin/env python
# -*- coding: utf8 -*-
import os
import json
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkalidns.request.v20150109 import DescribeDomainRecordsRequest,AddDomainRecordRequest,DescribeSubDomainRecordsRequest,UpdateDomainRecordRequest,DeleteDomainRecordRequest
# 创建 AcsClient 实例
client = AcsClient(
@z4yx
z4yx / rhel-nginx-module.md
Last active March 12, 2020 12:03
如何为rhel编译nginx module (how to compile dynamic nginx modules on rhel)

下载源码

wget 'http://nginx.org/packages/centos/7/SRPMS/nginx-1.14.2-1.el7_4.ngx.src.rpm'
rpm -i nginx-1.14.2-1.el7_4.ngx.src.rpm
tar -xf rpmbuild/SOURCES/nginx-1.14.2.tar.gz

下载module源码