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 / 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|
# author: jianing.yang@gmail.com
###############################################################################
#
# core
#
###############################################################################
backend = "glx"
mark-wmwin-focused = true;
mark-ovredir-focused = true;
@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~
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 / 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"
@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 / 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 / docker-py-test.py
Created November 24, 2016 06:37
docker-py-test.py
from __future__ import absolute_import, unicode_literals
from docker import Client as DockerClient
from time import sleep
def run_and_output(cli, c, cmd):
exe = cli.exec_create(c['Id'], cmd=cmd, tty=True)
stream = cli.exec_start(exec_id=exe['Id'], stream=True)
i = 0
/*
* filename : background.cpp
* created at : 2016-10-21 11:28:31
* author : Jianing Yang <jianingy.yang@gmail.com>
*/
#include "background.h"
task_t TASKS[10] = {NULL};
(setq package-archives '(("gnu" . "http://elpa.emacs-china.org/gnu/")
("melpa" . "http://elpa.emacs-china.org/melpa/")))