Skip to content

Instantly share code, notes, and snippets.

@Chion82
Chion82 / 来抢课了.js
Last active June 12, 2017 04:02
选课高亮提示
electCourseTable.config.time=500;
window.confirm=function(){
return true;
};
function updateCountHint(){
$('.stdCount').each(function(){
var numArray = $(this).html().split('/');
if (numArray[2] >= 1) {
$(this).css({'background-color':'red'});
if ($(this).parent().find('a[title="点击查看教学任务信息"]').html().indexOf('日语') !== -1) {
@Chion82
Chion82 / webpack-for-node-modules.js
Created May 16, 2017 08:57 — forked from mxstbr/webpack-for-node-modules.js
How to use webpack to compile node modules
/* eslint-disable no-var */
var path = require('path');
var autoprefixer = require('autoprefixer');
const MATCH_ALL_NON_RELATIVE_IMPORTS = /^\w.*$/i;
module.exports = [{
output: {
filename: '[name].js',
library: 'atrium-react-plugin-beta',
@Chion82
Chion82 / webpack-for-node-modules.js
Created May 16, 2017 08:57 — forked from mxstbr/webpack-for-node-modules.js
How to use webpack to compile node modules
/* eslint-disable no-var */
var path = require('path');
var autoprefixer = require('autoprefixer');
const MATCH_ALL_NON_RELATIVE_IMPORTS = /^\w.*$/i;
module.exports = [{
output: {
filename: '[name].js',
library: 'atrium-react-plugin-beta',
@Chion82
Chion82 / ip_flow.py
Last active October 3, 2018 09:17
客户端分IP上行流量统计
import os, json, subprocess, time
server_port = 8388
chain_name = 'ip_flow'
last_connected_clients = []
client_info = []
def get_client_list_from_file():
if not os.path.isfile('clients.json'):
bt-tracker=udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.skyts.net:6969/announce,udp://tracker.safe.moe:6969/announce,udp://tracker.piratepublic.com:1337/announce,udp://tracker.pirateparty.gr:6969/announce,udp://tracker.leechers-paradise.org:6969/announce,udp://allesanddro.de:1337/announce,udp://9.rarbg.com:2710/announce,http://p4p.arenabg.com:1337/announce,udp://p4p.arenabg.com:1337/announce,http://tracker.internetwarriors.net:1337/announce,udp://tracker.internetwarriors.net:1337/announce,http://tracker.opentrackr.org:1337/announce,udp://tracker.opentrackr.org:1337/announce,udp://public.popcorn-tracker.org:6969/announce,udp://tracker2.christianbro.pw:6969/announce,udp://tracker1.xku.tv:6969/announce,udp://tracker1.wasabii.com.tw:6969/announce,udp://tracker.zer0day.to:1337/announce,udp://peerfect.org:6969/announce,http://91.218.230.81:6969/announce,udp://tracker.mg64.net:6969/announce,udp://mgtracker.org:6969/announce,udp://ipv4.tracker.harry.lu:80/announce,http://tracker.mg64.net:6881/announce,ht
@Chion82
Chion82 / mirror-port.sh
Created May 22, 2018 15:56 — forked from lonelymtn/mirror-port.sh
Mirror traffic between two interfaces using Linux's traffic controll subsystem (tc)
#!/usr/bin/env bash
# Time-stamp: <2014-07-31 13:31:43 (ryanc)>
#
# Description: Mirror traffic between two interfaces using Linux's
# traffic control subsystem (tc)
trap cleanup EXIT
CLEANUP=1
SRC_IFACE=$1
@Chion82
Chion82 / tunnel.sh
Created June 3, 2018 09:32 — forked from vishvananda/tunnel.sh
Script to set up an ipsec tunnel between two machines For Example: ./tunnel.sh 10.10.10.1 10.10.10.2 192.168.0.1 192.168.0.2 would set up an ipsec tunnel over 10.10.10.1 address using 192.168.0.1 as a virtual address passwordless sudo required for user on remote machine
#!/bin/bash
if [ "$4" == "" ]; then
echo "usage: $0 <local_ip> <remote_ip> <new_local_ip> <new_remote_ip>"
echo "creates an ipsec tunnel between two machines"
exit 1
fi
SRC="$1"; shift
DST="$1"; shift
gcc -static -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes -Winline -pipe -DALL_INCLUSIVE -DENABLE_IPV4 -DENABLE_IPV6 -g -O2 -o xtables-multi-static xtables_multi-xtables-multi.o xtables_multi-iptables-xml.o xtables_multi-iptables-save.o xtables_multi-iptables-restore.o xtables_multi-iptables-standalone.o xtables_multi-iptables.o xtables_multi-ip6tables-save.o xtables_multi-ip6tables-restore.o xtables_multi-ip6tables-standalone.o xtables_multi-ip6tables.o xtables_multi-xshared.o ../extensions/libext.a ../libiptc/.libs/libip4tc.a ../extensions/libext4.a ../libiptc/.libs/libip6tc.a ../extensions/libext6.a ../libxtables/.libs/libxtables.a -lm -ldl
//Source: http://golubenco.org/atomic-operations.html
#ifndef _ATOMIC_H
#define _ATOMIC_H
/* Check GCC version, just to be safe */
#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC_MINOR__ < 1)
# error atomic.h works only with GCC newer than version 4.1
#endif /* GNUC >= 4.1 */
/**
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include "d3des.h"
#include "base64.h"
static const char *progname = "vmware-vncpassword";