Category Archives: Troubleshooting

Troubleshooting including spyware issues

Weblog Super Cache Issue

On this site I run weblog with automatic updates enabled. I noticed, about a week or so ago, that I saw the following at the top of all of my pages:

define( ‘WPCACHEHOME’, ‘/home/bsdman/it.thelibrarie.com/weblog/wp-content/plugins/wp-super-cache/’ ); //Added by WP-Cache Manager

Well that’s less than fun, but I don’t really care enough to fix it. Unless that’s also screwing with the CSS and making it difficult to see the entire article under the theme I use… The scroll bar was present, but the bottom of the page cut off a lot of the instructions. Awesome.

Lots of searching and I find out that member “stealingsand” is very helpful. http://wordpress.org/support/topic/warning-wp-super-cache-caching-broken-the-script-advanced-cachephp-could-not

I performed the following:
SSH into your box
nano /weblog/wp-config.php

define( ‘WPCACHEHOME’, ‘/home/bsdman/it.thelibrarie.com/weblog/wp-content/plugins/wp-super-cache/’ ); //Added by WP-Cache Manager

This was listed at the top instead of after the ?php section. I just moved it down with the other defines, saved, and exited. Fixed!

Chrome Resolving Host Slow Loading

Running Windows 7 Ent x64 fully patched. I noticed that chrome would take a while to open pages – even pages that I had already visited during the day – and I figured there was a problem with my system.

Windows updates had recently patched the system
McCrappy had been removed in favor of Kaspersky
Chrome had been updated to the latest version
Java/Flash/etc were already all up to date

Long story short, I disabled the Built-in Asynchronous DNS functionality of Chrome and noticed a substantial speed difference (gain).

Open a chrome window
navigate to chrome://flags
Find Built-in Asynchronous DNS (about halfway down the page)
Change to disable, and then restart the browser

Proxmox Ubuntu Debian Force Reboot

I had a cluster of proxmox servers (debian) that refused to reboot. I had just run some updates as part of the monthly maintenance schedule and issued the “reboot” command. I have molly-guard installed, so I had to type the name of the server as well, but they were just sitting there.

Checked the /var/log/messages for any ideas – system preparing for reboot.

The server continued to function as it had before the reboot command – I could use apache, ssh, webmin, etc all fine. As the servers are located at a not-close datacenter AND I have KVM control from any VPN connection, I decided to try to find a way to force it down. Unfortunately our DC does not allow us to control the smart PDUs installed in each rack as they retain the right to remotely monitor our power consumption.

After a short search on my favorite g search engine site, I come across this:
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger

As soon as you hit enter on the second command the server will drop and start to reboot.

Error in SQL syntax

Man, I’m not very good at this PHP stuff in terms of starting from scratch. I can decipher what is going on, but my troubleshooting skills for editing my own work… suck.

I put up a survey site with very simple post of data into a mysql database from a PHP front-end. My boss tried it out and put an apostrophe in his comments section, which threw up the standard:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'm working hard')' at line 37

Ut oh. Showing SQL errors can lead to problems – injections, giving away data, etc. Since this was an internal-only site, it didn’t really matter quite as much, but I’d still like to allow people to utilize the apostrophe.

Add this into the inserting php page:

 foreach ($_POST as $key => $value) {
    $_POST[$key] = mysql_real_escape_string($value);
  }

It is right after my “mysql_select_db(“dbname”, $con); statement.

Drag and Drop Stops Working

I used to have this issue on my Vista 64-bit system: I’d go to drag a file from the desktop to another location either on the desktop or in a nested folder on the computer. In any case, I could not drag the icons. It seemed as though as soon as I’d try to drag it the selection would disappear.
A simple reboot would fix that right up.
I’m not a big fan of rebooting my systems – I try to leave them up and running as long as possible without being a security risk (so roughly a month at a time – although my test slackware server would stay up for a year at a time). I also hate it when software installs and then says “reboot to finish”. I almost always ignore the requests.

So rebooting a system whenever I can no longer drag and drop items on my system is a definite no-no. Anyway, I never really looked further into it as I went back to using XP after trying vista out for a while. I chalked it up to a “vista issue”. Don’t we all?

