Archive for March, 2007

History of Blogging

Tuesday, March 20th, 2007

This cracked me up:

History of Blogging
found @ veronicabelmont.com

What is it about cats that it makes people chronicle their every move? And this is by no means an internet phenomenon! Look at ancient Egyptians - they were nuts for these critters. You know those hieroglyphs that we are yet to decipher? I bet like 80% of them are fucking stories about pharaohs cat and his crazy adventures in the kitchen.

Seriously people, enough with the cats! I have like 4 of them living in my back yard. They are completely wild, untamed, little fuckers, and they run away from people. They do eat the food I put out for them though. But do you see me blogging about them? No!

Fuck… I just blogged about cats. x

Remove Stuck Jobs from the Printer Queue

Tuesday, March 20th, 2007

Did you ever had a job on your printer queue that just couldn’t be deleted? I find that this happens quite frequently with shared network printers on Windows networks. This stuff can be a pain in the ass, so here is how to deal with these kind of situations. You have to manually clean out the spool folder.

This should be a common knowledge thing, but surprisingly few people know about this so I’m posting it here. This way I can just send this link to people who are having this issue instead of explaining the whole thing from the begging. So if this post is not as condescending toward technological incompetence as usual it’s because I’m kinda targeting this at the lost and clueless. mrgreen

First things first, you will need to do this on the computer which is sharing the printers to the rest of the network. It’s usually going to be the computer to which the printer is attached, or the local File & Printer sharing server. If you do this on the wrong computer it won’t work.

Once you locate the machine that handles the printer sharing, you need to stop the print spooling service. Otherwise we won’t be able to clean out the hanging jobs. This is the service that accepts printing jobs, queues them up, and sends them to the printer. Note that once you stop this service no one on your network will be able to print to the printer in question. Of course since you have a stuck job in there, no one can print anyway so it should not be a big issue. Also note that you will loose all queued jobs if you do this. Here is how you do this:

Pull up your Run box (Windows Key+R) type in cmd and hit Enter. This will bring you to the MS DOS prompt. There type in the following:

net stop spooler

You should get a message saying the spooler stopped successfully. Now we need to clean out the spool folder. This is where windows keeps jobs that haven’t been printed yet.

Call up your Run box again (Windows Key+R) and type in the following:

%SYSTEMROOT%\system32\spool\PRINTERS

This should open a new explorer window. You are likely to see bunch of files in there - some of which may be classified as “Shockwave Objects” by windows. They are actually not Shockwave files but whatever. We don’t care because we will be deleting them. Just remove everything you can see that folder and then close the window. If you can’t delete some of the files, it means that you didn’t stop the spooler properly. Go back and try it again.

This deletes all the jobs on the queue, so you might need to re-send some of the documents that got stuck there waiting. Once the folder is empty go back to your DOS prompt and type in:

net start spooler

Your printer queue should be clean now. If it’s not, you probably did something wrong.

Please note that if you look in your Printers and Faxes folder before you issue the start spooler command you will find that all your printers are missing. Don’t panic - this is normal. They will come back once you start the spooler service.

Alternatively you can use the following batch script:

@echo off
net stop spooler
del /F %SYSTEMROOT%\system32\spool\PRINTERS\*.*
net start spooler

Copy the lines above, paste them into notepad and save it as a .bat or .cmd file. Then just double click to run it when your printer gets stuck.

Update 04/02/2007 08:51:47 PM

Updated the script as per suggestion from Daniel Montero (see the comments).

Posting Twitter Updates via Curl

Monday, March 19th, 2007

Here is how to post an update to twitter using just curl and nothing else. I guess you can use this if you are working on some headless unix machine that doesn’t have a proper browser… Of course a machine that has curl would also probably have lynx or elinks but I digress.

Here is how you update twitter with curl:

curl --basic --user username:password --data status="I'm twittering with curl!" http://twitter.com/statuses/update.xml

That’s it! That’s all you have to do. I was actually quite surprised when I found out it’s this easy. And yes, I can’t take any credit for discovering it - I shamelessly stole the idea from Stéphane Kattoor. If you read Stéphane’s post, you will see that the relative ease of posting regular updates, is balanced by totally super retarded mechanics of sending direct messages.

It turns out that curl is not the best way to send them - perl + lwp is.

Based on Stéphane’s notes I wrote a this bash script that lets you send updates. I suppress the xml output and you get the standard curl time counter when you post (let’s say this is a poor man’s progress bar ok?):

#!/bin/bash
read -p "What are you doing? " -e input
curl --basic --user username:password --data status="$input" http://twitter.com/statuses/update.xml > /dev/null
echo "OK"

I’m using the read function, but I could easily convert this to use Xdialog or another graphical input grabbing tool. It would also be worthwhile incorporating Stéphane’s perl script for direct messaging while I’m at it.

Heh… I could actually combine this with my time logging script and have it pop-up and nag me for input every n hours. P

Update 03/19/2007 08:19:21 PM

Here is the windows version of the script:

@echo off
SET /P input="What are you doing? "
curl --basic --user username:password --data status="%input%" http://twitter.com/statuses/update.xml > NUL
echo OK

You will have to download curl, and drop it somewhere in your %Path%.

Spybot’s TeaTimer Broken since June 2005

Monday, March 19th, 2007

If you ever used Spybot and it’s resident registry protection tool TeaTimer you know what I mean. If you didn’t let me illustrate it to you using a picture:

Broken Tea Timer
image stolen from forums.spybot.info

Do you see the problem here? And no, I don’t mean the Spanish interface. That’s because I have shamelessly stolen this image from the spybot forums. I meant the fucked up button positioning.

This problem existed since June 2005 or so. Spybot dev team blamed it on some bug in their Boardland development environment, but come on! How hard is it to fucking fix a button positioning problem in a release version? I understand how this might have slipped through on day one, but this bug has been pissing me off for over a year now. And it’s not that there is no easy solution for this. You can fix this bug yourself in 2 minutes using ResHacker.

If you are to lazy to read that forum post, here is the solution in a nutshell: kill TeaTimer, open the TeaTimer.exe in ResHacker (it’s in %PROGRAMFILES%\Spybot - Search & Destroy) and locate the following snippet of code:

object cbRemember: TCheckBox
Left = 8
Top = 160
Width = 339
Height = 17
Anchors = [akLeft, akTop, akRight]
Caption = ‘&Remember this decision.’
TabOrder = 2
end

The easiest way to do this is probably to search (Ctrl+F) for the word “decision” - it should be the first hit. Once you find it, just change the 160 (in bold) to 190, click Compile Script, then save it and you are all set.

Tell, me - if I can fix this issue in under 2 minutes by hacking a binary file, how hard would it be for them to do it when compiling the binaries? Hell, if it’s so hard, they could just hack the binary the same way I did, before packing it up in an installer.

Supposedly this issue has been fixed in their new beta release from December. Still, having this annoying bug in their stable release version makes me wonder what other bugs they left unfixed out of laziness? I used to be a big Spybot Supporter but after my users started complaining about broken dialogs, and the issue persisted for over a year without a fix I kinda lost my faith in their product.

Which brings me to my question: what is your favorite Anti-Spyware tool these days? Preferably I’m looking for free tools, but if you can recommend an exceptionally good proprietary software, I’ll bite too.

Absolut Hacker

Sunday, March 18th, 2007

I give Absolut vodka marketing department major props for making this:

Absolut Hacker Ad

Seriously, I’m amazed they actually took the effort to make this like a unix prompt, and using actual unix commands (like cd, ls and sudo and mimicking their output) when it could have been done with some stupid made up holywood style “hacking” output instead.