Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Netham45

Pages: [1] 2 3 4
News / Incoming Downtime
« on: April 22, 2012, 03:20:15 pm »
There will be some slight downtime later today as we transition over to a new server. We're expecting at most an hour of downtime. Before then, there may be periodic slowness as large amounts of data are moved.

Edit: The site will lock now. It'll return once the DNS settings have propgated and moved over to the new domain.

Site Feedback and Questions / Stopforumspam dnsbl
« on: March 30, 2012, 01:54:32 pm »
I put a script on the site that will check with stopforumspam for every page request, thanks to their DNSBL. I'm hoping this will both cut down on bandwidth and spambot registrations.

An example of a bad request:

The requests are cached on my DNS server after the first request, so user impact should be minimal at worst.

Here's the script I'm using:

Code: [Select]
$publicKey = "<Recaptcha public key>";
$privateKey = "<Recaptcha private key>";
$whitelist = array();
$checkIP = (isset($_GET['ip']) && isset($_GET['testblock'])?$_GET['ip']:$_SERVER['REMOTE_HOST']);
$ip = explode(".",$checkIP);
$dnsRequest = "$ip[3].$ip[2].$ip[1].$ip[0]";
$requestResult = gethostbyname($dnsRequest);
$isBlocked = ($requestResult!=$dnsRequest);

if (isset($_GET['captcha']))
$array_postvars = array();
$array_postvars[] = 'privatekey=' . $privateKey;
$array_postvars[] = 'remoteip=' . $_SERVER['REMOTE_HOST'];
$array_postvars[] = 'challenge=' . $_POST['recaptcha_challenge_field'];
$array_postvars[] = 'response=' . $_POST['recaptcha_response_field'];

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, implode('&', $array_postvars));
curl_setopt($ch, CURLOPT_URL, "");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec($ch);
$error = curl_error($ch);
if ($result == "true\nsuccess")
$_SESSION['recaptcha'] = true;

header("location: index.php");

if (($isBlocked || isset($_GET['testblock'])) && !in_array($checkIP,$whitelist) && !isset($_SESSION['recaptcha']))
header('HTTP/1.0 403 Forbidden');
$file = file_get_contents("blocked_hosts.txt");
$file .= "\n[" . date("r") . "] Blocked: $checkIP " . ($isBlocked?"Block":"Test");
$errorCode = explode(".",$requestResult);
$errorCode = intval($errorCode[3]);
echo "<html>
Apologies, but your IP ($checkIP) is blacklisted as a spammer. <span style=\"color:#F00\">You have not been banned from Omnimaga</span>. If you believe this is in error, please e-mail
<a href=\";c=xOphTe00o_PsF0UW3DYNxgM6oLOdZ92RuAQvVkgZqQM=\" onclick=\"'\\07501zMDC5OWSs7zbYNzHfWcbLg\\75\\75\\46c\\75xOphTe00o_PsF0UW3DYNxgM6oLOdZ92RuAQvVkgZqQM\\075', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">[email protected]</a>
for help. Please remember to include your IP, $checkIP, in the message. This site is using the DNSBL provided by
<br/>Code received: $errorCode<br/>Blocked for:<br/><ul>";
if ($errorCode & 1) echo "<li>Proxy has been scanned</li>";
if ($errorCode & 2) echo "<li>Proxy is working</li>";
if ($errorCode & 8) echo "<li>Proxy was tested, but timed out on connection</li>";
if ($errorCode & 16) echo "<li>Proxy was tested, but failed at connection</li>";
if ($errorCode & 32) echo "<li>Proxy was tested but the IP was different to the one connected at (Including TOR)</li>";
if ($errorCode & 64) echo "<li>IP marked as \"abusive host\". Primary target is web-form spamming (includes dnsbl_remote)</li>";
if ($errorCode & 128) echo "<li>Proxy has a different anonymous-state (web-based proxies, like anonymouse, etc)</li>";
echo "</ul><a href=\"\">Please see the DNSBL for more information on the error codes</a>";
echo '<br/>You may solve the following captcha to access the site:
<form action="dnsbl.php?captcha" method="POST">
  <script type="text/javascript"
     <iframe src="'.$publicKey.'"
         height="300" width="500" frameborder="0"></iframe><br>
     <textarea name="recaptcha_challenge_field" rows="3" cols="40">
     <input type="hidden" name="recaptcha_response_field"
