MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
September
Sun Mon Tue Wed Thu Fri Sat
       
 
2011
Months
Sep


Sun, Sep 25, 2011 9:25 pm

List Installed Programs

I needed to produce a list of programs installed on a Microsoft Windows system to send to someone else so she could check it for no longer needed programs and tell me which ones are no longer needed, so I could remove them to free disk space. Bill James has a VBScript script, InstalledPrograms.vbs, which can be run from a command line, which prompts for the name of the system to check via a popup window, as shown below:

InstalledPrograms name or IP prompt

After that prompt, you are asked whether you wish to view the results produced by the program as shown below.

InstalledPrograms save results prompt

The list of installed programs is stored in a file that has the name of the system on which it is run followed by an underline, then the date in mmddyyyy (month-date-year) format, then another underscore followed by the time in military time, i.e. 24-hour clock time, another underscore and then "Software.txt". E.g. CRYSTAL_09252011_175147_Software.txt for a file produced when the program was run on a system named Crystal on September 25, 2011 at 5:51:47 PM. The file is stored in the directory in which the script is run.

If you click on "yes" to view the results, the file produced by the program will be opened in the default .txt file viewer, which, on Microsoft Windows systems, will likely be Notepad.

An example output file can be seen here. The list is similar to the list of installed programs that you would see by checking with "Add or Remove Programs" under the Control Panel. It is obtained by querying the registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\.

Download InstalledPrograms

References:

  1. VBScript Tools by Bill James
    BillsWay.com
  2. VBScript
    Wikipedia, the free encyclopedia

[/languages/vbs] permanent link

Wed, Sep 21, 2011 10:40 pm

F-Secure 3.11 Rescue CD Scan of Compaq SR1900NX Windows XP PC

If I need to scan someone's Microsoft Windows system for malware, I usually make a backup of the system outside of Windows, e.g., by booting the system with a Norton Ghost 2003 boot CD and backing up the system to an external USB drive. I then usually perform an initial scan of the system using a rescue CD, such as the F-Secure Rescue CD 3.11. Using a rescue CD can be especially helpful if a system won't boot into Windows or runs abysmally slow because of a malware infection.

In this instance I used the F-Secure Rescue CD 3.11 on a Compaq Presario SR1900NX system running WIndows XP to perform an initial malware scan of the system.

[ More Info ]

[/security/antivirus/f-secure] permanent link

Mon, Sep 19, 2011 7:41 am

International Talk Like a Pirate Day

Ahoy, matey, don't forget today is International Talk Like a Pirate Day.

Who was the most successful pirate that ever lived? Not Edward Teach, aka Blackbeard, nor Captain Kidd nor Calico Jack, nor perhaps any other male pirate. That honor could arguably be given to Ching Shih, also known as Cheng I Sao, a female pirate. Whereas Blackbeard was decapitated after losing a battle with anti-pirate forces led by Robert Maynard and Captain Kidd and Calico Jack, who gave us the emblematic Jolly Roger pirate flag, were hanged, Ching Shih died in comfort of natural causes after a very successful career as a pirate.

In her heyday as a pirate, Ching Shih's Red Flag fleet numbered more than 1,500 ships and she controlled upwards of 80,000 sailors. She was able to repel numerous attack by the Chinese navy as well as the many Portuguese and British bounty hunters brought in to help capture her. Finally, in 1810, the Chinese government tried a different tactic and offerred her amnesty if she would give up the life of a pirate. She accepted and opened a gambling house. She died of natural causes in 1844 at the age of 69, a successful businesswoman and grandmother.

References:

  1. Ching Shih
    Wikipedia, the free encyclopedia
  2. Most successful pirate was beautiful and tough
    Date: August 27, 2007
    Features Articles from CNN
  3. Blackbeard
    Wikipedia, the free encyclopedia
  4. Robert Maynard
    Wikipedia, the free encyclopedia
  5. William Kidd
    Wikipedia, the free encyclopedia
  6. Calico Jack
    Wikipedia, the free encyclopedia
  7. Jolly Roger
    Wikipedia, the free encyclopedia

[/news] permanent link

Sun, Sep 18, 2011 6:15 pm

Extracting the Contents of a .bz2 File

To extract the contents of a .bz2 file on a Linux or Unix system, such as Solaris, you can use the bunzip2 command.

bunzip2 file.bz2

