HOME BLOG iPhone SCRIPTS MUSIC

Archive for September, 2008

Random background image script

Saturday, September 27th, 2008

Well, I was trying to make an automatic backgrounc color script for a webpage that randomly changed.  This is what I came up with.

You can view the site at http://tranquilpenguin.com/domain.php

The code is:

<?php
header(”Content-type: image/png”);
$q=rand(1,3);
$a=0;
$b=rand(0,254);
$c=rand(0,254);
$im=@imagecreatetruecolor(1, 2000) or die(”Cannot Initialize new GD image stream”);
$background_color = imagecolorallocate($im, 0, 0, 0);
$color=imagecolorallocate($im,$b,$c,0);
imageline($im, 0, 0, 1, 0, $color);
for ($i=0;$i<200;$i++) {
if ($q==1) {$color=imagecolorallocate($im,$b,$c,$a);}
if ($q==2) {$color=imagecolorallocate($im,$a,$b,$c);}
if ($q==3) {$color=imagecolorallocate($im,$c,$a,$b);}
imageline($im, 0, $i, 10, $i, $color);
if ($i <= 254) {$a++;} else{$a=$a-1;}
}
$z=$i;
while($z<2000){
imageline($im, 0, $z, 10, $z, $color);
$z++;
}
$color=imagecolorallocate($im,$b,$c,0);
imageline($im, 0, 2000, 10, 2000, $color);
imagepng($im);
imagedestroy($im);
?>

In the CSS of the main page just call the background like this:

