Skip to content

Instantly share code, notes, and snippets.

View duper's full-sized avatar

The Super Duper duper

View GitHub Profile
def webget(ur, fn)
=begin
File.open(fn, 'wb'){|f|
Net::HTTP.get_response(URI.parse(ur)){|r|
r.read_body{|c|
f.write(c)
}
}
}
=end
irb(main):001:0> p {}.blank?
NoMethodError: undefined method `blank?' for nil:NilClass
from (irb):1
from /home/super/bin/irb:12:in `<main>'
irb(main):002:0> require'dmap/mixins/blank'
=> true
irb(main):003:0> p {}.blank?
=> true
irb(main):004:0> {}.blank?
NoMethodError: undefined method `blank?' for {}:Hash
@duper
duper / Rainbow Tables External Universal Serial Bus Version 3.0 Hard Disk Drive
Created October 22, 2015 22:53
2TB USB3.0 External HDD Filled With Pre-Computed Hashes a.k.a. "Rainbow Tables", DRIZZLECHAIR/A51 for GSM (Global System for Mobile Communications; voice and data) alnum-symbol32-space, NTLM (New Technology Local Area Network Manager), MD5 or Message Digest Five ([a-z0-9]){1,8} and MD5([a-z][A-Z][0-9]){1,7}
PS G:\> Get-Item *; Write-Host ""; Get-ChildItem -Recurse . -Name 'md5s.txt' | %{Get-Content $_}
Directory: G:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2/14/2015 4:46 PM DRIZZLECHAIR
d---- 2/14/2015 7:11 PM lm_alpha-numeric-symbol32-space
d---- 2/14/2015 7:49 PM md5_loweralpha-numeric_1-8
d---- 2/14/2015 9:58 PM md5_mixalpha-numeric_1-7
@duper
duper / gist:ac2c67cdc5e7be1ab9c8
Created February 28, 2016 20:41
Former inspircd/src/users.cpp code for ANSI coloring irc.security.chat PDU's (now replaced with much better syntax)
#include<ctime>
using namespace std;
/*
using clock() here precludes the need for any pseudo-random number generation
implementation which would take up tons of room.. get_text_color also makes a
nice anonymous function if C++11 funcptr lambda closure call syntax can be used
*/
@duper
duper / anope.h
Created February 28, 2016 20:44
Interesting code from include/anope.h of anope-2.0.3 regarding the optimization of ADT parameterization
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
* for debug builds and static_cast on releass builds
* to speed up the program because dynamic_cast relies on RTTI.
*/
#ifdef DEBUG_BUILD
# include <typeinfo>
template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
{
T ret = dynamic_cast<T>(ptr);
if (ptr != NULL && ret == NULL)
#include<stdio.h>
#include<stdlib.h>
#include<sysexits.h>
#include<arpa/inet.h>
_Noreturn static void usage(const char *restrict arg0) {
fprintf(stdout, "\nusage\033[39m:\033[m \033[30;47m%s LONG\033[m\n", arg0);
fprintf(stdout, " \033[36mLONG unsigned long integer\033[m\n\n");
fprintf(stdout, "ex. \033[33;44m%s 80\033[m\n\n", arg0);
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@duper
duper / regex
Created June 21, 2016 16:45 — forked from gurre/regex
Useful regexes
<?php
define('REGEX_ALPHA',"{[A-ZÅÄÖa-zåäö\s\-]+}");
define('REGEX_ALPHANUMERIC',"{[0-9A-ZÅÄÖa-zåäö\s\-]+}");
define('REGEX_ALPHANUMERICSIGNS',"{[0-9A-ZÅÄÖa-zåäö\s\-\_\.\:\,\;\(\)\?\!\&\/\=]+}");
define('REGEX_NUMERIC',"{^(-){0,1}([0-9]+)(,[0-9][0-9][0-9])*([.][0-9]){0,1}([0-9]*)$}");
define('REGEX_DIGIT','{[0-9]+}');
define('REGEX_EMAIL',"{^[a-z0-9\å\ä\ö._-]+@[a-z0-9\å\ä\ö.-]+\.[a-z]{2,6}$}i");
define('REGEX_SWEMOBILE',"{((46)|(0))((70)|(73)|(76))([\d+]{6,7}$)}");
define('REGEX_ENCODED',"{[A-Za-z\-\_\,\*]+}");
define('REGEX_PERMALINK','{[a-z0-9\-\_]+}');
<?php
// set up terminal colorization
define('T_RESET',"\33[0m");
define('T_BLACK',"\33[0;30m");
define('T_DARKGRAY',"\33[1;30m");
define('T_BLUE',"\33[0;34m");
define('T_LIGHTBLUE',"\33[1;34m");
define('T_GREEN',"\33[0;32m");
define('T_LIGHTGREEN',"\33[1;32m");
define('T_CYAN',"\33[0;36m");
@duper
duper / malware-list
Created June 21, 2016 16:46 — forked from gurre/malware-list
Malware domains to block in /etc/hosts
0.0.0.0 000007.ru
0.0.0.0 0000mps.webpreview.dsl.net
0.0.0.0 0001.2waky.com
0.0.0.0 024xuyisheng.com
0.0.0.0 0452jhw.com
0.0.0.0 0511zfhl.com
0.0.0.0 0532qdzxmr.com
0.0.0.0 0632qyw.com
0.0.0.0 09cd.co.kr
0.0.0.0 0fees.net