Skip to content

Instantly share code, notes, and snippets.

@legastero
legastero / send_image.py
Last active October 10, 2021 16:12
Send an image in a chat message with SleekXMPP
import logging
import threading
import sleekxmpp
logging.basicConfig(level=logging.DEBUG)
class Bot(sleekxmpp.ClientXMPP):
def __init__(self, jid, password):
@ptz0n
ptz0n / gist:1217080
Created September 14, 2011 16:51
Validate JSONP Callback
<?php
/**
* Validate JSONP Callback
*
* https://github.com/tav/scripts/blob/master/validate_jsonp.py
* https://github.com/talis/jsonp-validator/blob/master/src/main/java/com/talis/jsonp/JsonpCallbackValidator.java
* http://tav.espians.com/sanitising-jsonp-callback-identifiers-for-security.html
* http://news.ycombinator.com/item?id=809291
*
@gumblex
gumblex / zip64.py
Created November 14, 2015 11:16
Simple Python command line utility to create Zip64 files.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Simple command line utility to create Zip64 files.
For Python 3.3+
Most code are from the standard library `zipfile` and `shutil`.
"""
@tuxzz
tuxzz / ruce_pcode
Created July 10, 2015 09:30
RUCE_PCode
Function main(arg)
{
/* 解析参数 */
RUCE_UnitParam para = RUCE_ParsePara(arg);
/* 从输入文件名提出音名 例如a.wav变成a */
String inputPath = para.input;
String outputPath = para.output;
String inputFileName = BaseFromFilePath(inputPath);
String inputDirName = DirFromFilePath(inputPath);
@dantmnf
dantmnf / duppkt.rb
Created December 20, 2014 12:12
script to duplicate outgoing TCP packets
#!/usr/bin/env ruby
require 'socket'
require 'pcaprub'
require 'packetfu'
IDENTIFY_TTL = 105
interface = 'eth0'
DUPS = 1 # number of duplicated packet(s)
SIOCGIFINDEX = 0x8933