From: Eric D. <eri...@ja...> - 2006-01-19 16:27:53
|
Does anyone have a perl script to set email address not to receive email? I have a lot of email address that bounce when my slash site sends out daily stories, and I'd like an easy way to set these addresses to not receive the daily headlines. Thanks |
From: Blake C. <li...@li...> - 2006-01-20 18:14:12
|
Funny you should ask, I *just* wrote this thing that seems to do a decent job. It dropped my bounces from around 600 to about 20. First, this is a really bad way to harvest emails, but it catches most of them. I run qmail, so this works for for me, no idea how you'd do it elsewhere grep \<.*\> /home/vpopmail/domains/0/lisnews.com/btcarver/Maildir/.Bounces/cur/* | sed 's/ *(.*)//; s/>.*//; s/.*[:<] *//' | sort | uniq >emails.txt Then this just opens that file and reads the emails. I think it should work on any other slash databases. --------------------- #!/usr/bin/perl use DBI; $dbh = DBI->connect("dbi:mysql:database=database;host=localhost;user=user;password=password") or die "Couldn't connect to database: $DBI::errstr\n"; open (EMAILS, "emails.txt"); while ($email = <EMAILS>) { chomp($email); print "\n$email\n"; $sql = "select uid from users where realemail like '%$email%'"; print $sql; $sth = $dbh->prepare($sql); $sth->execute || die "Doh"; $RecordData = $sth->fetchrow_hashref(); $uid = $RecordData->{'uid'}; if($uid) { foreach($uid) { print "\ndeleted $uid\n"; $sql = "delete from users_messages where uid = $uid and (code = 1 or code = 0)"; $sth = $dbh->prepare($sql); $sth->execute || die "Doh"; } } } -------------- Blake Carver LISNews.org Librarian & Information Science News http://www.lisnews.org ----- Original Message ----- From: "Eric Dannewitz" <eri...@ja...> To: <sla...@li...> Sent: Thursday, January 19, 2006 11:27 AM Subject: [Slashcode-development] Script to disable headlines? > Does anyone have a perl script to set email address not to receive email? > I have a lot of email address that bounce when my slash site sends out > daily stories, and I'd like an easy way to set these addresses to not > receive the daily headlines. > > Thanks > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Slashcode-development mailing list > Sla...@li... > https://lists.sourceforge.net/lists/listinfo/slashcode-development > > |
From: Eric D. <eri...@ja...> - 2006-01-20 21:31:16
|
Thanks to Blake for the script about the email bounces! Another question. I potentially have to rebuilt my server that my slash sites run on. I'm wonder what the best way to move the MySQL database is. The server is currently running FreeBSD 4.11 with MySQL 4.1.14. I'm thinking of running FreeBSD 5.3 with MySQL 5. Should a dump of the database be just fine to get the slash stuff moved over? Is there any advantage to running Mysql 5 over 4.1? Any thing I should watch out for? Thanks in advance. |
From: Fred M. <fr...@ta...> - 2006-01-20 22:52:20
|
On Fri, 20 Jan 2006, Eric Dannewitz wrote: > to get the slash stuff moved over? Is there any advantage to running Mysql 5 > over 4.1? Any thing I should watch out for? I run taperfriendlymusic.org on Slashcode. At one point the drive filled up and Mysql truncated two tables in the slash database, that was using 3.2x. I don't know if that is the case with 4.1 or 5 but you might want to watch out for it. HTH, Fred |
From: shane <sh...@lo...> - 2006-01-21 12:36:45
|
On Jan 20, 2006, at 5:50 PM, Fred Moyer wrote: > On Fri, 20 Jan 2006, Eric Dannewitz wrote: > >> to get the slash stuff moved over? Is there any advantage to >> running Mysql 5 over 4.1? Any thing I should watch out for? > > I run taperfriendlymusic.org on Slashcode. At one point the drive > filled up and Mysql truncated two tables in the slash database, > that was using 3.2x. I don't know if that is the case with 4.1 or > 5 but you might want to > watch out for it. > > HTH, > > Fred huh? How does you letting your hard drive fill up have anything to do with *anything* else? that's like saying "well I've got a server, and it's HD filled up, and then things didn't work quite right" Well, that's a shocker ;) Things are going to break if the filesystem's full, especially *database* servers! Shane |
From: Fred M. <fr...@ta...> - 2006-01-21 17:50:58
|
shane wrote: > > On Jan 20, 2006, at 5:50 PM, Fred Moyer wrote: > >> On Fri, 20 Jan 2006, Eric Dannewitz wrote: >> >>> to get the slash stuff moved over? Is there any advantage to running >>> Mysql 5 over 4.1? Any thing I should watch out for? >> >> I run taperfriendlymusic.org on Slashcode. At one point the drive >> filled up and Mysql truncated two tables in the slash database, that >> was using 3.2x. I don't know if that is the case with 4.1 or 5 but >> you might want to >> watch out for it. > > huh? How does you letting your hard drive fill up have anything to do > with *anything* else? that's like saying "well I've got a server, and > it's HD filled up, and then things didn't work quite right" Well, > that's a shocker ;) Things are going to break if the filesystem's full, > especially *database* servers! I assume you use Slash because you have a lot of traffic, right? That traffic generates logfiles, which take disk space. You can argue that "Well you should have bought more hard drives", or "You should have a system ships the logs offsite". Which I agree with but when you run a high traffic site based purely on donations, things are not always ideal and you make do with what you have. People link to your site, and overnight you can generate several gigs of logfiles. And also you have users uploading music, sometimes 10 or 20 gigs a night. In my case, the Slash installation lost both the formkeys and access_log tables when the drive filled up. Do you think it's good behavior for database servers to drop tables when they fill up? Would it be good behavior for a filesystem to delete files when the filesystem fills up? I"m not trying to nitpick Slashcode here or assign blame. Slashcode has done really good things for myself and the music community I run. I'm sharing my experience of an edge case that I've run into. I suspect it's a Mysql issue and does not have anything to do with Slashcode, but I wanted to give you a heads up regarding my experience. Good luck, - Fred |
From: shane <sh...@lo...> - 2006-01-21 12:33:32
|
On Jan 20, 2006, at 4:30 PM, Eric Dannewitz wrote: > Thanks to Blake for the script about the email bounces! I second that :) > > Another question. I potentially have to rebuilt my server that my > slash sites run on. I'm wonder what the best way to move the MySQL > database is. The server is currently running FreeBSD 4.11 with > MySQL 4.1.14. I'm thinking of running FreeBSD 5.3 with MySQL 5. > Should a dump of the database be just fine to get the slash stuff > moved over? The data? One would think so. However, did you read the changelog of "what's changed" documentation on MySQL's website for migrating from v4 to v5? If not, you should. That would give you a lot of insight. And heck, you can always put mysql5 on another box, or the same box (not running w/ tcpip access in a different location on the file system) and try a db create and db import of the data from your slash site(s). I'd guess it'd work. However, I haven't read any of the MySQL 5 docs yet, so... > Is there any advantage to running Mysql 5 over 4.1? Any thing I > should watch out for? I'm sure there are! However, again, did you read the mysql v5 info? http://www.mysql.com/ . Off the top of my head, it's got stored procedures, triggers and views. No full-text-query with innodb, but I recall read somewhere that's coming eventually. > > Thanks in advance. From what I've heard mention, someone from the OSTG group has been cleaning things up in the slashcode source (cvs version) to work with MySQL5. When will it be done? I don't know, never been told - but I would guess "when it's done", sometime this winter/spring. So - If I were you, I'd grab the latest-stable MySQL 4.1x, install it and use it, for now, if it's a production site that's gotta be stable. If you're "just testing" then install v5 and give it a test runthrough and be sure to email the slashcode-dev list so everyone can hear how it went :) Shane |