A privacy bug in KDE (and possibly others) leaves applications vulnerable to information disclosure.
IRC is a simple idea, and should be simple to manage. Unfortunately by design it isn't simple to manage a cluster of IRC servers. This guide will take you through setting up and managing your IRC cluster.
How to build your own SSH server with custom commands in Node.js.
The problem with RTMP servers on the web and how to overcome it.
Why I moved away from Wordpress and how I'm dealing with a static blog.
Hello and welcome to my new blog now on Jekyll

I haven’t really had much of a chance to write in 2017, so here’s one of my 3 or 4 blog posts a year. I’ve been in one of those depressing ruts again, but finally I’m pulling myself out of it and getting back to work on my projects again, making them bigger and better as always. That’s a joke, I always find something in my projects that nags at me and about a year later I just rewrite the whole thing only to come up with new issues that nag at me for yet another year, and the cycle just continues.

2017 Online Safety Modernization Act would criminalize doxingThe 2017 Online Safety Modernization Act is a proposed bill which would make Swatting, Doxing, revenge porn, and other forms of online harassment illegal, and with harsher penalties.

As I have talked about in my most recent blog post, I suffer from Bipolar disorder. For roughly a week and a half or so I was in a manic episode. Luckily I was able to keep my focus on just a set number of projects instead of starting new projects that I never finish.

Unfortunately due to my manic episode I tend to rush through code without leaving a lot of comments for myself. I also tend to break stuff, as usual, and forget where I left off to even fix it.

In the past few days I’ve finally hit that period where I start to feel melancholic. This obviously isn’t good. I stop focusing on code, and start slipping into a depression which makes it difficult to stay motivated.

I’ve been diagnosed with bipolar disorder almost 2 years ago, but I have been suffering from it my whole life. With bipolar disorder comes constant ups and downs. Some days I just bounce right out of bed and start to work on projects. Other days I don’t feel like doing much of anything at all. In retrospect I see how it has affected work performance in the past.

As I’ve stated many times before, I like to break things. While migrating a dozen or so WordPress websites from my old web server to a high-availability network of web servers I seem to be breaking them left and right! Luckily WP-CLI was here to save the day!

With a home network of 29+ devices a standard router from the store just doesn’t cut it for me. We have smart TV’s, game systems, phones, tablets, laptops, desktops, you name it and it’s probably connected to our wired or wireless network. Many standard routers can handle roughly 4-5 active devices concurrently before they start having issues. Even when devices are idly connected to the network they are still doing things in the background like checking for/performing updates for example.

I stumbled across an article today on HackRead that I could tell the writer clearly did not do their research (or math). Here’s an excerpt..

I’ve been blogging here for about 6 years now. In that time I’ve done a lot of overhauling on my website. Quite frankly, I’ve been doing it all wrong!

Often times when writing a server you will need to be able to handle multiple client connections at a time. To do this you will want to create a threaded server.

These are the WordPress plugins that, in my opinion, are worthy of being called top 10. I’m not putting them into any particular order.

If you’re hosting a website which has any sort of posting system (ie- forums, comments, etc..) then you are likely to receive a lot of spam if you leave yourself open to it. One simple way to stop spam in it’s tracks is to simply check visitors IP addresses against a DNSBL (DNS Blacklist).

I find myself recommending a lot of these tools & practices to friends and colleagues so I thought I would share some of my insight on the best tools and practices to use for good OPSEC.

I’ll go over some of the tools that I personally use, then briefly describe how some of them can be used together to make your OPSEC practices a little easier and more streamlined.

In C# there are various reasons that you may have for needing to thread your applications out. I’m won’t go into detail what reasons you would have for doing so, I am only going to explain how that is done. This article goes over a complete example of C# threading, and then explains each piece of the code to help break the process down for you. It is important to note that I am still learning C#, and may not be showing you the best way to handle this. Please feel free to offer me corrections via email and I will update accordingly.

The example code will send chunks of 10,000 numbers to 4 worker threads. The worker threads will find all prime numbers in the given chunk and print them to the screen. There is no guarantee that prime numbers will be listed in order, so one may want to pop the output into another program to sort them out, this wasn’t the main focus of the program’s duties. The full example can be found at the bottom of the post.

