Archives for the ‘how to’ Category

install build tools on centos 5

By admin • Jul 7th, 2008 • Category: how to, linux
If you’re new here, you may want to subscribe to my RSS feed. Thanks for visiting!When you first install centos 5, you’ll notice your unable to build from source (make / make install) On ubuntu theres a package called build-tools that contains everything you need to build from source. On centos you install them individually […]


how to: Fix utorrent hidden issue on ubuntu

By admin • Jun 20th, 2008 • Category: how to, linux
I have utorrent running via wine, when suddenly it stops displaying… remove the settings.dat and settings.dat.old from {wine}/c_drive/windows/profiles/{user}/Application Data/utorrent install the latest version. uncheck hide to task bar, close to taskbar cheersgreg


php: domain base regex

By admin • May 11th, 2008 • Category: how to, php
I needed to get a domain name with out any subdomains or tld for bacon 100%. after a bit of trail and error //body of domain ex: iam.bacon.com we want bacon $domainBody=preg_replace(’/^[a-z0-9.-]*?[.]{0,1}([a-z0-9-]*?)\.[a-z.]{2,6}$/i’,”$1″,$serverHost); I tested on the following domains locally www.frameword.sid framework.sid am.i.a.sub.domain.y.o.u.b.e.t.framework.sid.me am.i.a.sub.domain.y.o.u.b.e.t.framework.sid I’d think it’d be pretty simple to change the regex to get the full domain, just move \.[a-z]{2,6} in to […]


php security in a nutshell

By admin • May 9th, 2008 • Category: how to, php
I have a friend I’m teaching foundation security to. This post is for him, but also as a protest to some of the materials I’ve found when looking for reference material for him. Security at it’s simplest form is common sense. ask yourself, how can I make sure I get exactly what I want? How do […]


Php: how to get base domain

By admin • May 8th, 2008 • Category: how to, php
The problem: take a url (in this case, we’ll specify an absolute url, http and all) and return only the base domain. For instance, given ‘www.domain.com’ or ’sub.subdomain.domain.com’, it should return ‘domain.com’. Simple enough, but now consider: ‘http://www.example_site.com.pk’ or ‘http://damnlimies.co.uk’ or ‘http://username:password@this.is.a.worst.shortly.subdomain.thisIsMyMainWebsite.com.cl’ It is an anvil upon which many a hammer has been broken: http://lists.evolt.org/archive/Week-of-Mon-20031201/152316.htmlhttp://www.webmasterworld.com/forum88/10656.htm Anyway, I think I have a solution. I won’t bother with […]