Tuesday, March 31, 2009

A Call For All: Start Using OpenDNS!

There's been a lot in the news lately about the-virus-that-must-not-be-named (because if your computer is infected it won't let you view pages that refer to it by name.  They should call it the Voldemort virus!)  As computers become more advanced and sophisticated, so do the attacks and malware that can be crafted using them.  As consumers, I feel like it's important that we educate ourselves our these tools we have come to rely on every day, so that we can use them securely and effectively.


Here are my recommendations:



  1. Don't use Microsoft Internet Explorer.  Why?  Because its "ActiveX" controls are too integrated with the operating system environment, which makes it a prime target for the bud guys.  Use Mozilla Firefox instead.

  2. Once you're using Mozilla Firefox, install the AdBlock Plus add-in.  At the browser level, not only can it block images, scripts, and domains for advertisements, but also for virii and malware.

  3. Use OpenDNS!  Almost all internet communication relies on DNS (which stands for Domain Name Server) to look up the websites you surf to everyday.  For instance, you type in www.google.com.  How does your computer know where that is?  First it must be looked up on a DNS server to get its IP address (mine just returned 74.125.67.103 for google).
       Once you have set your computer or router to use OpenDNS's servers, OpenDNS will block all attempts to access domains that you specify.  You can customize it to your liking.  You can set OpenDNS to block access to porn sites, other sites, etc.  A screen shot is in order:

    Clipboard01