body{
background: url(http://YOURDOMAIN.com/colors2.php);
background-repeat:repeat-x;
}

Feel free to tell me a better way to do it.

CSS Hack for IE

Wednesday, September 24th, 2008

Well, I was designing a simple webpage today and came across a “feature” in IE6 that was causing me a lot of problems.

I wont’ go into the politics (or arrogance) of Micro$oft today, but it’s been well documented that IE 6 and it predecessors don’t do things by the book (http://www.w3c.org).

Any ways, here was my problem:

I had a simple div that was misaligned by 1 pixel in IE6, but was fine in compliant browsers, and in IE 7.

I was working out a solution using but then I stumbled on this cool trick:

div.mydiv {
margin-top: 12px;
_margin-top: 13px;
}
It seem that IE 6 and below will read that _element, but IE7 and compliant browsers ignore it.

Ok, not sure if it’ll wash if I try to w3c css validate, but hey, it’s still cool :D

VirtuMonde

Monday, September 15th, 2008

VirtuMonde …

Ok, someone make me understand this. A 15 year old kid writes a virus that takes down M$ and the feds track him down and catch him in his basement in relatively short order.

Some company write a trojan called VirtuMonde and suddenly… nothing.

I spend my weekend fixing a computer for an older couple that make their living working their online store. Not this weeked, though.

This thing took over their system. It removed admin rights from their account. It broke googe and a host of other sites. It hooked their web queries to a popup engine. It… well, you get the picture.

I did manage to fix it… finally. I downloaded a program called combofix.exe and after that and several reboots and hijackthis sessions, I managed to make it all go away…

So, here’s the deal: Why can’t they do something about this? They can track down 15 year old kids, but not full blown companies? Surely, someone is making money off of this! Just look at the companies that are advertising on the popups… there’s got to be a money trail…

Oh, wait. Maybe they only pick on little kids? Maybe it’s only cause M$ has money and mom & pop don’t.

Either way… this is a huge problem, and costing people a LOT of money… Hey, my services ain’t free…

Hey, I got an idea! Just do what I do… I have an M$ box… that kinda sits there and collects dust except when I HAVE to use it… but I do ALL my on-line surfing on my Linux box. Hey, you can even just setup dual boot on your M$ machine.

At the very least, they could use Firefox. It’s not as safe as FireFox in Linux, but it’s a good start.

You know what bugs me?

Saturday, September 6th, 2008

You know what really bugs me?

Blaming the problem on it’s symptoms.  It seems that as time goes on people get more and more myoptic in their view of the world.  It doesn’t really matter what the problem is.

I don’t know if people are unable to see root causes, or if they simply refuse to see them.  I rather think it’s the latter. I guess that makes me a cynic.

Either way, that is a big reason why I made the decision to make the move to Linux.  Sure, it’s got room for improvement in some areas, but in the big picture I see it as way ahead of the competition.

So, a person I know said they didn’t like Linux because it didn’t “Play videos from ABC.com”.  No, that’s the symptom of a problem, not the problem.  ABC.com made the decision to stream their media in a way that ONLY works with M$ and Mac. Not because Linux is unable to play such streams either. The programmers PURPOSELY chose to not support Linux as an OS.  No, the statement that Linux doesn’t play videos from ABC.com is just not true.  That’s pointing the finger at the symptom of the problem. If you chose to raise a finger, raise it in the direction of ABC.com. They are the problem after all

SPAM SPAM SPAM

Saturday, September 6th, 2008

I just wanted to take a quick second to follow up on my war against SPAM.

No, I don’t have it out for small tins of mystery meat. I just don’t have time to wade through the plethora of emails concerned with the vast multitude of biological functions my body may or may not be executing efficiently.

I have found the many ISP’s either do a poor job of filtering SPAM or they do too good a job, the former filling my poor mailboxes, the latter making me shout “Is anyone out there?”

Running my own LAMP server for my several domains has solved this for me. I don’t have to rely on my ISP’s SPAM strategy now. I can simply do what works for me, as I receive and process my email directly.

Here’s the winning ticket for me:

/var/postfix/main.cf

smtpd_recipient restrictions = permit_sasl_authentication, permit_mynetworks, reject_unauth_destination, reject_invalid_hostname, reject_unauth_pipelining, reject_non_fqdn_recipient, reject_rbl_client zen.spamhaus.org, reject_rbl_client dsn.rfc-ignorant.org, reject_rbl_client dnsbl.njabl.org

There are many fine antispam blacklists out there, but there is a lot of overlap. One good example is that the fine CBL lists are incorporated into the zen.spamhous.org lists anyways. I tried to minimize spam checking overhead by using as few blacklists as possible, while gaining as much benefit as possible.

I would love to hear from anyone who has some additions I should make to the above.

Ampache

Thursday, September 4th, 2008

Well, the site is coming along.  I like wordpress for blogging but never cared much for the look and feel, so I kinda wrote my own interface.  As you can see, the main page is built with my own rrs feed from wordpress, and you just launch to wordpress when you click the feed links, or you can just select blog from the menu. Slick I thought anyways…

Moving along:

I installed Ampache this morning.  There are many online music streaming programs, but this is the one I like the most. I like the fact that it provided it’s on flashplayer so there is no client side requirements aside from a flash-enabled browser. Oh, and my recently played show up via rss at the bottom of the page :D

You can get it for your server at: http://ampache.org/

SPAM… what’s the point?

Monday, September 1st, 2008

Having been dabbling in webhosting for a few years now, I got to admit I’ve become quite confused by SPAM.

I spend the majority of my IT time doing two major tasks: Preventing Hackers and Preventing SPAM.

I kinda understand the first one… The anonymity that the hacker can have for activities such as phishing via an unsuspecting webhost can be big.  (And that’s why I had to rebuild my server recently :P)

I dont’ understand SPAM at all.  Let’s shrink the world for illustration sake.  Let’s say the world has 1 million Internet Users.  Let’s say they all have a single email account.

Now, here’s the deal. I would say that my postfix mail server which subscribes to several SPAM blacklists, filters close to 80% of the email traffic coming to my computer.  My setup is probably not much different that you local ISP’s.  Then, Spamassasin probably catches half of what’s left, meaning about 10% of the total SPAM sent to me I see.

Now, when I check my email to see if the ultimate email was sent to me by Bill Gates to let me know that it turns out that I am his long lost brother, and he wants to split his fortune with me, but all I see is an advertisement for erectile disfunction medications, well, now I’m mad.  Even if I was in the market for such a product, I sure ain’t gonna buy it for them, seeing how they are the one that stood between me and that email from Bill Gates. In fact, there’s a good chance that I’m gonna be so mad that I may even block his IP from my mailserver so he can no longer stand between me and my fortune… I digress…

Anyways, this plays out every day for the 1 million internet users.

What’s the point? 80%+ of SPAM gets blocked to begin with,  and the end user blocks much of what remains locally, and then get’s mad at the stuff he can’t stop.

So, who are these people answering erectile disfuction medication solicitations anyways?

STOP IT! You’re ruining the internet for the rest of us!!!


© 2009 BLMServices.com
Currently: Sunny: 45F