static void Main(string[] args)
{
    int i;
    int initThreadCount = Process.GetCurrentProcess().Threads.Count;
    bool num = int.TryParse(args[0], out i);
    if( i < 0 )
    {
        Console.WriteLine("Starting point must be 0 or greater!");
    }
    while ( i <= Int32.MaxValue && i >= 0 )
    {
        if( Process.GetCurrentProcess().Threads.Count-initThreadCount <= 4 )
        {
            Thread t = new Thread(() => checkBlockForPrime(i, i + 9999));
            t.Start();
            if (Int32.MaxValue - 10000 <= i)
            {
                i = Int32.MaxValue - 10000;
            }
            else
            {
                if (i == Int32.MaxValue)
                {
                    Console.WriteLine("I have reached the maximum value of an int.");
                    break;
                }
                else
                {
                    i = i + 10000;
                }
            }
        }
    }

The above code sample is the Main(), it takes a single argument (ref- Main(string[] args)) which should be an integer that it will start the count at. The program will fail to run if an integer is not passed as the first (and only) argument to the program.

The variable i is an integer which is used to keep track of what number the program is on. It is incremented for each block of numbers passed to worker threads. The argument given to the program is what defines the variable. This integer is defined in lines 3 and 5 of the example code above.

int i;

bool num = int.TryParse(args[0], out i);

On line 4 I set the integer initThreadCount to the number of threads that had already been started on the program’s execution. I did this so that I could do a comparison in the while statement which would allow me to accurately find how many threads are put to use for checking prime numbers (ref- if( Process.GetCurrentProcess().Threads.Count-initThreadCount <= 4 )).

Main runs a while loop which runs as long as i is less than Int32.MaxValue (the maximum integer on a 32bit system) and i is less than 0 (ie- while ( i <= Int32.MaxValue && i >= 0 )).

If you wish to compile your code only for 64 bit, then you can replace Int32.MaxValue with Int64.MaxValue and it should all work the same.

Inside of the while loop the program checks that no more than 4 threads are running aside from the initial thread count from when the program started. If there are 4 or more threads then it will wait until threads are freed. If there are less than 4 threads working on the task then a new thread will be created with a block of 10,000 numbers.

The new thread is created with: Thread t = new Thread(() => checkBlockForPrime(i, i + 9999)); and then started with t.Start();.

Next the program needs to increment the value of i. I have added a few checks which could cause some non-unique output when it comes to the last 10,000 numbers leading up to Int32.MaxValue. Since this is just an example of threading I’m not concerned with some slight logic flaws, but it might be fun for you to try to work them out.

First my program checks if Int32.MaxValue - 10000 is less than or equal to i. If it is then we are in the last 10,000th block and the program will set i to the value of Int32.MaxValue - 10000 to avoid looping i into the negatives. If this statement is not true then the program checks to see if i is equal to Int32.MaxValue, it cannot continue to process anything higher than that so if this condition is ever met it should break out of the loop and end execution of the program. If this statement is false then i is simply incremented by 10,000 (ref- i = i + 10000).

Each time a new thread is created in the main loop, it calls a function called checkBlockForPrime, this function is defined and explained in the sample below.

public static void checkBlockForPrime(int start, int end)
{
    int i = start;
    while( i <= end )
    {
        if (checkPrime(i) == true)
        {
            Console.WriteLine(i);
        }
        i = i + 1;
    }
}

checkBlockForPrime accepts two arguments, the beginning and end integers that it should check against. Essentially our Main() gives this function two numbers every time it creates a new thread, and this function inclusively checks whether numbers in that range are prime. If it finds a prime number, the number is printed to the screen. Simple enough right?

The next sample is the checkPrime function that is used above, it simply checks whether or not the given integer is prime. If the number is prime it returns true, and if not it returns false.

public static bool checkPrime(int num)
{
    // Test whether the parameter is a prime number.
    if ((num & 1) == 0)
    {
        if (num == 2)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    for (int i = 3; (i * i) <= num; i += 2)
    {
        if ((num % i) == 0)
        {
            return false;
        }
    }
    return true;
}

The full code below can be copied into a Visual Studio CLI project and compiled there. If you are on Linux just save this to a file (prime.cs for example) and compile it with Mono (gmcs prime.cs</span>).

/*
** Project Name: PrimeTime
** Author: Robert Whitney <[email protected]>
** Description: Uses multi-threading to find prime numbers in generated chunks and then prints all primes to the screen.
**    Processes about 873,190 numbers/second in blocks of 10,000 using 4 worker threads.
**    Tested on Windows 8.1 x64, w/ Intel Core i7 2600 (3.40GHz) processor.
**    Max integer limited to value of Int32.MaxValue (2,147,483,647)
*/
/* Include libraries for the project */
using System;
using System.Threading;
using System.Diagnostics;

namespace PrimeTime
{
    class PrimeTime
    {
        static void Main(string[] args)
        {
            int i;
            int initThreadCount = Process.GetCurrentProcess().Threads.Count;
            bool num = int.TryParse(args[0], out i);
            if( i < 0 )
            {
                Console.WriteLine("Starting point must be 0 or greater!");
            }
            while ( i <= Int32.MaxValue && i >= 0 )
            {
                if( Process.GetCurrentProcess().Threads.Count-initThreadCount <= 4 )
                {
                    Thread t = new Thread(() => checkBlockForPrime(i, i + 9999));
                    t.Start();
                    if (Int32.MaxValue - 10000 <= i)
                    {
                        i = Int32.MaxValue - 10000;
                    }
                    else
                    {
                        if (i == Int32.MaxValue)
                        {
                            Console.WriteLine("I have reached the maximum value of an int.");
                            break;
                        }
                        else
                        {
                            i = i + 10000;
                        }
                    }
                }
            }
            Console.WriteLine("Cannot process numbers larger than " + Int32.MaxValue + " and will not process numbers smaller than 0");
        }

        public static void checkBlockForPrime(int start, int end)
        {
            int i = start;
            while( i <= end )
            {
                if (checkPrime(i) == true)
                {
                    Console.WriteLine(i);
                }
                i = i + 1;
            }
        }
        public static bool checkPrime(int num)
        {
            // Test whether the parameter is a prime number.
            if ((num & 1) == 0)
            {
                if (num == 2)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            for (int i = 3; (i * i) <= num; i += 2)
            {
                if ((num % i) == 0)
                {
                    return false;
                }
            }
            return true;
        }
    }
}

More recently than ever people have been approaching me for help with learning a programming language. More often than not I will refer them to PERL or PHP depending on their program requirements. Surprisingly the best technique, that I have found, to help someone learn a new language is through writing an IRC bot. This requires someone to learn about not only the PERL basics, such as setting variables and working with scopes, but also pushes them to dive into other stuff like working with sockets and regular expressions. I’ve found that with a short primer from the getting started section of PerlMonks` tutorials, and simply learning to understand the documentation for various libraries listed on CPAN, all of the people whom I’ve introduced PERL to have been able to pick it up rather easily.

When threading in PERL it is often useful to have a master process checking up on threaded processes to make sure they are doing their job correctly, or to gather data from the threaded process. At any rate the design pattern that I often find useful is called Boss & Worker. In this pattern we have one ( or more ) threads that act as a boss, and this (or these) thread(s) will spawn child threads which carry out a set task.First, as with any threaded program, we will need to pull in libraries such as threads, and strict:

WordPress custom menusIn my last post, I showed you the basics to making your own WordPress theme, this time I would like to dive a little deeper into what makes a WordPress theme such as custom menus and widget areas.

I find it surprising that many themes still don’t support custom menus, however after this tutorial you will not only understand how to implement these into your own theme, but also how to modify other themes to also support custom menus.

I will be assuming that you have already read and followed the guidelines set out in my previous post, and that you have even gone ahead and tinkered around a bit on your own.

As usual, if you need any extra help feel free to leave a comment and myself or someone else may be able to assist you.

miniX WordPress theme by xniteIn this tutorial I will show you the basics of how to write your own WordPress themes. This guide assumes that you already have a fair amount of experience with HTML, CSS, and PHP. In case you do not, this guide won’t help you much, you should brush up on those things before moving on to this guide.

A script reporting vulnerable servers used in NTP reflection attackEarlier this month I wrote about how I took offensive security measures in order to shutdown the emerging NTP reflection / DRDoS threat. Today I am happy to announce that of the 2,917 reported NTP servers which were observed as being used in NTP reflection attacks, 1,956 (67.06%) of them have been either shutdown or patched to disallow monlist.

cloudflare-illustration-of-ntp-amplification-attackCloudFlare & Arbor Networks have both reported the attack against a CloudFlare hosted website reached a peak of between 325Gbps & 400Gbps. Previously the largest ever recorded DDoS attack has been against SpamHaus with 300Gbps.

NTP monlist reply packet in wireshark

NTP monlist reply packet in wireshark

realmofthemadgod_hacked

AfraidIRC chat embedded into web page on realmofthemadgod.com

hacker-keyboardOn January 20th Naoki Hiroshima discovered that his PayPal & GoDaddy accounts had been breached, and domains stolen.

The hacker had control over his email, websites, and online finances, while Naoki was powerless to protect himself. He was at the mercy of the attacker who stole his accounts.

ntp-amplification-attack-wiresharkIn this first month of 2014 there has been a new threat in the world of DrDoS.

Reflected NTP attacks appear to be increasing in popularity over DNS reflection (2013’s favorite reflected attack method), but will NTP amplification rise above DNS amplification in popularity?

botnetSecurity researcher Jerome Nokin has managed to find exploits in McAfee’s ePolicy Orchestrator product which can allow an attacker to turn attached computers into a botnet, using the McAfee product as it’s C&C.

In statistics data gathered from zone-h, a popular defacement archive, I was able to get an idea of how many websites are defaced each day, as well as how many unique servers are hacked to create these defacements. The numbers were shocking, to say the least, and a lot more defacements in a day than I ever imagined possible!

2013-09-24_050758Remember last year when I wrote about an Internet Explorer vulnerability which Pythorian & myself had discovered? Well, time for this to turn into a recurring nightmare!

Since my girlfriend decided to subtly hint about it in a recent blog post on her website, and I broke the news on Twitter, I thought I would finally write about my experience early in February.

While pentesting some of the new updates on my pet project, Logsmurf.com, Pythorian ran across an odd IE vulnerability involving the way it renders plain text files.

2017 Online Safety Modernization Act would criminalize doxingThe 2017 Online Safety Modernization Act is a proposed bill which would make Swatting, Doxing, revenge porn, and other forms of online harassment illegal, and with harsher penalties.

I find myself recommending a lot of these tools & practices to friends and colleagues so I thought I would share some of my insight on the best tools and practices to use for good OPSEC.

I’ll go over some of the tools that I personally use, then briefly describe how some of them can be used together to make your OPSEC practices a little easier and more streamlined.

A script reporting vulnerable servers used in NTP reflection attackEarlier this month I wrote about how I took offensive security measures in order to shutdown the emerging NTP reflection / DRDoS threat. Today I am happy to announce that of the 2,917 reported NTP servers which were observed as being used in NTP reflection attacks, 1,956 (67.06%) of them have been either shutdown or patched to disallow monlist.

cloudflare-illustration-of-ntp-amplification-attackCloudFlare & Arbor Networks have both reported the attack against a CloudFlare hosted website reached a peak of between 325Gbps & 400Gbps. Previously the largest ever recorded DDoS attack has been against SpamHaus with 300Gbps.

NTP monlist reply packet in wireshark

NTP monlist reply packet in wireshark

realmofthemadgod_hacked

AfraidIRC chat embedded into web page on realmofthemadgod.com

hacker-keyboardOn January 20th Naoki Hiroshima discovered that his PayPal & GoDaddy accounts had been breached, and domains stolen.

The hacker had control over his email, websites, and online finances, while Naoki was powerless to protect himself. He was at the mercy of the attacker who stole his accounts.

ntp-amplification-attack-wiresharkIn this first month of 2014 there has been a new threat in the world of DrDoS.

Reflected NTP attacks appear to be increasing in popularity over DNS reflection (2013’s favorite reflected attack method), but will NTP amplification rise above DNS amplification in popularity?

botnetSecurity researcher Jerome Nokin has managed to find exploits in McAfee’s ePolicy Orchestrator product which can allow an attacker to turn attached computers into a botnet, using the McAfee product as it’s C&C.

In statistics data gathered from zone-h, a popular defacement archive, I was able to get an idea of how many websites are defaced each day, as well as how many unique servers are hacked to create these defacements. The numbers were shocking, to say the least, and a lot more defacements in a day than I ever imagined possible!

2013-09-24_050758Remember last year when I wrote about an Internet Explorer vulnerability which Pythorian & myself had discovered? Well, time for this to turn into a recurring nightmare!

While pentesting some of the new updates on my pet project, Logsmurf.com, Pythorian ran across an odd IE vulnerability involving the way it renders plain text files.

I haven’t really had much of a chance to write in 2017, so here’s one of my 3 or 4 blog posts a year. I’ve been in one of those depressing ruts again, but finally I’m pulling myself out of it and getting back to work on my projects again, making them bigger and better as always. That’s a joke, I always find something in my projects that nags at me and about a year later I just rewrite the whole thing only to come up with new issues that nag at me for yet another year, and the cycle just continues.

As I have talked about in my most recent blog post, I suffer from Bipolar disorder. For roughly a week and a half or so I was in a manic episode. Luckily I was able to keep my focus on just a set number of projects instead of starting new projects that I never finish.

Unfortunately due to my manic episode I tend to rush through code without leaving a lot of comments for myself. I also tend to break stuff, as usual, and forget where I left off to even fix it.

In the past few days I’ve finally hit that period where I start to feel melancholic. This obviously isn’t good. I stop focusing on code, and start slipping into a depression which makes it difficult to stay motivated.

I’ve been diagnosed with bipolar disorder almost 2 years ago, but I have been suffering from it my whole life. With bipolar disorder comes constant ups and downs. Some days I just bounce right out of bed and start to work on projects. Other days I don’t feel like doing much of anything at all. In retrospect I see how it has affected work performance in the past.

With a home network of 29+ devices a standard router from the store just doesn’t cut it for me. We have smart TV’s, game systems, phones, tablets, laptops, desktops, you name it and it’s probably connected to our wired or wireless network. Many standard routers can handle roughly 4-5 active devices concurrently before they start having issues. Even when devices are idly connected to the network they are still doing things in the background like checking for/performing updates for example.

Since my girlfriend decided to subtly hint about it in a recent blog post on her website, and I broke the news on Twitter, I thought I would finally write about my experience early in February.

How to build your own SSH server with custom commands in Node.js.
The problem with RTMP servers on the web and how to overcome it.

Often times when writing a server you will need to be able to handle multiple client connections at a time. To do this you will want to create a threaded server.

If you’re hosting a website which has any sort of posting system (ie- forums, comments, etc..) then you are likely to receive a lot of spam if you leave yourself open to it. One simple way to stop spam in it’s tracks is to simply check visitors IP addresses against a DNSBL (DNS Blacklist).

In C# there are various reasons that you may have for needing to thread your applications out. I’m won’t go into detail what reasons you would have for doing so, I am only going to explain how that is done. This article goes over a complete example of C# threading, and then explains each piece of the code to help break the process down for you. It is important to note that I am still learning C#, and may not be showing you the best way to handle this. Please feel free to offer me corrections via email and I will update accordingly.

The example code will send chunks of 10,000 numbers to 4 worker threads. The worker threads will find all prime numbers in the given chunk and print them to the screen. There is no guarantee that prime numbers will be listed in order, so one may want to pop the output into another program to sort them out, this wasn’t the main focus of the program’s duties. The full example can be found at the bottom of the post.

static void Main(string[] args)
{
    int i;
    int initThreadCount = Process.GetCurrentProcess().Threads.Count;
    bool num = int.TryParse(args[0], out i);
    if( i < 0 )
    {
        Console.WriteLine("Starting point must be 0 or greater!");
    }
    while ( i <= Int32.MaxValue && i >= 0 )
    {
        if( Process.GetCurrentProcess().Threads.Count-initThreadCount <= 4 )
        {
            Thread t = new Thread(() => checkBlockForPrime(i, i + 9999));
            t.Start();
            if (Int32.MaxValue - 10000 <= i)
            {
                i = Int32.MaxValue - 10000;
            }
            else
            {
                if (i == Int32.MaxValue)
                {
                    Console.WriteLine("I have reached the maximum value of an int.");
                    break;
                }
                else
                {
                    i = i + 10000;
                }
            }
        }
    }

The above code sample is the Main(), it takes a single argument (ref- Main(string[] args)) which should be an integer that it will start the count at. The program will fail to run if an integer is not passed as the first (and only) argument to the program.

The variable i is an integer which is used to keep track of what number the program is on. It is incremented for each block of numbers passed to worker threads. The argument given to the program is what defines the variable. This integer is defined in lines 3 and 5 of the example code above.

int i;

bool num = int.TryParse(args[0], out i);

On line 4 I set the integer initThreadCount to the number of threads that had already been started on the program’s execution. I did this so that I could do a comparison in the while statement which would allow me to accurately find how many threads are put to use for checking prime numbers (ref- if( Process.GetCurrentProcess().Threads.Count-initThreadCount <= 4 )).

Main runs a while loop which runs as long as i is less than Int32.MaxValue (the maximum integer on a 32bit system) and i is less than 0 (ie- while ( i <= Int32.MaxValue && i >= 0 )).

If you wish to compile your code only for 64 bit, then you can replace Int32.MaxValue with Int64.MaxValue and it should all work the same.

Inside of the while loop the program checks that no more than 4 threads are running aside from the initial thread count from when the program started. If there are 4 or more threads then it will wait until threads are freed. If there are less than 4 threads working on the task then a new thread will be created with a block of 10,000 numbers.

The new thread is created with: Thread t = new Thread(() => checkBlockForPrime(i, i + 9999)); and then started with t.Start();.

Next the program needs to increment the value of i. I have added a few checks which could cause some non-unique output when it comes to the last 10,000 numbers leading up to Int32.MaxValue. Since this is just an example of threading I’m not concerned with some slight logic flaws, but it might be fun for you to try to work them out.

First my program checks if Int32.MaxValue - 10000 is less than or equal to i. If it is then we are in the last 10,000th block and the program will set i to the value of Int32.MaxValue - 10000 to avoid looping i into the negatives. If this statement is not true then the program checks to see if i is equal to Int32.MaxValue, it cannot continue to process anything higher than that so if this condition is ever met it should break out of the loop and end execution of the program. If this statement is false then i is simply incremented by 10,000 (ref- i = i + 10000).

Each time a new thread is created in the main loop, it calls a function called checkBlockForPrime, this function is defined and explained in the sample below.

public static void checkBlockForPrime(int start, int end)
{
    int i = start;
    while( i <= end )
    {
        if (checkPrime(i) == true)
        {
            Console.WriteLine(i);
        }
        i = i + 1;
    }
}

checkBlockForPrime accepts two arguments, the beginning and end integers that it should check against. Essentially our Main() gives this function two numbers every time it creates a new thread, and this function inclusively checks whether numbers in that range are prime. If it finds a prime number, the number is printed to the screen. Simple enough right?

The next sample is the checkPrime function that is used above, it simply checks whether or not the given integer is prime. If the number is prime it returns true, and if not it returns false.

public static bool checkPrime(int num)
{
    // Test whether the parameter is a prime number.
    if ((num & 1) == 0)
    {
        if (num == 2)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    for (int i = 3; (i * i) <= num; i += 2)
    {
        if ((num % i) == 0)
        {
            return false;
        }
    }
    return true;
}

The full code below can be copied into a Visual Studio CLI project and compiled there. If you are on Linux just save this to a file (prime.cs for example) and compile it with Mono (gmcs prime.cs</span>).

/*
** Project Name: PrimeTime
** Author: Robert Whitney <[email protected]>
** Description: Uses multi-threading to find prime numbers in generated chunks and then prints all primes to the screen.
**    Processes about 873,190 numbers/second in blocks of 10,000 using 4 worker threads.
**    Tested on Windows 8.1 x64, w/ Intel Core i7 2600 (3.40GHz) processor.
**    Max integer limited to value of Int32.MaxValue (2,147,483,647)
*/
/* Include libraries for the project */
using System;
using System.Threading;
using System.Diagnostics;

namespace PrimeTime
{
    class PrimeTime
    {
        static void Main(string[] args)
        {
            int i;
            int initThreadCount = Process.GetCurrentProcess().Threads.Count;
            bool num = int.TryParse(args[0], out i);
            if( i < 0 )
            {
                Console.WriteLine("Starting point must be 0 or greater!");
            }
            while ( i <= Int32.MaxValue && i >= 0 )
            {
                if( Process.GetCurrentProcess().Threads.Count-initThreadCount <= 4 )
                {
                    Thread t = new Thread(() => checkBlockForPrime(i, i + 9999));
                    t.Start();
                    if (Int32.MaxValue - 10000 <= i)
                    {
                        i = Int32.MaxValue - 10000;
                    }
                    else
                    {
                        if (i == Int32.MaxValue)
                        {
                            Console.WriteLine("I have reached the maximum value of an int.");
                            break;
                        }
                        else
                        {
                            i = i + 10000;
                        }
                    }
                }
            }
            Console.WriteLine("Cannot process numbers larger than " + Int32.MaxValue + " and will not process numbers smaller than 0");
        }

        public static void checkBlockForPrime(int start, int end)
        {
            int i = start;
            while( i <= end )
            {
                if (checkPrime(i) == true)
                {
                    Console.WriteLine(i);
                }
                i = i + 1;
            }
        }
        public static bool checkPrime(int num)
        {
            // Test whether the parameter is a prime number.
            if ((num & 1) == 0)
            {
                if (num == 2)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            for (int i = 3; (i * i) <= num; i += 2)
            {
                if ((num % i) == 0)
                {
                    return false;
                }
            }
            return true;
        }
    }
}

More recently than ever people have been approaching me for help with learning a programming language. More often than not I will refer them to PERL or PHP depending on their program requirements. Surprisingly the best technique, that I have found, to help someone learn a new language is through writing an IRC bot. This requires someone to learn about not only the PERL basics, such as setting variables and working with scopes, but also pushes them to dive into other stuff like working with sockets and regular expressions. I’ve found that with a short primer from the getting started section of PerlMonks` tutorials, and simply learning to understand the documentation for various libraries listed on CPAN, all of the people whom I’ve introduced PERL to have been able to pick it up rather easily.

When threading in PERL it is often useful to have a master process checking up on threaded processes to make sure they are doing their job correctly, or to gather data from the threaded process. At any rate the design pattern that I often find useful is called Boss & Worker. In this pattern we have one ( or more ) threads that act as a boss, and this (or these) thread(s) will spawn child threads which carry out a set task.First, as with any threaded program, we will need to pull in libraries such as threads, and strict:

WordPress custom menusIn my last post, I showed you the basics to making your own WordPress theme, this time I would like to dive a little deeper into what makes a WordPress theme such as custom menus and widget areas.

I find it surprising that many themes still don’t support custom menus, however after this tutorial you will not only understand how to implement these into your own theme, but also how to modify other themes to also support custom menus.

I will be assuming that you have already read and followed the guidelines set out in my previous post, and that you have even gone ahead and tinkered around a bit on your own.

As usual, if you need any extra help feel free to leave a comment and myself or someone else may be able to assist you.

miniX WordPress theme by xniteIn this tutorial I will show you the basics of how to write your own WordPress themes. This guide assumes that you already have a fair amount of experience with HTML, CSS, and PHP. In case you do not, this guide won’t help you much, you should brush up on those things before moving on to this guide.

2017 Online Safety Modernization Act would criminalize doxingThe 2017 Online Safety Modernization Act is a proposed bill which would make Swatting, Doxing, revenge porn, and other forms of online harassment illegal, and with harsher penalties.

As I’ve stated many times before, I like to break things. While migrating a dozen or so WordPress websites from my old web server to a high-availability network of web servers I seem to be breaking them left and right! Luckily WP-CLI was here to save the day!

I find myself recommending a lot of these tools & practices to friends and colleagues so I thought I would share some of my insight on the best tools and practices to use for good OPSEC.

I’ll go over some of the tools that I personally use, then briefly describe how some of them can be used together to make your OPSEC practices a little easier and more streamlined.

Why I moved away from Wordpress and how I'm dealing with a static blog.

2017 Online Safety Modernization Act would criminalize doxingThe 2017 Online Safety Modernization Act is a proposed bill which would make Swatting, Doxing, revenge porn, and other forms of online harassment illegal, and with harsher penalties.

I stumbled across an article today on HackRead that I could tell the writer clearly did not do their research (or math). Here’s an excerpt..

I’ve been blogging here for about 6 years now. In that time I’ve done a lot of overhauling on my website. Quite frankly, I’ve been doing it all wrong!

These are the WordPress plugins that, in my opinion, are worthy of being called top 10. I’m not putting them into any particular order.

Hello and welcome to my new blog now on Jekyll
IRC is a simple idea, and should be simple to manage. Unfortunately by design it isn't simple to manage a cluster of IRC servers. This guide will take you through setting up and managing your IRC cluster.
A privacy bug in KDE (and possibly others) leaves applications vulnerable to information disclosure.
Referral Links

Using my referral links is the best way to help me pay for my projects and development servers and get something out of it for yourself.

Copyright©2011 - 2018, Robert Whitney; All rights reserved.
Aeon Address: WmtnQAoEJsfbcjyMJLmfW8SJ3j5VCGGjX4k3hHrc4XbhVcz6dxifHs65h2w3y5gq8Qf4D4tgzb6VxEtggSq5hR8s1CzN1cLeK