if (isset($_GET['clearSession']))

If anyone has any issues with this, please let me know.

The e-mail code was generated by this (Thanks Juju)
The DNSBL is provided by, and is based off of stopforumspam's blocklist.

If you want to use the script, just put

Code: [Select]
<?PHP include("dnsbl.php") ?>

at the top of whatever script you wish to protect.

Edit: Added recaptcha support to it.

Site Feedback and Questions / What to do with archives
« on: February 26, 2012, 03:53:07 pm »
Pretty much says it all.

I'm for integrating it into the existing site, but I don't know rather we should create an 'archive' forum and move all the posts in there, or move it into existing categories.

Computer Projects and Ideas / Web-based Wabbitemu Frontend
« on: November 30, 2011, 04:34:27 pm »
As some of you might recall, I started a project for a web-based Wabbitemu frontend about a year and a half ago. I stopped working on it after maybe a couple weeks. Recently, I picked it up again. I've reworked it into being a standalone webserver to overcome a number of issues that were caused by the more full webservers. This also simplifies the means for transferring data from the emulator to the webserver considerably.

Link: http://-snip-:81/
Note that this is running on my desktop and may not be up consistently, nor is it perfectly stable.
I'll also have to ask you guys not to poke around with the server too much, it doesn't have the best of error handling.

ToDo List:
  • Allow variable/app uploading
  • Allow some sort of persistent saves, possibly through a user account system
  • Make the server more robust

Known bugs:
  • Opera tends to use high amounts of CPU with it
  • It's capped at 32 calculators. Any more than this will simply not load. I need to make it recycle old calculators or something.
  • IE

I'm planning on getting file/app uploading working on it, too.

I'll be posting the source code under whatever license Wabbit uses pretty soon, I just have a few things I want to clean up.

Site Feedback and Questions / PC calculator-related projects
« on: November 29, 2011, 01:39:23 pm »
The 'Other Calc-Related Projects And Ideas' section should have a subforum for PC tools to aid in calculator development, no? Like 'Calculator-related PC tools'

Computer Projects and Ideas / Fun with AJAX
« on: November 19, 2011, 05:26:35 pm »
I've had an idea for a while to accelerate page changes on one site with AJAX. This is what I came up with.

Code: [Select]
function getAjaxObject()
xmlhttp=new XMLHttpRequest(); //Decent Browsers
if (!xmlhttp || xmlhttp == undefined || xmlhttp == null) xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");  //IE7+
if (!xmlhttp || xmlhttp == undefined || xmlhttp == null) xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); //IE6-
return xmlhttp;

function loadPage(url)
xmlhttp = getAjaxObject();
if (xmlhttp.readyState==4 && xmlhttp.status==200)

function processTags()
var atags=document.getElementsByTagName("a");
for (x in atags)
atags[x].href="#"; //This also causes it to scroll to the top of the page.


This basically replaces all the 'A' tags on a page with a call to an AJAX function that loads the new page w/o refreshing.

Obviously there are incompatibility issues with this. On Omnimaga, where I tested, posting is a bit wonky, you also can't click links to sites outside the current domain.

It is considerably faster loading pages for me, though.

Also, this doesn't take a considerable amount of real-world situations into consideration, so don't be surprised if it breaks more than it does good. :P

If you want to give it a try, here's the JS to paste in your address bar. This should, at least in theory, work with (most) any site.

Code: [Select]

Or, click here.

Miscellaneous / Post your typing speed
« on: November 19, 2011, 04:33:12 am »
Typing Test Score

Visit the Typing Test and try!

Beat that.

Computer Projects and Ideas / SMF bot detection mod
« on: November 09, 2011, 05:20:11 am »
I've been thinking of ways to counteract the spambots and I believe I've came up with something.

Basically, what I'm thinking of would be a 'Mark as Spam' link on the posts that would set a ban on the bots and flag them somewhere in the admin CP, and after 2 flags per post count of the user the user is automatically banned.

I haven't actually started coding it yet, but what I'm looking at adding is essentially another column on the member table that counts how many posts have been marked as spam, along with one function to pull the value of the table, check if it is greater than the post count * 2, and if so add an automatic ban against the username.

Another feature I was considering was a minimum post count to mark as spam, along with a button on the users profile for administrators to reset/change the spam count.

