Skip to content

Instantly share code, notes, and snippets.

View jianingy's full-sized avatar
💭
Restoring

Jianing Yang jianingy

💭
Restoring
View GitHub Profile
@jianingy
jianingy / PRU-GPIO-EXAMPLE.dts
Created October 10, 2016 03:59
PRU GPIO EXAMPLE
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green";
// identification
part-number = "PRU-GPIO-EXAMPLE";
version = "00A0";
@jianingy
jianingy / keymap_nby.c
Created September 18, 2016 01:11
My GH60 Keymap
#include "keymap_common.h"
/*
* HHKB-ALT Layout
*/
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: Default layer
* ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
* |-----------------------------------------------------------|
@jianingy
jianingy / Cargo.toml
Last active September 1, 2016 03:15
Global Clap Matches
[package]
name = "tryclap"
version = "0.1.0"
authors = ["Jianing Yang <jianingy.yang@gmail.com>"]
[dependencies]
lazy_static = "0.1.*"
[dependencies.clap]
version = "2"
def deserialize_remote_exception(conf, data):
failure = jsonutils.loads(str(data))
trace = failure.get('tb', [])
message = failure.get('message', "") + "\n" + "\n".join(trace)
name = failure.get('class')
module = failure.get('module')
# NOTE(ameade): We DO NOT want to allow just any module to be imported, in
# order to prevent arbitrary code execution.
@jianingy
jianingy / iodatagram.py
Last active November 15, 2017 12:11
udp / raw socket for python tornado
#
# This piece of code is written by
# Jianing Yang <jianingy.yang@gmail.com>
# with love and passion!
#
# H A P P Y H A C K I N G !
# _____ ______
# ____==== ]OO|_n_n__][. | |
# [________]_|__|________)< |YANG|
# oo oo 'oo OOOO-| oo\\_ ~o~~o~
# author: jianing.yang@gmail.com
###############################################################################
#
# core
#
###############################################################################
backend = "glx"
mark-wmwin-focused = true;
mark-ovredir-focused = true;
@jianingy
jianingy / snort-tornado.py
Last active December 3, 2019 03:05
read snort alert from unix domain socket
#!/virtualenvs/snort/bin/python
#
# This piece of code is written by
# Jianing Yang <jianingy.yang@gmail.com>
# with love and passion!
#
# H A P P Y H A C K I N G !
# _____ ______
# ____==== ]OO|_n_n__][. | |
# [________]_|__|________)< |YANG|
@jianingy
jianingy / python-logging.conf
Last active March 3, 2016 09:53
python-logging.conf
[loggers]
keys=root,business,business_debug
[handlers]
keys=console,business,business_debug,general
[formatters]
keys=tornado
[logger_root]
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 6021920 272424 5282908 0 0 7 11 10 41 2 1 97 0 0
0 0 0 6020864 272424 5283004 0 0 0 86 527 2188 0 1 99 0 0
0 0 0 6015928 272424 5288764 0 0 0 0 480 1838 1 1 98 0 0
0 0 0 6015780 272424 5288700 0 0 0 30 561 2150 1 1 99 0 0
0 0 0 6015160 272424 5289108 0 0 0 550 618 1899 1 1 98 0 0
@jianingy
jianingy / wormhole-exploit.py
Created January 27, 2016 08:38
wormhole-exploit
import requests
import click
import sys
def fail(reason):
click.echo(click.style('[!] %s' % reason, fg='red'), err=True)
sys.exit(111)