Fast forward to last week: A coworker of mine complained that he could no longer drag and drop on his Windows 7 x64 system. I told him that he should reboot and it’ll work after that. He rebooted. It worked.

But then today it happened to me. Argh. I closed out of all my terminal sessions to see if that would fix it. Nope. I closed out of all my java-based applets/applications. Nope. I closed all my command windows and MMC windows. Nope. I closed all of my chatting programs (MSN/Pidgin/Skype) and all my remote help programs (gotomeeting/tightvnc/glance/logmein). Nope. I closed all my Microsoft programs (Outlook, Internet Explorer, Excel, Word) and my Mozilla programs (firefox, thunderbird). Nope. Argh, wtf? I even closed my putty sessions and my foobar2000 music player. Notta.

Then I looked in the services.msc and started randomly restarting all available services. Nothing. This was starting to take more time than actually rebooting the machine after installing windows updates.

After a bit of searching, I find a “fix” for XP machines:
regsvr32 ole32.dll
regsvr32 /i shell32.dll

As this is a Windows 7 64bit machine, I have my doubts. But I try them anyway. Nothing.

Then I find this site (http://astahost.com/info.php/problem-drag-drop_t14544.html) which tells me to press and release (hit) the escape key. Damn, all that wasted time.

SO, if you want to know how to fix it:
Press ESC

That is all.

***EDIT***
I also had some other issues that were not solved by the ESC solution above. After pressing both CTRL buttons several times, both Windows Key buttons several times, and both ALT keys several times the problem went away again. Stuck keyboards FTW!

Ubuntu Repositories Download Speed

I recently upgraded my working Ubuntu 7.10 to Ubuntu 8.04. I hadn’t used the computer in about a month, so there were quite a few updates to do. Namely 83 updates.

sudo apt-get update
sudo apt-get upgrade

It was flying at anywhere from 300KB/sec to 950KB/sec on most of the packages, but then would falter down to 4000bytes/sec (and sometimes even less). I figured it was the Repositories getting nailed, or my network connection becoming unruly.

But, after searching for a while, I found the answer: the us.archive.ubuntu servers are SLOW. Doesn’t matter that the servers reside in the same country I’m located.

Edit the /etc/apt/sources.list file to remove the “us.”

cd /etc/apt
cp /sources.list sources.list.old
nano sources.list

Anywhere it says “us.archive.ubuntu” remove the us., then it should say “http://archive.ubuntu” etc.

Virus EXE Rundll32 Issue

I love it when people bring in their virus-laden machines for me to look at. They always come up with some silly excuse for why it’s not working or how it’s broken: “I let [insert name of child here] play on it the other day and now it’s running slow” or “I haven’t been able to use email for the last few months but thought nothing of it until the computer started deleting my files and randomly rebooting”. GOLD!

I’m usually pretty good at getting rid of a virus if it’s in the early stages. Adware, malware, popups, backdoor trojans, they’re all pretty easy to dispose of. Some of the hijack programs that take over the homepage for IE are pretty tough though.

The steps I go through are usually the same:
1.) MSconfig and remove all non-microsoft programs
2.) Install nod32 and kick the crap out of whatever was installed

Although a lot of times I’m not able to run any commands. Recently I couldn’t open any EXE files on a system. It kept looking for rundll32.exe and not finding it (windows\system32\rundll32.exe). So then msconfig, add remove programs (control appwiz.cpl), and even the system information (windows key + pause/break) didn’t work. I couldn’t even open cmd.exe without problems – lucky for me it was an associated filetype for exe files.

So then, with the command line open:
1.) Download The EXE Registry Fix and import it into your registry
2.) SFC /scannow (this requires either the i386 folder or the windows installation media to check and see if all the required microsoft files are in place)
3.) MRT (microsoft’s malicious removal tool)
4.) msconfig and uncheck any non-microsoft related items

Someone also told me that the exe file associated could have broken this computer. I didn’t try it since I only imported the registry key and it worked. But here’s the steps to do that too:

1.) CMD
2.) assoc.exe=exefile