Also, since I haven't ran this past the admins yet, there's no guarantee it'll be used here, but I do intend on at least making it and posting it on SMFs mod site.

Site Feedback and Questions / Site Mods
« on: October 30, 2011, 06:45:39 pm »
I've been looking through the list of SMF mods and I've found a few that I think we should have.
Strikethrough means I'm not installing the mod.
Adds a ban button in posts, useful for spambots* (Installed)
Another bot tool* (Installed)

Highlights in posts (SMF 2.0 only)
Post box resizer (Installed)
Reason for edit mod Installed for v5 theme
Topic Starter Mod (Shows OP by adding a blurb under their name) Installed for v5 theme
Topic Prefixes (SMF 2.0 only)
Topic Descriptions Installed for Omnimaga v5 theme
THE DISEMVOWELER! (This one was a joke. :P)
Remove MOVED topics from feeds Installed
Quote Helper Upon further investigation, I don't like the look of this one.
Additional Polls Completely broken in every way possible.
Instant quick reply Installed for Omni v5 theme

Social likes
Facebook like button OR This one
Google+ +1
These are provided by the existing plugin

Code blocks
Line numbers in code blocks* (Installed)
Select all and copy code for code blocks* (Installed)

Clean times (Only compatible for 1.0, not 1.1. Not rewriting.)
Translator* This mod is for 2.0+, I'ma look for a mod that'll work on our current forums.
Donation mod* This one is really ugly code-wise, and it's broken. I'm not going to dig through it to fix it.

Here's the mod site.

Edit: I'ma go ahead and install the ones with *'s next to them, since they aren't really controversial at all, and I think that they'll be liked by everyone. :D

News / OmnomIRC Update
« on: October 12, 2011, 08:08:58 am »
OmnomIRC was turned back on earlier, after a downtime of roughly a week. Since moving TIMGUL and such didn't take as much bandwidth as I anticipated, I was able to turn it back on earlier.

Along with the bug that was causing it to flood the server with requests being fixed, it now updates text in the status bar!

Of course, the web chat will remain available for all who wish to use it at or in the navigation bar of Omnimaga.

News / OmnomIRC Downtime
« on: October 06, 2011, 05:54:44 am »
Due to a bug that was made very apparent after the momentary downtime earlier, OmnomIRC will be offline until further notice. OmnomIRC will likely remain offline until the first of November, due to bandwidth issues and partial rewriting to avoid this bug in the future.

I apologize for the inconvenience.

In the meantime, please feel free to join us on IRC in #omnimaga on or using a client of your choice, such as Mibbit or X-Chat 2. Feel free to ask in the forums if you need any help joining.

OmnomIRC Development / Plugin System Layout
« on: July 12, 2011, 11:14:32 pm »
I've been toying with the idea of a plugin system for quite some time for both client and server, and eeems was asking me about it earlier, so I thought I'd document some of what I came up with.

Client-sided plugins(for the web client, javascript based):

3 return values:
PLUGIN_CONTINUE - Continue parsing through all plugins, and allow OmnomIRC to display this message normally
PLUGIN_NO_OUTPUT - Continues parsing through all plugins, but causes OmnomIRC not to display the message
PLUGIN_BREAK - stops at this plugin, does not reach any others

Message types:
OnLoad - Fired when OmnomIRC loads - No vars

OnJoin - Fired when someone joins the current channel - Name, Channel
OnPart - Fired when someone parts the current channel - Name, Reason, Channel
OnQuit - Fired when someone quits the current channel - Name, Reason
OnKick - Fired when someone is kicked from the current channel - KickedName, KickerName, Reason, Channel
OnMode - Fired when someone changes modes in the current channel - Name, Modes, Channel
OnTopic - Fired when someone changes the topic in the current channel - Name, Topic, Channel

OnMessage - Fired when someone sends a message in the current channel - Name, Message, Channel
OnMessageHighlight - Fired when someone sends a message that highlights the user in the current channel - Name, Message, Channel
OnAction - Fired when someone sends an action in the current channel - Name, Message, Channel
OnActionHighlight - Fired when someone sends an action that highlights the user in the current channel - Name, Message, Channel

The layout of the javascript plugins will be something like this:
Code: [Select]
function pluginInfo()
     pluginName = "OnJoin Example";
     pluginVersion = "0.01";
     minOmnomIRCVersion = "2.2";
