Nov 21

Setting up Putty and SSH server

1) generate key using puttygen
2) save public and private keys to someplace safe
3) ssh to server
4) edit ~/.ssh/authorized_keys2 (chmod ga-w authorized_keys2)
5) enter data from public key.
6) load putty
7) load desired session
8) Under ssh, select SSH2, and save session.
9) right click on pagent and add the private key
10) login, and enter username.
11) Edit startup script for pagent startup
“C:\Program Files\PuTTY\pageant.exe” d:\data\z_ssh\ssh_private_key.ppk

Oct 28

Running Windows 7 Enterprise I continually see this message while trying to either move or delete a directory. No applications are open that should be locking the directory. Through random chance I found that emptying the recycle bin when this occurs would often resolve the issue. I think I’ve traced the issue back to windows thumbnail caching. Turning this off seems to have resolved the issue. The easiest way to do this is as follows:

  1. Start – enter gpedit.msc in the search window
  2. Select
    • User Configuration
    • Windows Components
    • Windows Explorer
    • Turn off caching of thumbnails in hidden thumbs.db files
  3. Select enabled and okay
  4. Next either reboot or
  5. Launch a shell and run ‘gpupdate /force’

So far this seems to have resolved the issue. I’d much prefer a more elegant solution, but sometimes a rock is all you have. Hope that saves somebody some frustration.

Mar 27

Some people like the windows tool for compressing folders. Really. They seem to prefer this to a real compression software like 7 Zip. Not sure why.

When a third party compression software is installed the windows “compressed folder” tool is deactivated. To put it back, do the following:

Start->Run->regsvr32 zipfldr.dll->OK
Start->Run->cmd /c assoc .zip=CompressedFolder->OK
Reboot

Mar 27

A failure in updating could happen when you suddenly get disconnected or downloaded corrupted data which happens a lot. And it seems that there is no local check to ensure that the file is actually complete. It just attempts to install the downloaded material even if its not complete. The stupid thing is that even though you try to update again, it just checks the cache, see that its there and won’t bother redownloading the files.

Therefore when you face such a scenario, you could take these steps to solve your problems:

  1. Open Command Prompt by Start -> Run and type cmd
  2. On the Command Prompt, type net stop wuauserv. This is done so that you will terminate the windows automatic update service to allow us to delete the cache files
  3. Still on the Command Prompt, type cd /d %windir%
  4. Type rd /s SoftwareDistribution
  5. Thats it, the cache has been purged. Now we need to restart the windows automatic update service again. To do that, type net start wuauserv
Mar 17

I recently had the need to be able to see what applications were consuming the most amount of memory on a remote windows system. I only needed to do this on demand, and it was not something that I needed to do all the time. To get the view I wanted I resorted to using a combination of pslist from the PStools package and the *nix like environment for Windows Cygwin. Below is the shell script i came up with. I’m sure somebody could make it cleaner, but this is what I found that worked. I post this here for my own reference and as a gift to the world (I know, it’s the thought the counts).


#!/bin/bash

# Printf description :
# %-16s 16 character text field, left justified.
# \t Tab
# %8.0f 8 character, numberic field, no decimal
# %2S 2 Character text field, right justified.
# ,$1,$4,"KB" First field from awk, Fourth Field from Awk, Text "KB"
# $4 is the amount of memory used by the application or its "working set"

echo ""
echo "Top 5 memory usage on egi6w008"
echo""
/cygdrive/d/workdir/bin/pslist -m \\\\hostname| awk '{printf("%-16s\t %8.0f %2s\n",$1,$4,"KB")}'| sort -k 2,2n | tail -n5
echo ""
/cygdrive/d/workdir/bin/pslist -m \\\\hostname | awk '{tot=tot+$4} END {printf("%14s %8.0f %2s\n","Total Memory: ",tot,"KB")}'

May 17

UPDATE: I would strongly recommend reading the following link prior to mucking about int he windows 7 registry. The changes required vary with different versions of Samba. You have been warned!

http://wiki.samba.org/index.php/Windows7

