Archive for the ‘Tutorials’ Category

Adding More Regions to a Theme in Drupal 6

Posted: 14th May 2010 by Andrew Brown in Tutorials
Tags:

I installed a new theme on the site today and wasn’t satisfied with the regions offered for placing blocks. Luckily, I’m a brilliant hacker of code and knew how to add more. And I promise to you, in less than 5 minutes, you’ll know how to add new regions to a Drupal 6 theme too!

In each theme, you’ll have a .info file and a page.tpl.php file. You have others, but these are the important ones for adding regions. Assuming you have a theme named Awesome, your files would be Awesome.info and page.tpl.php.

Awesome.info is pretty straight-forward to edit.

Drupal 6: Making clean URLs work with 000webhost

Posted: 27th April 2010 by Andrew Brown in Tutorials
Tags: , ,

I’ve seen a ton of people having trouble getting Drupal to emit clean URLs with their installation and the answer isn’t always the same due to the myriad of different hosting providers and servers out there.

My hosting provider of choice is 000webhost but until today I haven’t figured out how to successfully use clean URLs.

Imagine you’re standing in your dusty garage. It’s completely empty aside from you and ten cardboard boxes lined up in a row on the concrete floor in front of you. In each of these boxes are your personal documents, organized in chronological order. The boxes are closed, so how do you know what is in each box?

You look closer at the sides of the boxes and notice that each one is numbered: 1, 2, 3, 4, 5, and so on. “Okay,” you think aloud, “but where is the TPS report I’m supposed to have? Lumberg needs it by this afternoon.”

When someone first starts programming, the whole concept of “interpreted” languages and “compiled” languages might seem a bit confusing. Luckily, you have someone super smart like me to explain them to you in a manner that even your great grandpa could understand — even if he’s dead!

All decent programming languages are either compiled or interpreted. What language you’re programming in determines whether you need to download an interpreter or a compiler to run the programs you create. There are a few differences between the two types of languages.

Thing a Week 2: Cracking Combination Locks

Posted: 13th January 2010 by Andrew Brown in Thing-A-Week, Tutorials
Tags:

Single-dial combination locks are a common appearance in safes and places such as locker rooms and school hallways where tons of locks need to be used in many different places. These combination locks unlock by spinning a dial clockwise to the first number, reversing the direction to the second number, and rotating clockwise again for the third and final number (assuming the padlock only has three-number combinations, which this guide will cover).

Ethernet's Binary Exponential Backoff Algorithm

Posted: 14th December 2009 by Andrew Brown in Tutorials
Tags: ,

The Binary Exponential Backoff algorithm is a method of avoiding congestion on an Ethernet network. The algorithm is evaluated by all participants in a collision.

  1. At first, all computers in the collision continue transmitting a 48-byte “Jam Packet.” This packet ensures that everyone involved in the collision are aware that there has been a problem, which otherwise might not be the case.

For Loops For Zombies

Posted: 3rd October 2009 by Andrew Brown in Tutorials
Tags:

This is a tutorial I wrote for a friend that missed this day in class. However, I would really like to expand upon it in the future, and ideally write a whole book teaching a language. For now though, here is an introduction to using for loops.

For Loops

Note: The example code I use below is Java. However, the only part that is Java is the commands inside the for loop. The actual format of the for loop can be expanded to many other languages where it is the same, such as C#, C++, C, Perl, and PHP.

Remote File Inclusions (RFIs)

Posted: 16th September 2009 by Andrew Brown in Tutorials
Tags:

Remote File Inclusions (or RFIs for short) are one of the most common remote code execution (RCE) website exploits. The concept is simple: a website vulnerable to RFI allows you to include your own file or script. When you can run close to anything you want on a site, the possibilities are nearly endless.

Commonly, attackers will include the c99 or r57 shells on servers. These will allow direct shell access to the server, which can allow someone to log into the mysql database, download files, edit files, add users, or run arbitrary code.

How it works

Java Concept: Difference between objects and classes

Posted: 7th September 2009 by Andrew Brown in Tutorials
Tags:

I’m going to go into an analogy now to help explain, so bear with me.

Think of a deck of cards. There’s 54 cards in a deck. They all share similar properties. They all have a card width, a card height, a suit, and a number (or for face cards, letters.) Now, to represent any one Card, you would create one class that holds this data.

public class Card {
double cardWidth;
double cardHeight;
String suit;
String numberOrFace;
}

How To Change Your Subnet Mask In Windows XP

Posted: 29th March 2009 by Andrew Brown in Tutorials
Tags:

It’s easy to change your subnet mask on Windows. Sometimes it’s needed and there weren’t any decent guides online, so I thought I’d share this bit of knowledge with those that need it.