Skip to content

Instantly share code, notes, and snippets.

@md-5
md-5 / Nettyadaptor.java
Created Nov 19, 2012
Netty socket adaptor
View Nettyadaptor.java
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOption;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketAddress;
View EncryptionUtil.java
package net.md_5.bungee;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.net.URL;
import java.net.URLEncoder;
import java.security.InvalidKeyException;
import java.security.Key;
@md-5
md-5 / BitPacking.java
Created Oct 14, 2012
BitPacking.java
View BitPacking.java
public class App
{
public static void main(String[] args) throws Exception
{
for (byte art = 0; art < 24; art++)
{
for (byte data = 0; data < 4; data++)
{
byte packed = pack(art, data);
View NBT.java
/**
* Copyright (c) 2012, md_5. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
@md-5
md-5 / 1-0.java
Created Sep 16, 2012
Java NIO Webservers
View 1-0.java
package net.shadowraze.vote4diamondz;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@md-5
md-5 / comments.txt
Created Sep 15, 2012
Sure you can add comments
View comments.txt
<roxlu> hey guys, it looks like it's not possible to add comments to gists anymore?
<roxlu> It didn't work a couple of days before but I thought it was just me doing something wierd... but today I get the same thing
@md-5
md-5 / App.java
Created Sep 6, 2012
Why Netty is awesome.
View App.java
package com.md_5.jcaptive;
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
import io.netty.channel.ChannelInitializer;
View javaModule.java
package in.znc.java;
import java.util.Collection;
public abstract class JavaModule {
private final String name;
public JavaModule(String name) {
this.name = name;
View Znc.C
#include <stdio.h>
#include <jni.h>
JNIEnv* create_vm()
{
JavaVM* jvm;
JNIEnv* env;
JavaVMInitArgs args;
JavaVMOption options[1];
@md-5
md-5 / FlagBot.rb
Created Aug 26, 2012 — forked from danopia/FlagBot.rb
IRC bot to run a Stripe CTF2 level8 cracking command automatically. Integrates with XChat.
View FlagBot.rb
#!/usr/bin/env ruby
$server = 'irc.stripe.com'
$channel = '#level8'
$nick = 'FlagBot'
$chanfile = '~/.xchat2/xchatlogs/NETWORK-\#level8.log'
$sshpath = 'user-hawkwarded@level02-4.stripe-ctf.com'
$command = 'ruby bot.rb'
$store = './flags.rb'