Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
python3 bot.py
@dendisuhubdy
dendisuhubdy / rsacrack.py
Created October 20, 2015 02:41
Cracking the RSA cyprtosystem time
import gmpy, time, random, math
def genprime(bits):
p=1
while(gmpy.is_prime(p)==0):
p = random.randrange(math.pow(2,bits-1),math.pow(2,bits))
return p
BITS=20
found=False
@claudijd
claudijd / gist:6ce45deabb154ceb7efa
Last active April 26, 2016 14:09
Good one-liner for OpenSSL s_server testing
openssl req -nodes -x509 -newkey rsa:2048 -keyout server.pem -out server.pem -days 1 && openssl s_server -tls1 -www -accept 1337
@deckerego
deckerego / jabtest.py
Created September 25, 2015 23:29
An example of using Jabber/XMPP communication with Python
import sleekxmpp
class Jabber(sleekxmpp.ClientXMPP):
def __init__(self, username, password, instance_name=None):
jid = "%s/%s" % (username, instance_name) if instance_name else username
super(Jabber, self).__init__(jid, password)
self.instance_name = instance_name
self.add_event_handler('session_start', self.start, threaded=False, disposable=True)
self.add_event_handler('message', self.receive, threaded=True, disposable=False)
@SalTor
SalTor / bs3-registration-form.html
Last active May 15, 2016 00:17
Bootstrap 3 Full Registration form
<div class="col-xs-12 col-sm-8 col-md-4 col-sm-offset-2 col-md-offset-4">
<form role="form">
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-4">
<div class="form-group">
<select name="" id="" class="form-control input-sm">
<option value="mr">Mr.</option>
<option value="mrs">Mrs.</option>
<option value="miss">Miss</option>
<option value="ms">Ms.</option>
#include <windows.h>
#if define UNICODE
#define RegOpenKeyEx RegOpenKeyExW
#define RegCreateKeyEx RegCreateKeyExW
#define RegDeleteKey RegDeleteKeyW
#else
#define RegOpenKeyEx RegOpenKeyExA
#define RegCreateKeyEx RegCreateKeyExA
#define RegDeleteKey RegDeleteKeyA
@cmdelatorre
cmdelatorre / id3.py
Last active February 22, 2018 16:03
Desicion tree classifier (ID3) algortihm
"""
http://en.wikipedia.org/wiki/ID3_algorithm
http://www.cise.ufl.edu/~ddd/cap6635/Fall-97/Short-papers/2.htm
"""
from collections import namedtuple, Counter, defaultdict
from math import log2
//we are planning to use filter concatenation on three input videos
var filterchain = Filterchain.FilterTo<VideoStream>(new Concat());
//we want our output to be encoded using the following settings:
// -c:v libx264
// -b:v 3000k
// -s 852x480
// -y
var settings = SettingsCollection.ForOutput(
new CodecVideo("libx264"),
@lelandbatey
lelandbatey / recursive_link_grab.py
Last active October 15, 2021 23:59
Recursive link gatherer -- great for `wgetting` an Apache directory
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created July 2, 2014 21:03
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update