tb500

GGTSdotNET

The notes of a madman

Wiping disks using DD

Posted by grigsby on November 29, 2012

Quick note to self.

To do a quick disk wipe:

dd if=/dev/zero of=/dev/sdl bs=8M

This could be performed multiple times using a for loop. For a more secure wipe, use /dev/random, but this takes FOREVER. For a even more secure wipe, us a 1/2″ drill bit.

To keep tabs on how the DD operation is progressing, us this:

watch -n 60 killall -USR1 dd

Posted by grigsby on September 25, 2012

After a recent nuke and pave on my Ubuntu 12.04 to attempt to deal with random Unity crashes I was met with a challange. I had kept all of my sources.list.d/* ppa entries but after attempting an apt-get update all I got was errors. Lots of errors just like this one:


W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXXXXXXXXXXXX

I had written a script a while ago to find all of the missing keys, download them, and install them, but I lost it in the upgrade. Instead of reinventing the wheel, again, I started searching and I find that somebody else had created a simlar script, but was smarter than I was as they actually published it.

So….


sudo apt-add-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install launchpad-getkeys

Once the installation is complete, run this:

sudo launchpad-getkeys

And no more missing keys. A big thanks to Alin Andrei for having the forethought to publish his work when I didn’t…

Passwordless Putty

Posted by grigsby on November 21, 2011

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 FilesPuTTYpageant.exe” d:dataz_sshssh_private_key.ppk

the action can’t be completed because the folder or a file in it is open in another program

Posted by grigsby on October 28, 2010

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.

Thunderbird no longer opens links

Posted by grigsby on April 17, 2010

I recently upgraded my Ubuntu Karmic (9.10) install to use Thunderbird 3.X and Firefox 3.6.X. Somewhere in my mucking about I broke the open link in browser option. Here’s how to fix it:

Brute force method:

1) Close TB.
2) mv ~/.*thunderbird/*default*/mimeTypes.rdf ~/.*thunderbird/*default*/mimeTypes.rdf.old
3) Launch TB and click a link. TB should now ask how you want to handle http links.
4) Enter the path to FF (or the browser of your choice). Typically /usr/bin/firefox is a link to the current browser.
5) You're done.

More elegant (weapon for a more elegant time…) method:

1) Edit - Preferences - Attachments
2) http -> Use Other -> /usr/bin/firefox
3) repeate for https.

Windows “compressed folder” RMB pick

Posted by grigsby on March 27, 2010

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

Windows Update keeps trying to install the same update

Posted by grigsby on March 27, 2010

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

Listing top 5 memory consuming apps on a remote windows machine

Posted by grigsby on March 17, 2010

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("%-16st %8.0f %2sn",$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 %2sn","Total Memory: ",tot,"KB")}'

Cursor (arrow) Keys not working in Ubuntu Terminal Server Client

Posted by grigsby on March 13, 2010

Running Ubuntu 9.04, 32bit, I noticed that the cursor (arrow) keys were not functioning on Terminal Server Client which I use constantly to connect to XP machines for work. I use the Terminal Server Client Applet to easily access the machines I’m working on and it had worked in the past. I found, after some digging, that the keyboard setting had gotten changed for all of the saved machines from en-us to us. So, the fix is as follows:

  1. Open the Terminal Server Client
  2. Enter the machine details
  3. Select the Local Resources tab
  4. set the keyboard to en-us
  5. Save the session to the Quick Connect Profile

The cursor (arrow) keys not work as expected.

Stopping kdm (or gdm) from running at startup

Posted by grigsby on October 11, 2009

Situation: I have a system that spends most of it’s time running as a server but occasionally I need a GUI so KDE is installed. 95% of the time I don’t want KDE or even KDM eating resources. When I want it, it’s easy enough to launch from a command line on demand. How do I remove it from the start up. Easy way is to start deleting files from the rc.* directories. The approved way appears to be the following:

sudo update-rc.d -f kdm remove

To add it back:
sudo update-rc.d kdm defaults