function OnJoin()
     alert(name1 + " has joined " + channel);!
     return PLUGIN_CONTINUE;
function Options()
     document.write('<a href="#" onclick="DoThis();">Option!</a><br/>');
function DoThis()
     alert("You clicked my option!");

There will be an option in the options page for loading them, and they will be able to output options to the options page. The plugins themselves will be largely responsible for managing their cookies and own options.

Here's what a mockup of the OmnomIRC-side loading code will be:
Code: [Select]
function loadPlugins()
     for (var i=0;i<pluginList.length;i++)
          //Warning: PSEUDO CODE!
          scrtag = new script;
          scrtag.src = pluginList[i];
function registerPlugin()
     if (minOmnomIRCVersion > OmnomIRCVersion) alert("NOEP.");
     loadedPluginList[] = Array(pluginName,pluginVersion,minOmnomIRCVersion);

function registerOnJoin()//Replicate for all other events
     onJoinPlugins[] = Array(loadedPluginList.length,OnJoin);

function doOnJoin(name,channel)
     name = name;
     channel = channel;
     var output = true;
     for (var i=0;i<onJoinPlugins.length;i++)
          var result = (onJoinPlugins[i][1])();
          if (result != PLUGIN_CONTINUE) output=false;
          if (result == PLUGIN_BREAK) break;
     return output;

Server-side plugins!
They will have the same events for the time being.
Code: [Select]
//OmnomIRC v2.2 OnJoin,OnLoad
//Example Plugin

function OnJoin()
     global $name,$channel;
     die("$name has joined $channel!");
     return PLUGIN_BREAK;

function OnLoad()
     echo "BLARG!!!!!!!!!!!!!!";
     return PLUGIN_CONTINUE;

