This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Very simple mysql breaker | |
* DEVELOPER: shura, member of HUF, see https://hackers-uf.org/ | |
* | |
* This program is free software. It comes without any warranty, to | |
* the extent permitted by applicable law. You can redistribute it | |
* and/or modify it under the terms of the Do What The Fuck You Want | |
* To Public License, Version 2, as published by Sam Hocevar. See | |
* http://sam.zoy.org/wtfpl/COPYING for more details. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# who the fuck said Ruby couldn't be hacky, NEVER DO THIS IT IS STUPID | |
# AND DOING IT WRONG TOO | |
require 'socket' | |
# DEBUG {{{ | |
class TCPSocket | |
alias __gets__ gets | |
def gets(*args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# require rack fastcgi {{{ | |
require 'rack/handler/fastcgi' | |
# support for ruby 1.9.x {{{ | |
class FCGI; class ValuesRecord | |
def self::read_length(buf) | |
if buf.getbyte(0) >> 7 == 0 | |
buf.slice!(0, 1).getbyte(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def redefine_method(meth) | |
return unless block_given? | |
oldmeth = self.instance_method(meth) | |
self.send(:define_method, meth) {|*args| | |
yield(oldmeth.bind(self), *args) | |
} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage example: | |
# ruby -r/path/to/this/file 'Euler.execute 1' | |
# library {{{ | |
require 'benchmark' | |
require 'fffs' | |
fs = FFFS::FileSystem.parse(__FILE__ == $0 ? DATA : File.read(__FILE__).split(/^__END__$/, 2).last) #DATA doesn't work if required | |
class NilClass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'prime' | |
require 'net/http' | |
puts "1: " + Net::HTTP.get(URI.parse('http://challenge.greplin.com/static/gettysburg.txt')).tap {|str| | |
break (0...str.size).flat_map {|i| | |
(i..str.size).inject([]) {|r, j| | |
str[i..j].tap {|chunk| | |
break chunk == chunk.reverse ? r << chunk : r | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cgi' | |
require 'webrick' | |
require 'net/http' | |
class Index < WEBrick::HTTPServlet::AbstractServlet | |
INDEX = DATA.read | |
def do_GET(request, response) | |
response.status = 200 | |
response['Content-Type'] = "text/html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage: gitio URL [CODE] | |
# | |
# Turns a github.com URL | |
# into a git.io URL | |
# | |
# Copies the git.io URL to your clipboard. | |
require 'net/http' | |
require 'clipboard' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include <X11/Xlib.h> | |
#include <stdio.h> | |
#define WINDOW_PROPERTY(prop) XGetWindowProperty(dpy,\ | |
w,\ | |
XInternAtom(dpy, (prop), True),\ | |
0,\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Please insert this in your crontab | |
# 0 * * * * /path/to/script | |
CONFIG = { | |
host: 'smtp.gmail.com', | |
port: 587, | |
user: 'shura1991', | |
pass: '******', | |
sender: '[email protected]', |
OlderNewer