Posted by kerneljack on February 23, 2005
I’m quite fond of the Apple mailing lists, particularly java-dev and cocoa-dev. They’ve helped me solve quite a few problems on occasion. I once needed to hide the menubar on top of the screen in OSX and I found that it is as simple as this:
[NSMenu setMenuBarVisible:false];
Let’s say you want to pass some arguments to your Cocoa program from the command-line, so how do you do it? If you look at the main.m file that XCode generates you can see that all it does is create an instance of NSApplication and passed the arguments to it, but where do these arguments go? How do I access them from within some other class. Once again, the simply answer, from cocoa-dev is to use NSProcessInfo as so:
NSArray *args = [[NSProcessInfo processInfo] arguments];
This puts them all in a nice array for you. Took a while to figure all these things out, many thanks to the Apple mailing-lists.
Just in case you’re wondering why I didn’t read the API docs, well it isn’t obvious from reading any of the docs that command-line arguments end up in NSProcessInfo. I googled forever but couldn’t find an explanation and read many docs. In the end the lists had already got the solution and I should have looked there in the first place.
Posted in coding | Leave a Comment »
Posted by kerneljack on February 14, 2005
So I decided to install a full anti-virus and Spam filtering system on my web/mail server using Amavisd-new/ClamAV/SpamAssassin. This has gone pretty well especially since I’m using the Razor plugin for SpamAssassin.
Razor is like a collaborative network of machines which hold signatures for spam that is currently circulating around the Web. Each time I receive a mail into my system, a unique signature is generated for it and this signature is checked against the signature database in Razor servers on the net. This catches so many spam emails it’s not funny. On certain days I Razor catches 77 spam messages and all my normal emails are untouched and end up in my inbox. Razor is a true lifesaver.
ClamAV is also pretty good at catching viruses in email. It just scans each mail as it comes in and if it’s infected, puts it in ‘quarantine’ and sends the admin an email about it. Very transparent and it works nicely.
The only downside to all this was that I had to pull some packages from Debian’s ‘testing’ branch which may not receive timely security updates. I didn’t think that I could rely on ‘testing’ to give me timely updates and this seems to confirm it. The official word seems to confirm this as well. I guess my only choice is to add:
deb http://security.debian.org/ testing/updates main
deb http://security.debian.org/ stable/updates main
to the sources.list file and hope I get timely updates from both.
Posted in computers | Leave a Comment »