Wednesday, October 28, 2009

Kyocera Mita or other copiers SMB connect failed because of case sensitivity

I had a problem where SMB connection failed miserably. Well, two problems concurrently.
1) Slow resolution to domain name (solution: fix dns)
2) Connection failed immediately. I knew it should have worked. KNEW it. But it was case sensitive for the path and therefore failed.

Tuesday, October 27, 2009

spoolsv.exe crashes instantly

Print spooler was crashing on Windows XP client. spoolsv.exe and the c:\windows\system32\spool\printers directory was empty.

mkdir c:\prtspool

Pop open regedit,
go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Print\Printers
and change the DefaultSpoolDirectory to the new c:\prtspool
net start spooler
it works.
Don't ask me why or how. I don't rightly care, but then I'd probably want to run scandisk or something.

Monday, October 19, 2009

psftp, sftp, ftp put *filename

Because I saw this through my referral logs, just wanted to post that to put (or get) multiple files, you should use the mput or mget command when sending or receiving multiple files from psftp, sftp, or ftp.

Saturday, October 10, 2009

MySQL Query to check if a birthday is upcoming in 7 days

Someone probably has done this before, but in case it hasn't been done, here's my query:

$result = mysql_query("SELECT FirstName, LastName, DATE_FORMAT(birthday, '%M %d') as bday, CONCAT(IF(MONTH(birthday)=1 AND MONTH(CURRENT_DATE())=12, YEAR(CURRENT_DATE())+1, YEAR(CURRENT_DATE())), DATE_FORMAT(birthday, '-%m-%d')) AS fakebirthday FROM birthdays WHERE CONCAT(IF(MONTH(birthday)=1 AND MONTH(CURRENT_DATE())=12, YEAR(CURRENT_DATE())+1, YEAR(CURRENT_DATE())), DATE_FORMAT(birthday, '-%m-%d')) BETWEEN CURRENT_DATE() AND DATE_ADD(CURRENT_DATE(), INTERVAL 7 DAY) ORDER BY fakebirthday;");

What it does (this is PHP code, but the stuff in double-quotes is the real meat.):

  1. birthday is stored in datetime format
  2. The SELECT AS is relatively straight-forward. I don't want to divulge age/years of this list, so I'm only reporting month and day (January 1) in the result
  3. I'm making a fakebirthday calculation in order to sort/Order by. Unfortunately, I can't use the fakebirthday in "WHERE" clause, so I repeated the calculation to do my "WHERE".
  4. The idea is to check for the next 7 days, and cheat by prepending *this* year on the birthday's month and day. Unfortunately, if this month is December (12) and the birthday is in January (1), this won't work, so add 1 to this year and prepend it to the January birthdates -- but only when running this in December.
  5. of course, check if it's between today and 7 days from today
  6. and sort by the "fake" birthday because it's easier to sort this way so that January comes after December


Oh, I know it's ugly code. It's probably slow, too. However, the idea is this should run once a day (once a week?) on fairly small amounts of data (office active employee records).

Friday, September 18, 2009

Smoothwall/Firewall check for spambot on lan

More or less, this is a placeholder until I get more information.

You have smoothwall or other linux based firewall proxy.
type this
tcpdump -qt port 25
on the proxy server.
ctrl-c to abort

Monday, August 31, 2009

Microsoft Outlook won't connect to Exchange Server

I was troubleshooting an issue where the Outlook client wouldn't connect to Exchange Server. It wasn't a ping issue (I could ping the server) and it wasn't domain resolution. I also could view the one user's Outlook Web Access Account. It simply wouldn't connect Outlook to Exchange, either hanging on profile creation, or giving an error on connect.

To fix this, I went to c:\documents and settings\username\local settings\application data\microsoft\outlook and added a new folder "old" and moved the stuff in outlook folder to "old" and tried again. This apparently cleaned itself up.

Sunday, August 30, 2009

Computer sluggish? Check your path

After decommissioning a server, it was found that certain machines were DOG slow. This apparently was because an app changed the PATH variable to point to a directory structure on the now defunct server. To fix this, the best way is to go to Windows System Properties, advanced, Environment variables, Path and remove the errant directory structure.

This may very well affect other pieces of software, such as your antivirus program on startup.

Blog Archive