Yes, OpenDNS takes a little doing to set up, but it's worth it for your peace of mind.  If you don't feel like you can do it, ask a computer saavy friend or relative to do it for you (hopefully they've already done it).

Wednesday, March 11, 2009

Flashing Tomato Firmware to a Linksys WRT54G-TM Wireless Router

I recently purchased a Linksys WRT54G-TM (the T-Mobile one) off ebay for $40. My intention was to flash the firmware to DD-WRT or Tomato. I need to put a couple of computer workstations out on our factory floor, but I don't want to have to run ethernet cable out to them. Instead, I thought I'd try to form a wireless bridge with our existing Linksys wireless router that's in the office.

Some background information:
Different versions of Linksys WRT54G wireless routers have different processors and amounts of memory, so you have to choose carefully before purchasing one. You may need to have the seller look on the bottom of the unit for the serial and/or version number. From what I've heard, once Linksys found out that people were flashing custom firmware on to their routers, they started reducing the memory in the units and put in some kind of CFE ("Common Firmware Environment") that could detect if the factory firmware was overwritten and automatically restore it.
 
I wanted to flash the Tomato firmware onto my unit but apparently Tomato doesn't have any method of flashing the CFE. So first I had to follow these instructions to flash the CFE and load DD-WRT. These instructions worked like a charm for me, and then it was quite simple to update the firmware to Tomato from DD-WRT.
 
Once I had Tomato loaded, I switched it to "Wireless Ethernet Bridge" mode and then I entered the same SSID and security key from my existing wireless router and voila! all I have to do is plug the power cable in and I have instant wireless access to our network anywhere within the range of my existing wireless router, as though I were connected with an ethernet cable!
 
The only thing I'm worried about now is the unit overheating when it gets hot out on the plant floor in the summertime. I'm thinking about underclocking the unit to make it run cooler, because it runs a little warm right now at the default 200MHz. The telnet login username is "root", and the password is what you set it to be in the web-admin interface.

Monday, March 9, 2009

Using Blat and xp_cmdshell in SQL Server 2000

This has happened to me twice here at work:


I set up an automatic script to run regularly to do some processing for a department.  I create folders on the shared drive to export the processed files to.  Then the user in that department comes along and (accidentally or otherwise) deletes or renames one of those folders used for export in my script.  Then the script doesn't run anymore, and they come and ask me what's wrong.


Lesson learned: ALWAYS have your scripts check to verify that all necessary executables and paths are present, and have a way for the script to notify me if it is otherwise.


Today I spent most of the day coming up with some code to put in our custom payroll processing SQL stored procedure that checks to make sure the export directories are present, and creates them and notifies me if they aren't.


DECLARE @result1 int, @result2 int
EXEC master..xp_cmdshell 'if not exist "\oursvrsharePayrollExports for Payroll" echo Folder "sharePayrollExports for Payroll" could not be found.  Creating... >foldercheck1.txt',no_output
EXEC master..xp_cmdshell 'if not exist "\oursvrsharePayrollExcel Hours Report" echo Folder "sharePayrollExcel Hours Report" could not be found.  Creating... >foldercheck2.txt',no_output

/*
If these files exist then the folders couldn't be found, else these files won't exist and this command will fail and @result will be 1
(which is a good thing, it means the folders were located.)
*/
EXEC @result1 = master..xp_cmdshell 'TYPE foldercheck1.txt',no_output
EXEC @result2 = master..xp_cmdshell 'TYPE foldercheck2.txt',no_output

IF @result1 = 0  --Folder not found
BEGIN
    EXEC master..xp_cmdshell 'blat foldercheck1.txt -to it@k.com -ss -u blat@k.com -pw opensesame -q'
    EXEC master..xp_cmdshell 'mkdir "\oursvrsharePayrollExports for Payroll"',no_output
END

IF @result2 = 0  --Folder not found
BEGIN
    EXEC master..xp_cmdshell 'blat foldercheck2.txt -to it@k.com -ss -u blat@k.com -pw opensesame -q'
    EXEC master..xp_cmdshell 'mkdir "\oursvrsharePayrollExcel Hours Report"',no_output
END

EXEC master..xp_cmdshell 'DEL /Q foldercheck*.txt',no_output  --DEL does not return 1 if it cannot find the file to delete!


Of course, blat must be installed.  And I really should check that blat is present or else give an error.

Thursday, March 5, 2009

Pardus - Turkish Linux Distro

Today's post is just
for the cool character illustrations I found here.

 


Pardus



 
 

Tuesday, March 3, 2009

Weird Outlook 2002 Error: "The messaging interface has returned an unknown error..."

Today someone at our company was trying to send some emails in Microsoft Outlook 2002, running in Windows 2000 OS.  (I know, I know.  Why are we running such ancient software?  Because I believe in the old adage: "Use it up, wear it out, make it do, do without then upgrade.")  He had three emails that were hung up in his Outbox, and he couldn't delete them.  They would just keep sending themselves over and over again.  When he tried to delete them from the Outbox, he got this message:



Att3d3e8


I googled the message and looked at some of the results.  One of them said it could be fixed just by emptying the Deleted Items folder, but that didn't work.  Another said to create a new Outlook profile, which I was in agreement with.  This employee has been working on the same Windows 2000 box for the past 5 years, without a single re-install (and that's saying something!).  His Outlook .pst file was right at the 2GB mark, and I remembered having heard that in versions prior to 2003, Outlook had problems with .pst files greater than 2GB.


I did end up creating a new Outlook profile for him, which I had never done before.  You have do close Outlook to do it, and go to Windows Start > Settings... Control Panel > Mail and do it there.  But what I wanted to share here was this trick:  The emails that couldn't be deleted because of the above error message, I was able to delete by holding down SHIFT while deleting them.  Keep in mind that this was after I had emptied the Deleted Items folder, although I'm not certain that had anything to do with it.


Creating a new profile automatically creates a new .pst file, mine was automatically named Outlook1.pst.  I wanted a more descriptive, meaningful name for the file than that, so I closed Outlook, and changed the file name to 2009 Email.pst.  Then I opened Outlook again, it complained that it couldn't find the .pst file, but eventually it let me point to the file with the changed name.  The next trick is how to change the name of the .pst group of folders that displays inside of Outlook (The default is "Personal Folders."  The link is for Outlook 2007, but it's the same back in 2002).  You'd think you would be able to do that by just right-clicking on it and choosing Rename... (the option is greyed out) or by choosing Properties and changing it there (the name field isn't greyed out there, but it still can't be changed).  But you have to go one step further, and click the Advanced... button in the Properties dialog, and there (finally!) you can change the name.