I had a client request a Windows 7 RC1 system so that they could test their product against the latest candidate from Redmond. Their network is made up of a mix of Windows clients on Linux/Samba servers. Setting up the new client was fairly easy, but, as expected, Windows 7 refused to join to a the Samba domain stating that the domain in question was not available. Having gone through something similar when we finally added Vista clients I expected to have to update Samba to get this to work. Turns out you have to add two reg keys as well. Since it took me a fair bit of search to find this, I thought I’d document the required changes here, if for no other reason to save myself the trouble when I went to do it again…

  1. First you need to be running Samba v3.3.4 or later. Earlier versions have been reported to work, but there are some issues. Since this version is not available in the OS repos (CentOS) I got my copy from the Samba Enterprise site. They carry packages in RHEL, SLES, and Debian flavors and I have been using them for some time.
  2. Next the Windows 7 client needs to have two registry keys added.

    HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters
    DWORD DomainCompatibilityMode = 1
    DWORD DNSNameResolutionRequired = 0
  3. The following key needs to be changed or you will receive an error when trying to login using a domain accout of “The trust relationship between this workstation and the primary domain failed.”

    HKLM\SYSTEM\CurrentControlSet\services\Netlogon\Parameters
    RequireStrongKey = 0

Once these changes were made I was able to join the domain. I did receive an error on the join as shown in the following image, but the system seems to be working fine.

domainjoinerror

I’m assuming this will be resolved in future releases. Hope this helps save somebody at least a few minutes…

Read the rest of this entry »

Feb 15

So I recently had to deploy a Vista machine to a customer’s network. Till now we had only had one vista box stuck in corner for testing. Now is has been decided that we need a couple of Vista boxes on peoples desktops. The logic goes that we won’t find as many problems if people aren’t using it on a regular basis. (I really feel for the guy that got suck with the Vista box. I mean the box is nice, but Vista just sucks. Eggs. Really old eggs.)

So the initial setup of the box was normal for Vista. I spent most of my time trying to figure out where they hide or renamed options… Typical, right? So the box gets deployed and I migrate the user’s data to the system. Then I got to setup backup for his email. We typically just using Windows backup to backup email and a a few other files. Everything else is stored in on the server. So I got to start the backup process and I get this:


Windows Backup
File Backup could not save your automatic backup settings for thefollowing reason:
Cannot create a file when that file already exists. (0x800700B7)
Please try again

Or something similar. A quick swipe at google and I see that it’s a Samba/Vista issue. Something changed in SMB2 and the only thing that seems affected is Vista Backup. Figures. So I schedule server downtime for the weekend to update Samba as according to the Samba Bugzilla site, this is fixed in a slightly later release.

Sunday afternoon comes along and here I am. I install the update, restart Samba and…. Frack. Error. Fast forward 3 hours. After I start reading comments on the Bugzilla site in desperation I find that the issue is related to ACLs that Vista backup is trying to set on the directory. Wait, does ext3 support ACLs? /me quick google…. Ah, you have to pass the file system an option to enable ACL support. So, long story short… If you want Vista backup to work, you have to 3.0.25+ of Samba, and you have to have ACL support enabled on your file system. The magic incantation is simply spec’ing ‘acl’ in the mount command, like this:


LABEL=/work /work ext3 acl 1 2

I hope this saves at least one person the hours I’ve just wasted.

For reference:
https://bugzilla.samba.org/show_bug.cgi?id=4308
https://bugzilla.samba.org/show_bug.cgi?id=5306
https://bugzilla.samba.org/show_bug.cgi?id=5306
http://social.answers.microsoft.com/Forums/en-US/vistaprograms/thread/d91d7785-9a00-4b26-9ae3-ae35b0d9317b/
http://www.samba.org/samba/history/samba-3.0.25.html

Nov 20

Every once in a while I find myself dealing with removing malware from a windows machine (I *know* can you believe it?!?). Just stumbled across Lunarsofts Anti-Malware Toolkit. Need to remember it for the next time. It basically pulls all of the tools you need in a single shot. Should be a big time saver….

http://www.lunarsoft.net/news/lunarsoft

Dec 21

Recently ran into an issue when MS Outlook refused to open any .msg attachments. You’d click them and nothing. No error, no message, nothing. If you save the file to the Desktop and tried to open it, all that would happen would be that outlook would flash. Turns out it is a bug in Google Desktop [1]. If the Google desktop plug in was active in Outlook, it would fail to open the attachment. Disabling the plug in resolved the issue as did updating Google Desktop to the the latest rev. See the following link for more details.

[1] http://desktop.google.com/support/bin/answer.py?answer=58591

Aug 30

I hate Word. I really do. This should be much easier and better documented, so here it is.

  1. Open Office.
  2. Start a new document and save it as a template.
  3. Select Tools – Templates and Add-ins – Organizer
  4. Select the Autotext entry
  5. copy the autotext entries from the global template to your new template
  6. Do the same for the toolbars tab
  7. Close the Organizer
  8. Save the template and exit Word
  9. Copy the template to C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Templates
  10. Rename the existing Normal.dot
    to something else (old_normal.dot)
  11. Rename the new file to normal.dot
  12. Bob’s your Uncle.

« Previous Entries