• 31 Dec 2008 /  Web Design

    Finding a fast, reliable webhost can be quite a challenge – especially if you don’t want to spend any money. If you just want to host a blog or a forum, then search google – there’s plenty of free services out there that allow you to do that easily. However, if you want to build your own site or control every aspect you’ll want to find a webhost.

    Here’s some basic tips

    • Check the age of the supposed “company”. Nowadays, the hosting market has become very saturated and reselling has become popular.
    • Don’t fall for “overselling”. This is when a host will offer you absurd amounts of bandwidth and space at no cost. These high numbers are just there to attract you – and it works.
    • Check for forums. Many hosts are starting to create forums for their users to chat on. Check the number of users and activity and use it as a potential guide.
    • Look for reviews on the internet. This one is very important – other users will post their experiences, good and bad, about the host. A word of warning though: Quite a few hosts have been caught paying people to write good reviews for them. If the host is truly bad, the number of bad reviews will still clearly outshine the good.
    • Try to find their uptime stats. You wouldn’t want to find out that your host that claimed 98% uptime has less than 80%.
    • Look at their features. For a free host, mysql/sendmail/fsockopen and a few others can easily lead to abuse and are often not available on free hosts. If you absolutely need these, make sure you check if the host offers it before signing up.
    • Read their TOS. This can be a very important one – if you want to host a proxy site, that generally won’t happen on free or paid hosting due to the CPU intensity of these sites. Also it is important because some hosts don’t want to host games or photo galleries, which may be what you want to create. Save your time, effort, and possibly money by at least skimming through the TOS. On top of that, remember when I mentioned overselling earlier? Well, this becomes key in their TOS. Often, it will say that the hundreds of GBs of bandwidth they offer you must not exceed ___% bandwidth for files that aren’t text based like html/php. If you want to host some images/software etc, this can be critical.

    Good luck in your searches!

    Tags: ,

  • 26 Dec 2008 /  Uncategorized

    First off, to avoid confusion I’m talking about the candy malted milk balls. Not burgers. So anyway, if you’ve had probably 2-3 boxes of whoppers in your life, you’ll realize that some of the whoppers in a box (3 or less usually), are bad/disgusting/icky. SOoooo I had 2 bad whoppers in this last box I had, and after the first one I set off on a way to avoid eating the bad ones. Now really, it’s quite easy to tell which whoppers you shouldn’t eat!

    Here’s a picture of a bad whopper:

    Not pleasant! So, what are the signs?

    1. A not-so-round shape. Loppy, bulgy, whatever.
    2. It looks like a squirrel attacked it. It’s got little scratch-like marks all over it
    3. Cut it in half and what do you see? Looks like the inside of some alien egg.
  • 24 Dec 2008 /  Programming

    So, a long time ago (probably 2 years), I created 2 functions using the GameMaker engine that did super simple XOR encryption. XOR encryption is often debatable as being true encryption or not; but I call it encryption anyway. It’s easy to crack and should NOT be used for sensitive data, there are stronger methods out there. Now, onto the simple and short source.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    
    public String xorEnc(int encKey, String toEnc) {
            /*
                Usage: str = xorEnc(integer_key,string_to_encrypt);
                Created by Matthew Shaffer (matt-shaffer.com)
            */
            int t=0;
            String s1="";
            String tog="";
            if(encKey>0) {
                while(t < toEnc.length()) {
                    int a=toEnc.charAt(t);
                    int c=a ^ encKey;
                    char d=(char)c;
                    tog=tog+d;
                    t++;
                }
     
            }
            return tog;
        }
        public String xorEncStr(String encKey, String toEnc) {
            /*
                Usage: str = xorEnc(string_key,string_to_encrypt);
                Created by Matthew Shaffer (matt-shaffer.com)
            */
            int t=0;
            int encKeyI=0;
     
            while(t < encKey.length()) {
                encKeyI+=encKey.charAt(t);
                t+=1;
            }
            return xorEnc(encKeyI,toEnc);
        }

    I’m not going to bother explaing much how these two functions work. Using them is simple and you should read the comments in the functions, and I’m pretty sure all you want to do is rip them anyway. xorEncStr basically converts the string key you provide it into an integer and passes it to xorEnc. Both of the above functions have been tested to work!

    Tags: , , ,

  • 22 Dec 2008 /  Web Design

    This was sad, utterly sad. The first comment to this blog was a SPAM comment. I hate spam, so I’m going to add a few lines to my .htaccess file to prevent that IP from coming back and spamming me again.

    What can you do with .htaccess banning?
    1. Ban an IP
    2. Ban an IP range (100.100.100.xxx), where xxx can be anything and will still be blocked
    3. Ban a domain name. Ex: proxy1.c0oproxeh.com, proxy2.c0oproxeh.com will both be unable to view the site

    Let’s get started. Here’s how you can block a single IP

    order allow,deny
    deny from 100.100.100.1
    allow from all

    Just switch out “100.100.100.1″ with the IP you want to block. That was pretty easy, wasn’t it? Now on to multiple IPs.

    order allow,deny
    deny from 100.100.100.1
    deny from 100.100.100.2
    deny from 100.100.100.3
    deny from 100.100.100.4
    deny from 100.100.100.5
    allow from all

    Now there are some tricky spammers out there who own multiple IPs with only slight variations. The most common way to attempt to prevent these spammers is to block every IP that has the first 3 sections the same (100.100.100). This is called IP range banning

    order allow,deny
    deny from 100.100.100
    allow from all

    Note that the above code will block 100.100.100.1, 100.100.100.2 ETC.

    Last thing: Blocking a domain name (Like .com, .net etc)

    order allow,deny
    deny from c0oproxeh.com
    allow from all

    Final note: You can mix and match all of these! Here’s an example

    order allow,deny
    deny from c0oproxeh.com
    deny from 100.100.100
    deny from 200.200.200.2
    allow from all

    There ya go! Not hard at all. Just remember: Many hosts, mostly free hosts, will block custom .htaccess files.

    Tags: , ,

  • 21 Dec 2008 /  Web Design

    You’re probably familiar with any major company having a nice, custom page when you land on a page that no longer exists. In this post, I will describe how you can add your own custom error pages with htaccess (assuming you are the webmaster).

    First off, here are some common error codes and what they mean:

    400: Bad Request
    401: Authorization required
    403: Forbidden
    404: Page not found
    500: Server error

    Now, those might not mean much to you, but the most common error page and one that you should set is 404. If you so much as rename a file, visitors may be coming from google and the file doesn’t exist. Instead of seeing a bland white page (or your host’s 404 page), you should change it.
    Here’s a sample .htaccess file

    ErrorDocument 404 /404.html
    ErrorDocument 500 /500.html
    ErrorDocument 400 /400.html
    ErrorDocument 401 /401.html
    ErrorDocument 403 /403.html

    You don’t have to name the file to match the error number, you can name the 404 error page “GoodbyeWorld.html” if you wanted.

    Now: Some tips for creating this file. On Windows, you cannot easily create this file. It doesn’t like having only extensions for filenames. To solve this problem, simply create your file and name it htaccess or htaccess.txt. Then, upload it to your web server and from there you can change its name (from ftp or a control panel).

    The most common problem people may face is due to their hosts: Many hosts, more specifically, many free hosts do not allow you to have a custom .htaccess file.

    Tags: ,

  • 21 Dec 2008 /  Programming

    There are just some things that google can never tell you, and no matter how hard you try to search for it you may never find what you are looking for. That happened to me when I tried to find out how to convert a String to an Integer array in Java. So, here’s the simple function that will do this:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    public static int[] strToInt (String inp) {
       int[] toRet = new int[inp.length()];
       int i = 0;
       while(i < inp.length()) {
          toRet[i]=(int)inp.charAt(i);
          i++;
       }
       return toRet;
    }

    This function goes through every character of the string and gets the integer value of the character and adds it to the integer array. When it’s done adding everything, it returns the integer array with the same length as the string.

    (PS: Sorry for unindented code; I’ll have to find a better code plugin..)

    Tags: ,

  • 21 Dec 2008 /  Uncategorized

    So as a small number of you will notice, I wiped out the old site. The main reason being that I have just begun moving most random software related content to a fresh, new site about my software: matt-soft.com. The site is just being fleshed out, so most of the content from this site won’t be on there for a few days. This means that a lot of google visitors (who mostly want GameMaker examples) will just have to wait a bit. Considering that a good majority will get 404s, I’m going to bustle about and get up a 404 page by tomorrow which links to matt-soft.com.

    So. What exactly will be in this blog? I have no idea yet. Maybe it’ll have some code snippets/examples, bits about my life, and random things I find interesting. We’ll find out.