And, for the server to load them (this has to be done each page run, I'm not entirely sure how efficient it will be)
This is pseudocode too.
Code: [Select]
foreach ($file in $directory)
     if (doesOnLoad($file))
     if (doesOnJoin($file))

Thoughts/comments? :D

Humour and Jokes / Racist e-mail (Canadians be warned, eh)
« on: June 30, 2011, 04:47:33 am »
I just got an e-mail of this page.

Seriously? "144 Years of Beer, Hockey, and Bacon"?
A beer holding hard hat on the same page as two flags and a breathalizer?


Edit: here's some other good ones. <\ <  ---These two were next to eachother. Who is Mr. Oscar on Dealextreme wat Be more than a watch! wat That's a fun board game. Stylish That's a depressing poem. I hope I'm not the only one who took this wrongly. "Find your magic stone in the kitchen!" That guy looks -WAY- too happy. Entitled: "good dream" General engrish That's shallow. How Hallmarkish of them. Once again, shallow. I don't think they know what labor day is. DVI and HDMI... They use the same protocol. Unique iPhones, you'll be the only one with cheap Chinese crap!

Humour and Jokes / Another TI fail!
« on: June 28, 2011, 11:24:10 pm »

OmnomIRC Development / IRC Client Integration
« on: June 27, 2011, 07:03:03 am »
Hey, this is Sorunome here. Below you can find Nethams original post.

This are bindings for OmnomIRC to integrate into an IRC client, like, let's say, HexChat.
Ok, HexChat is the only one I've written it for, so far.
The binding is available at the repository, currently only the dev branch, so go over here:

Netham45's stuff may still work, but maybe not, it is untested and heavily outdated as I changed the IRC bot a lot since. You can still check it out, though

Old code/bindings, by Netham45:
Spoiler For old:

I've written some tools to allow OmnomIRC to integrate into your IRC clients.

Here's the mIRC code, just put this into the remote.ini section of your scripts:

Spoiler For OmnomIRC only code:
Code: [Select]
ON ^*:TEXT:*:#:if ( $nick == OmnomIRC ) { echo $chan $iif($regsubex($readini($mircini,options,n4),/(^(.+?,){11}(.+?).*)/,\3) == 1,$timestamp,) $iif( $mid($1-,2,1) == $chr(35) , (4 $+ $chr(35) $+ ) $+ $mid($1-,4), (12O) $+ $mid($1-,7) ) | haltdef }

Spoiler For OmnomIRC & Saxjax code:
Code: [Select]
ON ^*:TEXT:*:#:{
  var %timestamp $chr(20)
  if ($regsubex($readini($mircini,options,n4),/(^(.+?,){11}(.+?).*)/,\3) == 1) { var %timestamp $timestamp }
  if ( $nick == OmnomIRC ) { echo $chan %timestamp $iif( $mid($1-,2,1) == $chr(35) , (4 $+ $chr(35) $+ ) $+ $mid($1-,4), (12O) $+ $mid($1-,7) ) | haltdef }
  if ( $nick == Saxjax ) { echo $chan %timestamp $regsubex( $1- ,\((.)\).\[(.+?)\] (.*),( $+ 5\1 $+  $+ ) <\2> \3) | haltdef }

And there is an XChat plugin attached. To use this, put it in %appdata%\X-Chat 2\ and restart XChat.
The file included only works on Windows X-Chat 2.

Here is the source code if someone wishes to compile it for Linux. It's a bit rushed, and not the neatest.
Code: [Select]
#include "xchat-plugin.h"
#include <string>
#include <cstdlib>
#include <regex>
#include <iostream>
#define PNAME "OmnomIRC Integration"
#define PDESC "Integrates OmnomIRC into X-Chat"
#define PVERSION "0.1"

static xchat_plugin *ph;   /* plugin handle */
static int enable = 1;
static char omnomIRC_Name[] = "OmnomIRC";
using namespace std::tr1;
using namespace std;
//#define debug
static void dbgPrint(const char *message)
#ifdef debug
static void dbgPrint(string message)
#ifdef debug
static string getMessageType(string message)
if (regex_search(message.begin(),message.end(),regex("^.{0,3}\\((.)\\).{0,1}<(.+?)> (.*)")))
return "message";
if (regex_search(message.begin(),message.end(),regex("^.{0,4}\\((.)\\)([^:space:]{0,4})\\* ?(.*)")))
return "action";
return "";
static char* getNameColor(const char *name)
char *rcolors[] = {"19", "20", "22", "24", "25", "26", "27", "28", "29"};
int sum = 0, i = 0;
while (name[i] != '\x00')
sum += name[i++];
sum %= 9;
return rcolors[sum];
static int on_text_cb(char *word[], void *userdata)
if (strcmp(word[0],omnomIRC_Name))
string messageType = getMessageType(word[2]).c_str();
string type = word[0];
cmatch parts;
if (strcmp(messageType.c_str(),"message") == 0)
regex rx("^.{0,3}\\((.)\\).{0,1}<(.+?)> (.*)");
bool omnomirc = parts[1].str().c_str()[0] == 'O';

string name;
if (omnomirc)
string msg;;
if (xchat_nickcmp(ph,xchat_get_info(ph,"nick"),parts[2].str().c_str()) == 0)
xchat_emit_print(ph, "Channel Message",name.c_str(), msg.c_str(), "@", NULL); //Don't highlight on local messages
xchat_emit_print(ph, type.c_str(), name.c_str(), msg.c_str(), "@", NULL);
else if (strcmp(messageType.c_str(),"action") == 0)
regex rx("^.{0,3}\\((.)\\)([^:space:]{0,4})\\* ?(.*)");
bool omnomirc = parts[1].str().c_str()[0] == 'O';
string name = "\x03""\x03";
if (omnomirc)
name.append("12O\x03""18 *");
name.append("04#\x03""18 *");
string message(parts[2]);
xchat_emit_print(ph, type.c_str(), name.c_str(), message.c_str(), "@", NULL);


   return XCHAT_EAT_NONE;

void xchat_plugin_get_info(char **name, char **desc, char **version, void **reserved)
   *name = PNAME;
   *desc = PDESC;
   *version = PVERSION;

int xchat_plugin_init(xchat_plugin *plugin_handle,
                      char **plugin_name,
                      char **plugin_desc,
                      char **plugin_version,
                      char *arg)
   /* we need to save this for use with any xchat_* functions */
   ph = plugin_handle;

   /* tell xchat our info */
   *plugin_name = PNAME;
   *plugin_desc = PDESC;
   *plugin_version = PVERSION;

   xchat_hook_print(ph, "Channel Message", XCHAT_PRI_NORM, on_text_cb, NULL);
   xchat_hook_print(ph, "Channel Msg Hilight", XCHAT_PRI_NORM, on_text_cb, NULL);

   xchat_print(ph, "OmnomIRC Integration loaded successfully!\n");

   return 1;

Edit: Updated mIRC script. >:D

Pages: [1] 2 3 4