Source: http://feedproxy.google.com/~r/ETCelebrities/~3/tGbRhIBOPG0/index.html
Saturday, January 1, 2011
Not Calling Next Year ?Twenty Eleven? Will Be the End of Us All
About a year ago, without discussing it with one another, we each made a choice: Some of us were going to call this current year ?two-thousand ten,? and some of us were going to call it ?twenty ten.? For those going with the former, it was a mere continuation of the format we had used for the past decade. And those people were wrong. The double-digits format is easier and quicker to use now, just as it was for all the years we employed it before 2000, and just as it will be if we start to use it uniformly for the rest of this millennium. How do you pronounce ?1789?? See, you don?t say ?one-thousand seven-hundred eighty-nine.? Unless that?s a rare kind of autism, and you have it.
Twelve months later, society is still divided on what to call this year, and it seems we will be in conflict anew over what to call 2011. These are, after all, the Years of Our Lord, and He has to be getting pretty annoyed with us no longer being able to reach consensus on something as simple as what to call them. It?ll come as no surprise when we get to 2012 and He decides to finally put an end to this pathetic species.
Hylafax on Centos Scripts
2010/03/22
I finally did get back to the SCO to CentOS conversion I mentioned back in November at Hylafax 6 on Centos 5. This all took so long because the application (a point-of-sale system) is critically important to the customer and every detail had to be tested and retested. That testing sometimes involved disrupting normal operations, so it was hard to schedule and we always had limited time. Eventually it all came together and they now are running on Centos.
Aside from transferring user accounts, printers, and so on, my work was just to convert Vsifax scripts to Hylafax. Those scripts were called by the application program to do such things as fax a Purchase Order to a vendor. The programming is simple enough: you find and extract the fax number and pass that all off to Hylafax. For purposes of logging and error control, we also wanted to identify the vendor name, which required adding that name to the logs that Hylafax keeps or maintaining a separate index of names to faxes queued. At first I thought I might have to do the latter - Hylafax does allow you to add an "identification" tag to faxes, but none of its tools (like "faxstat") show that tag. However, the tag does appear in log files, so I could get what I needed.
Let's take a look at some of the basic scripts involved here.
The first task is to extract a fax number and vendor name. That's easy enough:
#!/usr/bin/perl $err=0; $login=$ENV{LOGNAME}; @stuff=<>; # extract the fax number $faxnum=substr($faxline,9,14); $faxnum=~ tr/0-9//cd; $faxnum=~ s/ //g; chomp $faxnum; # extract the vendor name $tg1=substr($stuff[7],10,25); $tg1=~s/^\s+//; $tg1=~s/\s+$//; $tg1=~s/ /_/g; if ($err or not $faxnum) { # if there is no fax number, print the PO for hand faxing or investigation open(O,"|/usr/bin/lp -dRECEIVING"); print O "Fax request from $login problem\n"; print O "No faxnumber $faxline \n" if not $faxnum; print O "===============\n"; foreach(@stuff) { print O $_; } close O; exit 0; } # send fax and add $tg1 tag to log $cmd="sendfax -i $tg1 -n -d \"customer\@$faxnum\" $file"; system($cmd); # reset fax modem status system("faxmodem ttyS0"); exit 0; By the way, by default, Hylafax converts text and adds healthy margins at the top and bottom of the fax. These pushed our PO to two pages when it didn't really need to be. To take those out, I modified /usr/local/lib/fax/typerules to adjust the arguments sent to "texfmt" (the program that converts text to a tiff to fax):
0 ascii x ps %F/textfmt -B -f Courier-Bold\ -Ml=0.4in,t=0.1in,b=0.1in -p 11 -s %s >%o <%i
You could do the same thing by adding to your config file in /var/spool/hylafax/etc/:
PageMargins : l=0.40in,r=0.40in,t=0.1in,b=0.1in
You can also adjust the default font size and style,
Now we need something to let them see the status of faxes. As I noted above, the default "faxstat" program doesn't pick up the tag they want, so I wrote a cron script that regularly checks the Hylafax "doneq" (completed faxes, successful or not) and rewrites data to other files:
#!/usr/bin/perl $notify="faxerrs@thiscustomer.com"; chdir("/var/spool/hylafax/doneq") or die "Hylafax gone!"; while(<q*>) { open(I,$_); @stuff=<I>; foreach (@stuff) { chomp; $status=$_ if /^status:/; $number=$_ if /^number/; $jobtag=$_ if /^jobtag/; $mailaddrees=$_ if /^mailaddrees/; } $status=~ s/^status: *//; $number=~ s/^number: *//; $jobtag=~ s/^jobtag: *//; $mailaddress=~ s/^mailaddress: *//; push @line,"$_ $number $mailaddress $jobtag $status\n"; if ($status) { # not sent open(O,"|/usr/local/bin/email -subject 'Fax failure ' $notify" print O "$_ $number $mailaddress $jobtag $status\n"; close O; open(BAD, ">>/tmp/badfax"); print BAD "$_ $number $mailaddress $jobtag $status\n"; close BAD; } if (not $status) { open(GOOD, ">>/tmp/goodfax"); print GOOD "$_ $number $mailaddress $jobtag $status\n"; close GOOD; } # remove from "doneq" unlink("$_"); } exit 0; Their application has menu choices to look at either the successful or failed faxes. Those just do something like:
tac /tmp/badfax | less
("tac" works like "cat" but reverses the file so the latest addition will be at the top)
Another cron job cleans out these files as necessary:
#!/usr/bin/perl open(I,"/tmp/goodfax"); @good=<I>; $s=@good; if ($s > 25) { $x=20; open(I,">/tmp/goodfax"); while ($good[$x]) { print I $good[$x++]; } } open(I,"/tmp/badfax"); @bad=<I>; $s=@bad; if ($s > 25) { $x=20; open(I,">/tmp/badfax"); while ($bad[$x]) { print I $bad[$x++]; } } Notice that I never clean out the file completely; it's always the latest 20 lines that are left there.
Comments: Click Here.
Want to showcase your product to our audience? Check our advertising options.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them.
I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. If you have any question, please do feel free to contact me.
| - | Skills Tests | - | Psst - wanna work for yourself? | - | Unix/Linux Troubleshooting e-book | - | Kerio Mail Server | - | Consulting | - | Advertise Here |
Source: http://feedproxy.google.com/~r/aplawrence/DOLL/~3/06czJ1NqPQM/hylafax-scripts.html
PHOTOS: Anya's Favorite Holiday Gift Picks
Source: http://feedproxy.google.com/~r/ETFashion/~3/ek4NOFYcBp4/index.html
iphone Lindsay Lohan maksim chmerkovskiy colt brennan accident cell phone
ASUS EP121, EP102, EP101, and EP71 tablets get diagramed in latest teaser
Continue reading ASUS EP121, EP102, EP101, and EP71 tablets get diagramed in latest teaser
ASUS EP121, EP102, EP101, and EP71 tablets get diagramed in latest teaser originally appeared on Engadget on Thu, 30 Dec 2010 10:32:00 EDT. Please see our terms for use of feeds.
PermalinkSource: http://www.engadget.com/2010/12/30/asus-ep121-ep102-ep101-and-ep71-tablets-get-diagramed-in-late/
maksim chmerkovskiy colt brennan accident cell phone eva longoria ipad
Why Camille Grammer Wants $50 Million
This just in: Kelsey and Camille Grammer won't be getting back together.
With the actor engaged to Kayte Walsh and the Real Housewife having lost so much respect for her ex, why haven't these two officially filed for divorce yet? Two words: money and revenge.
Is Camille Grammer America's Most Hated Housewife? Vote HERE!
The New York Post reports that Kelsey offered Camille about one-third of his fortune last week. But the latter didn't accept $30 million as a settlement because the amount did not include alimony or child support.
Oh, and because she wants to make her soon-to-be-ex suffer for his recent behavior.
According to California law, Camille is entitled to half of what Kelsey earned during the pair's marriage. This amounts to approximately $50 million. She's intent on collecting every penny, a friend says, because:
"She has accepted their marriage is over and that he wants to marry Kayte in January.. but what she can't accept is how he's parading around Kayte, who looks like the cat who swallowed the canary. Their public make-out sessions are really insensitive because of their kids."
Source: http://www.thehollywoodgossip.com/2010/12/why-camille-grammer-wants-50-million/