From pluglist at plug.org Sun Oct 31 19:26:25 2004 From: pluglist at plug.org (Dan Wilson) Date: Fri Feb 4 14:56:21 2005 Subject: PHP/HTML Question In-Reply-To: <4183F4A0.5040708@surveyz.com> References: <4183F4A0.5040708@surveyz.com> Message-ID: <41859ED1.60705@acucore.com> Sasha Pachev wrote: > * If you load-balance web servers, you will need to re-implement the > session manipulation functions to read/write the session data to some > shared storage, eg database, and then call session_set_save_handler() to > enable your functions. And this is already implemented for you: http://phpclasses.spunge.org/browse/package/1656.html -Dan From pluglist at plug.org Fri Oct 1 02:05:32 2004 From: pluglist at plug.org (Josh Jeppson) Date: Fri Feb 4 14:56:48 2005 Subject: SMTP Question Message-ID: <415D0FCC.7010600@jeppsons.org> Hey all, At work, we're wanting to setup something that is proving rather interesting. The idea is to have an smtp server that forwards everything it receives to a group of smarthosts, not in round-robin fashion, but rather an identical copy to each mail server. It's a test lab setup. I'm just not quite sure how to attack this. The idea would be to add as little as possible or nothing at all to the headers and handling of each email. So rewriting with filters and such is a very non-optimal solution. The setup is basically the following: Clients --> Processing SMTP Server --> SOMETHING --> Final SMTP Servers The Processing SMTP Server is iis and the Final SMTP Servers are iis, groupwise, sendmail, postfix, qmail, etc. Where SOMETHING is replaced by settings on the Processing SMTP Server, a box running sendmail, postfix, qmail, etc with special settings, some sort of proxy or whatever. Again, the idea is to pass the message as nearly identically to how it was sent by the Processing SMTP Server as is possible. A quick pointer in the right direction would be great... Any ideas? - Josh From pluglist at plug.org Fri Oct 1 06:53:48 2004 From: pluglist at plug.org (Michael Torrie) Date: Fri Feb 4 14:56:48 2005 Subject: Hack of the day In-Reply-To: <415CD291.6080602@surveyz.com> References: <415CD291.6080602@surveyz.com> Message-ID: <1096635228.30074.0.camel@enterprise.local.lan> On Thu, 2004-09-30 at 21:44, Sasha Pachev wrote: > Hello, everyone: > > I decided to switch to Kate for my text editing. Everything was the way I wanted What, you're giving up in vi? Apostasy! > out of the box except for one thing - syntax highlighting did not support the > black background very well. Well, here is a hack to fix it, for those interested: > > ------------- > #! /usr/bin/perl > > $sel_bg_r = 177; > $sel_bg_g = 177; > $sel_bg_b = 107; > > $bg_r = 0; > $bg_g = 0; > $bg_b = 0; > > > $min_dist = 255; > $max_tries = 5; > > @dirs = ($ENV{HOME}."/.kde/", > "/opt/kde"); > $color_regexp = "#[0-9A-Fa-f]{6}"; > > for $dir (@dirs) > { > fix_dir($dir."/share/apps/katepart/syntax/"); > } > > sub fix_dir > { > my($dir) = @_; > opendir(DIR,$dir) || do_die("opendir() failed for $dir"); > while($fname=readdir(DIR)) > { > next if (!($fname =~ /\.xml$/)); > $path = $dir."/".$fname; > fix_file($path); > } > closedir(DIR); > } > > sub color_dist > { > my($r1,$g1,$b1,$r2,$g2,$b2) = @_; > return abs($r1-$r2) + abs($g1-$g2) + abs($b1-$b2); > } > > sub fix_intensity > { > my($fg,$bg) = @_; > return $fg if (abs($fg-$bg) > $min_dist/3); > return 255 if ($bg < 128); > return 0; > } > > sub fix_rgb > { > my($r,$g,$b,$bg_r,$bg_b,$bg_g) = @_; > my($i) = 0; > my($r_q,$g_q,$b_q); > while (color_dist($r,$g,$b,$bg_r,$bg_b,$bg_g) < $min_dist) > { > $r = fix_intensity($r,$bg_r); > $g = fix_intensity($g,$bg_g); > $b = fix_intensity($b,$bg_b); > last unless (++$i < $max_tries); > } > > return sprintf("#%02x%02x%02x", $r,$g,$b); > } > > sub fix_color > { > my ($color,$is_sel) = @_; > my ($r,$g,$b); > $r = hex(substr($color,1,2)); > $g = hex(substr($color,3,2)); > $b = hex(substr($color,5,2)); > my ($my_bg_r,$my_bg_g,$my_bg_g); > > if ($is_sel) > { > $my_bg_r = $sel_bg_r; > $my_bg_g = $sel_bg_g; > $my_bg_b = $sel_bg_b; > } > else > { > $my_bg_r = $bg_r; > $my_bg_g = $bg_g; > $my_bg_b = $bg_b; > } > > > $fix_color = fix_rgb($r,$g,$b,$my_bg_r,$my_bg_g,$my_bg_b); > #print "is_sel=$is_sel,$color=$r,$g,$b,fixed to $fix_color\n"; > } > > sub fix_line > { > my($line) = @_; > my(@parts) = split(/($color_regexp)/,$line); > $line = ""; > my($part); > my ($is_sel) = 0; > foreach $part (@parts) > { > if ($part =~ /$color_regexp/) > { > $part = fix_color($part,$is_sel) ; > } > else > { > $is_sel = ($part =~ /selColor=/); > } > $line .= $part; > } > return $line; > } > > sub fix_file > { > my ($fname) = @_; > my ($tmp) = "/tmp/kate-tmp.xml"; > #print "$fname\n"; > open(TMP,">$tmp") || do_die("Could not open $tmp"); > open (FH,$fname) || do_die("Could not open $fname"); > > while ($_=) > { > if (/$color_regexp/) > { > $line = fix_line($_); > } > else > { > $line = $_; > } > $line =~ s/(bold|italic)=\".\"//g; > print TMP $line; > } > close(FH); > close(TMP); > sys_cmd("mv $tmp $fname"); > } > > sub do_die > { > my($msg) = @_; > die "$msg: $?\n"; > } > > sub sys_cmd > { > my($cmd) = @_; > print("$cmd\n"); > system($cmd) && do_die("$cmd failed"); > } > > > ------------- -- Michael Torrie From pluglist at plug.org Fri Oct 1 07:37:02 2004 From: pluglist at plug.org (Soren Harward) Date: Fri Feb 4 14:56:48 2005 Subject: PHP $_GET problem In-Reply-To: <20040930214227.GA30359@charlescurley.com> References: <20040930214227.GA30359@charlescurley.com> Message-ID: <20041001133702.GA10901@et.byu.edu> --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu 30 Sep 2004 at 15:42:27, Charles Curley said: > I have a