Archive for the 'Linux' Category
Crystal Reports - Converting UNIX Time Stamp
I had a heck of a time finding out how to convert a UNIX time stamp in Crystal Reports. My company has a ecommerce package that stores all sales date in a UNIX time stamp format. Which means it stores the time and date by storing the number of seconds since 1/1/1970.  So here is the formula I came up with…
dateadd (”s”,{order.date}-18000, #1/1/1970#)
dateadd function does the trick, the “s” is for seconds, order.date is the table that contains the unix time stamp, -18000 is -5 hours from UTC in seconds because im in the Eastern Time Zone and 1/1/1970 is the base date for dateadd to add the other argument to.
Hope This Helps!
Chris Edwards
5 commentsHow To Export and Import Your PuTTY Sessions
If you want to copy Putty configuration from a Windows computer to another same version Windows computer, here is what to do:
- On a model computer, configure Putty to your desire, save and test it to make sure it works the way you want it to.
- Start/Run/regedit to run regedit tool
- Browse to HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys
- Delete all values under this key EXCEPT the (Default) value
- Right click on HKEY_CURRENT_USER\Software\SimonTatham and select Export, then save it as “setup-putty.reg” to a location that you want
- Copy setup-putty.reg and the Putty.exe files to a machine that you want to copy Putty configuration to
- On this new computer, double click on setup-putty.reg to import Putty configuration
- Upon successful configuration import, run Putty.exe. You should see all Putty configuration there. You can safely delete setup-putty.reg since you only need to run it ONCE on each new computer that you want to use Putty with tthe same configuration.
Fedora / Linux editing fstab in maintenance mode
Today was a fun day. I rebooted one of my IBM Blade servers only to find out that it would only come back online in maintenance mode. I had added a fstab entry for a USB drive that I was adding to the machine. I hadn’t taken the time yet to plug the drive in. So when I rebooted the machine walla… maintenance mode… The server thought the drive was corrupt or bad. Then I realized the machine booted into READ ONLY while in maintenance mode. So I hunted the solution and thought I would share it. The trick is to remount the drive as READ WRITEABLE.  Its an easy solution but may throw you for a loop in a tight spot. Here ya go….
# mount -n -o remount,rw /
No commentsSpamassassin + Linux + Exchange + Imap
I have been looking for two days for the following information on how to easily allow my users that use exchange to report their spam to spam assassin. I found the following message from Mike French…
Many thanks to all that replied to my request for information on
implementing IMAP learning through exchange!
Many thanks to all that replied to my request for information on
implementing IMAP learning through exchange!
Special Thanks to Richard Ozer for providing the below which worked much easier then I thought it would! The client doesn’t have to support imap.? What you do is put imap support on your spamassassin server, read the stuff in exchange’s SPAM folder using
imap, and push it to sa-learn.
Here’s something I wrote up a while ago.
***************************************
How to support ad-hoc Bayesian learning with Microsoft Exchange Server and
Outlook
Problem:
Many organizations use Microsoft Exchange, MS Outlook, and Outlook Express with IMAP for their corporate e-mail. Typically, SpamAssassin is running on a Linux box that tags the mail and forwards it to the Exchange server for delivery. One of the challenges in implementing SpamAssassin in this environment has been to provide a seamless mechanism for end users to train the bayesian filter. The reason this is difficult is that neither Outlook nor Outlook Express preserve the original message headers when mail is
forwarded from one mailbox to another. This makes it tedious to send the necessary information to a spam or ham mailbox. Although mainly a training problem, most users are unwilling to take the additional time to manually copy the original headers into a new message, along with the original message body. It’s simply too unwieldy to do so. This often leaves the task of Bayesian training to the mail admin, who receives forwarded spam message from the end users (usually without the pre-requisite headers) and is expected to add the offending email to a blacklist, or to create a new rule.
Solution:
The only time headers are properly preserved in Microsoft Outlook or Outlook Express, is during a drag and drop operation. This suggests a solution that takes advantage of Microsoft Exchange’s public folder capabilities. A “Spam” public folder and “Ham” public folder can be created on the exchange server, allowing users to drag spam or ham into these folders where they will await retrieval by the SpamAssassin host.
A key piece of this puzzle can be found on Nick Burch’s web site at:
There you will find a perl script called imap-sa-learn.pl. This script will logon to any server supporting IMAP, retrieve any messages located in any arbitrarily named folder, process the contents of that folder as either ham or spam, delete the processed messages, and then run an sa-learn –rebuild. The script is simple to understand, and you need only predicate your public folder name with the “Public Folders” directive. For instance, if you create a public folder called “Spam”, you would set the script variable containing the Spam folder’s path to:
my $defspamfolder = ‘Public Folders/Spam’;
Likewise, you would do something similar for the Ham folder.
On the exchange side, create a domain user called spamassassin with minimal rights and create an exchange mailbox for it… it should never receive any mail. The account is there simply to give the account access to the public folders.
Using Outlook, and while logged in as an administrator, create the Spam and Ham public folders. Right click on each folder, go to the folder properties/permissions tab and make the spamassassin user a folder “Owner”. This will give the spamassassin account the necessary privleges to delete processed messages. The default permissions should allow anyone to post to the folder, and delete only their items.
In Nick’s script, set the login and password to the spamassain user’s account ID and password, and test. By using a non-admin account for the spamassassin, you avoid the risk of having a plain-text administrator name and password sitting inside a perl script.
This mechanism works for both Exchange 5.5 SP4, or Exchange 2000+.
Richard Ozer
Mike French
MIS OnlineServices
www.misonlineservices.com
P.S. Thank Mike for the instructions, now im up and running myself.
No comments