The .bz2 file will be deleted when its contents are extracted. If you wish to keep the original .bz2 file, you can use the -k or --keep options.


     -k --keep
          Keep (don't delete) input files during  compression  or
          decompression.

References:

  1. File Extension .BZ2 Details
    FilExt
  2. Extract a bz2 or bzip2 file
    By: qmchenry
    Date: July 11, 2006
    Tech-Recipes
  3. Running Linux
    By: Matt Welsh
    Third Edition, Chapter 7, Archive and Compression Utilities, pages 184-187

[/os/unix/programs/utilities] permanent link

Mon, Sep 12, 2011 9:25 pm

VM Preventing Disc From Ejecting

On a MacBook Pro laptop with the OS X operating system, I inserted a blank CD in the drive. When I opened Disk Utility, which is in the Applications/Utilities folder, it reported "This disc drive is busy. Please choose another one." The Eject option in Disk Utility was grayed out. I tried ejecting it with the drutil utility from a shell prompt, which you can get by using the Finder and selecting Terminal in the Applications/Utilities folder, but that didn't work, either.
$ drutil eject

I was able to eject the CD by hitting the eject button at the top right side of the keyboard (it is the one with an upward pointing triangle with a horizontal line beneath it) on the MacBook Pro laptop. But when I inserted that CD or another CD, I had the same issue. I finally realized I had a Windows XP VMWare Virtual Machine (VM) running, which had control of the CD-ROM drive. I no longer had the issue after I shut down the VM. I was able to use the drutil eject command to eject the disc then and the eject function within Disk Utility then worked as well.

References:

  1. Another route to eject stubborn stuck CDs
    Date: June 1, 2004
    Mac OS X Hints

[/os/os-x] permanent link

Sun, Sep 11, 2011 11:16 pm

Album Thumbnail Generator

I needed to generate thumbnail images for some photos my wife took that I placed on the website, so I could send a webpage link to someone else so she could view the pages rather than me sending all of the images to her by email. I also needed a program to not only create the thumbnail images, but to create a webpage indexing all of the thumbnails and providing links from the thumbnails to the full-size images.

I was in a hurry and didn't want to spend a lot of time setting up software to do that nor spend a lot of time doing it manually. I thought I had installed an easy-to-use program on the system several years ago to do just that for a friend who wanted to post pictures of storm damage to his house, but I couldn't remember the name of the program nor how to access it. After looking on the system for his photos, I saw that I had used a Perl program, Album by David Ljung Madison. He also offers a number of other free scripts at his MarginalHacks website. There's an example of the output from his photo album generator script at DavePics.

Once I realized where the album Perl script was placed on my system, I was able to generate the thumbnails and associated HTML pages by just running the script while my working directory was the one in which the photos were located. E.g. /path_to_script/album. An index.html page was generated by the script containing all of the thumbnails, which are placed in a tn directory beneath the one containing the images. Clicking on a thumbnail then brought up a webpage containing the full-size image and navigation links to the additional images.

I thought I should make a note to my self here, so that if I forget the name of the program again, I have this blog entry to remind me of its name and how to use it to generate image thumbnails and webpages for the images.

[/languages/perl] permanent link

Sun, Sep 11, 2011 10:00 pm

Xubuntu

I sometimes use a Ubuntu Linux live CD for troubleshooting issues with Microsoft Windows systems, since a live CD allows me to boot the system from a CD without loading the Microsoft Windows operating system on the hard drive. Or when I'm working at a site without my own laptop, a live CD allows me to boot a system at the site without fear that a system may be potentially infected with malware that might perform keystroke logging or might otherwise be monitored by someone remotely unbeknownst to the system's owner.

I created a Ubuntu 11.04 Desktop edition live CD for booting a system so that I could check on files on the system which had Microsoft Windows XP Home edition on the hard drive. The system's owner reported she was having problems with the system and I wanted to start with a quick look at some of the files on the system and make a backup of her "My Documents" folder. I needed to open Firefox on the system to check on some information online, but whenever I opened a second tab in Firefox to Amazon.com, Firefox would crash. It also crashed with only one tab open when I used Ctrl-Alt-F2 to obtain a shell prompt with an error message indicating that there was a problem with inadequate memory.

The system had a 3.2 GHz processor, but only 512 MB of memory and the system requirements for Ubuntu Desktop Edition 11.04 (Natty Narwhal) listed on the Ubuntu site were as follows:

Since the system just met the minimum memory requirement for Ubuntu 11.04, I decided to try Xubuntu (pronounced "zoo-BOON-too"), instead. Xubuntu is a derivative of Ubuntu, which uses the Xfce desktop environment, which requires less memory than the Unity desktop used by Ubuntu.

Xubuntu is a community developed, Ubuntu-based Linux operating system that is well-suited for both laptops and desktops. It contains all the applications you need - a web browser, document and spreadsheet editing software, instant messaging and much more.

Minimum system requirements

You need 256 MB RAM to run the Live CD or 256 MB RAM to install. The Alternate Install CD only requires you to have 64 MB RAM at install time.

To install Xubuntu with the standard installer (Ubiquity), you need 4.4 GB of free space on your hard disk. The Alternate Install CD only requires you to have 2 GB of free space on your hard disk.

Once installed, Xubuntu can run with starting from 256 (or even just 192) MB RAM, but it is strongly recommended to have at least 512 MB RAM.

I downloaded Xubuntu 11.04 (Natty Narwhal). I burned it to a CD and rebooted the system with it. I found that I didn't have any problems when I opened multiple tabs in Firefox under Xubuntu.

References:

  1. Homepage | Ubuntu
  2. Ubuntu
    Wikipedia, the free encyclopedia
  3. Xubuntu Home Page | Xubuntu
  4. Xubuntu
    Wikipedia, the free encyclopedia
  5. DistroWatch.com: Xubuntu
    DistroWatch.com: Put the fun back into computing. Use Linux, BSD.
  6. Unity (user interface)
    Wikipedia, the free encyclopedia

[/os/unix/linux/xubuntu] permanent link

Sat, Sep 10, 2011 4:19 pm

Submitting a form with POST using cURL

I needed to submit a form on a webpage using cURL. The form submission was using POST rather than GET. You can tell which method is being used by examining the source code for a page containing a form. If POST is being used, you will see it listed as the form method in the form tag as shown in the example below. A form that uses GET, instead, would have "get" as the form method.

<form method=post action=https://example.com/cgi-bin/SortDetail.pl>

You can use the -d or --data option with cURL to use POST for a form submission.


-d/--data <data>
              (HTTP) Sends the specified data in a POST request  to  the  HTTP
              server,  in  the  same  way  that a browser does when a user has
              filled in an HTML form and presses the submit button. This  will
              cause curl to pass the data to the server using the content-type
              application/x-www-form-urlencoded.  Compare to -F/--form.

              -d/--data is the same  as  --data-ascii.  To  post  data  purely
              binary, you should instead use the --data-binary option. To URL-
              encode the value of a form field you may use --data-urlencode.

              If any of these options is used more than once on the same  com-
              mand  line,  the  data  pieces specified will be merged together
              with a separating  &-symbol.  Thus,  using  '-d  name=daniel  -d
              skill=lousy'  would  generate  a  post  chunk  that  looks  like
              'name=daniel&skill=lousy'.

              If you start the data with the letter @, the rest  should  be  a
              file  name  to read the data from, or - if you want curl to read
              the data from stdin.  The contents of the file must  already  be
              URL-encoded.  Multiple files can also be specified. Posting data
              from a file named 'foobar' would thus be done with --data  @foo-
              bar.

To submit the form using cURL, I used the following:

$ curl -u jsmith:SomePassword -d "Num=&Table=All&FY=&IP=&Project=&Service=&portNo=&result=request&display_number=Find+Requests" -o all.html https://example.com/cgi-bin/SortDetail.pl

In this case the website was password protected, so I had to use the -u option to submit a userid and password in the form -u userid:password. If you omit the :password and just use -u userid, then cURL will prompt you for the password. So, if you want to store the cURL command in a script, such as a Bash script, but don't want to store the password in the script, you can simply omit the :password.

The -d option provides the parameters required by the form and the values for those parameters, which were as follows in this case:

ParameterValue
Num 
TableAll
FY 
IP 
Project 
Service 
portNo 
resultrequest
display_numberFind+Requests

The format for submitting values for parameters is parameter=value. Parameters are separated by an ampersand, &.

URLs can only be sent over the Internet using the ASCII character-set. Special non ASCII characters, which include the space character must be represented with a % followed by two hexadecimal digits. The space character can be represented by + or by %20. So, though the value for "display_number" is "Find Requests", it needs to be sent as Find+Requests or Find%20 requests. You can see a list of other characters that should be encoded at URL Encoding.

In this case, I didn't need to specify values for many parameters in the form, because I wanted the query to cover all potential values for those parameters. So I can just use parameter= and then follow that with an & to specify I am submitting the next parameter in the list.

References:

  1. cURL - Tutorial
    cURL and libcurl
  2. curl Examples
    Linux Journal | Linux Tips
  3. POST (HTTP)
    Wikipedia, the free encyclopedia
  4. The POST Method
    James Marshall's Home Page
  5. How to submit a form using PHP
    HTML Form Guide - All about web forms!
  6. HTML URL Encoding
    W3Schools Online Web Tutorials
  7. URL Encoding
    Bloo's Home Page

[/network/web/tools/curl] permanent link

Fri, Sep 09, 2011 10:36 pm

Read It Later Firefox Addon

If you would like to be able to save webpages you come across for later reading, if you are using Firefox, you can use the Read It Later Add-on for Firefox.

[ More Info ]

[/network/web/browser/firefox/addons] permanent link

Fri, Sep 09, 2011 10:26 pm

HttpFox Firefox Addon

If you need to observe the data flowing between a website and your browser when you visit a website, if you are using Firefox, you can use the HttpFox Add-on for Firefox.

[ More Info ]

[/network/web/browser/firefox/addons] permanent link

Thu, Sep 08, 2011 9:33 pm

Bash Calculator

If you need to do quick calculations on a system that provides the Bash shell, such as Linux or Mac OS X, you can perform calculations by using the echo command and then using $[ and ] to enclose the arithmetic calculation, i.e., echo $[calculation to be performed]. You can use the standard arithmetic operators of + for addition, - for subtraction, * for multiplication, / for division, and ** for exponentiation.
$ echo $[1+1]
2
$ echo $[9*90]
810
$ echo $[81/9]
9
$ echo $[2**3]
8

The standard precedence for operators applies, i.e., multiplication and division have precedence over addition and subtraction, so are performed first, i.e., the calcuations are not simply done on a left to right basis.

$ echo $[2+3*4]
14
$ echo $[6-4/2]
4

This Bash calculator functionality even handles negative numbers appropriately.

$ echo $[-4*5]
-20
$ echo $[-4*-5]
20

References:

  1. When you need a quick & simple calculator in Bash...
    TinyApps.Org, small is beautiful
  2. Bash (Unix shell)
    Wikipedia, the free encyclopedia

[/os/unix/bash] permanent link

Thu, Sep 08, 2011 9:25 pm

Retrieving Password Protected Webpages Using HTTPS With Curl

Mac OS X systems come with the curl command line tool which provides the capability to retrieve web pages from a shell prompt. To use the tool, using Finder on the system, you can go to Applications, Utilities and double-click on Terminal to obtain a shell prompt.

Curl is also available for a variety of other operating systems, including DOS, Linux, and Windows. Versions for other operating systems can be obtained from cURL - Download. If you will be retrieving encrypted webpages using the HTTPs protocol, be sure to get the binary version that includes Secure Sockets Layer (SSL) support.

A program with similar functionality is Wget, but that isn't included by default with the current versions of the Mac OS X operating system.

On Mac OS X systems, curl is available in /usr/bin and help on the options for curl can be found using man curl, curl -h , curl --help, and curl --manual. An online manual can be viewed at cURL - Manual.

To retrieve a webpage that requires a userid and password for access with curl using the HTTPS protocol, you can use a command similar to the one below where userid and password represent the userid and password required to access that particular webpage.

curl -u userid:password https://example.com/somepage.html

If you don't want to include the password on the command line, you can just specify the userid after the -u; curl will then prompt you for the password.

$ curl -u jsmith https://example.com/somepage.html
Enter host password for user 'jsmith':

If you wish to save the output in a file rather than have it go to stdout, i.e., rather than have it appear on the screen, you can use the -o/--output filename option where filename is the name you wish to use for the output file. Curl will provide information on the number of bytes downloaded and the time that it took to download a webpage.

$ curl -u jsmith:somepassword -o somepage.html https://example.com/somepage.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22924    0 22924    0     0  16308      0 --:--:--  0:00:01 --:--:-- 26379

References:

  1. cURL and libcurl

[/network/web/tools/curl] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo