Skip to content

Instantly share code, notes, and snippets.

View 0xh3x's full-sized avatar

Giorgi Jvaridze 0xh3x

View GitHub Profile
@0xh3x
0xh3x / gist:736050
Created December 10, 2010 10:12
md5 in pl/sql
CREATE OR REPLACE FUNCTION md5_digest(input_string IN VARCHAR2) RETURN VARCHAR2
IS
hex_digest varchar2(32);
digest varchar2(16);
BEGIN digest := DBMS_OBFUSCATION_TOOLKIT.MD5(INPUT_STRING => input_string);
SELECT Lower(RAWTOHEX(digest)) INTO hex_digest FROM dual;
RETURN hex_digest;
END;
@0xh3x
0xh3x / gist:736052
Created December 10, 2010 10:16
Oracle Multimedia
declare
v_img1 BLOB;
v_img2 BLOB;
begin
select t.data into v_img1 from my_images t;
@0xh3x
0xh3x / gist:736053
Created December 10, 2010 10:18
Captcha cracker
#!/usr/bin/python
# By Giorgi Jvaridze
# 13.10.2008
# [email protected]
def chk(t):
n0="00001111100000011100111100100111111000011111100100111100111000000111110000"
n1="011111101101111110010000000000000000000001111111110"
n2="011111101100111110010001111100010011111001100111100111001100011110000101111100"
DECLARE
TYPE rc IS REF CURSOR;
l_rc rc;
l_dummy all_objects.object_name%TYPE;
l_start number DEFAULT dbms_utility.get_time;
BEGIN
FOR i IN 1 .. 1000
LOOP
OPEN l_rc FOR
'select object_name
DECLARE
TYPE rc IS REF CURSOR;
l_rc rc;
l_dummy all_objects.object_name%TYPE;
l_start number DEFAULT dbms_utility.get_time;
BEGIN
FOR i IN 1 .. 1000
LOOP
OPEN l_rc FOR
'select object_name
create or replace procedure my_test_int is
n number;
begin
n := 0;
for i in 1 .. 10000 loop
for ii in 1 .. 80000 loop
n := n + 1;
n := n + 1;
end loop;
end loop;
alter session set plsql_code_type='NATIVE';
create or replace procedure my_test_nat is
n number;
begin
n := 0;
for i in 1 .. 10000 loop
for ii in 1 .. 80000 loop
n := n + 1;
n := n + 1;
end loop;
declare
l_start number DEFAULT dbms_utility.get_time;
begin
my_test_int;
dbms_output.put_line('my_test_int: ' ||
ROUND((dbms_utility.get_time - l_start) / 100, 2) || ' წამი...');
l_start := dbms_utility.get_time;
my_test_nat;
dbms_output.put_line('my_test_nat: ' ||
ROUND((dbms_utility.get_time - l_start) / 100, 2) || ' წამი...');
import os, shutil, sys
plsql_native_library_dir = 'plsqltest'
copy_to_dir = 'mydir'
while True:
for fl in os.listdir(plsql_native_library_dir):
if fl[-2:] == '.c':
shutil.copy(plsql_native_library_dir+fl, copy_to_dir+fl)
sys.exit()
$ wget "http://download.zeromq.org/zeromq-2.1.7.tar.gz"
$ tar zxvf zeromq-2.1.7.tar.gz
$ cd zeromq-2.1.7/