MoonPoint Support Logo

 


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



Advanced Search
December
Sun Mon Tue Wed Thu Fri Sat
   
   
2015
Months
Dec


Thu, Dec 31, 2015 5:53 pm

Determining the day of the week for a specific date under Linux

If you want to determine the day of the week for a specific date on a Lunux system, you can provide that date as a parameter to the date command with --date.
  -d, --date=STRING
              display time described by STRING, not 'now'

E.g., to determine the day of the week for August 10, 2008, you could use the following command at a Bash prompt:

$ date --date=2008-08-10
Sun Aug 10 00:00:00 EDT 2008

If you only want to see the day of the week, e.g., day 7, "Sun", or "Sunday", then you can provide a format parameter as well as shown below:

$ date '+%u' --date=2008-08-10
7
$ date '+%a' --date=2008-08-10
Sun
$ date '+%A' --date=2008-08-10
Sunday

The format values used above are as follows:

%a     locale's abbreviated weekday name (e.g., Sun)

%A     locale's full weekday name (e.g., Sunday)

%u     day of week (1..7); 1 is Monday

[/os/unix/linux] permanent link

Wed, Dec 30, 2015 10:34 pm

Windows System Image Backup failed with 0x80070002 code

After attempting to create a system image backup on an external USB drive of a Windows 7 Ultimate system, I saw a message that "The backup failed. The system cannot find the file specified. (0x80070002)." The window where I saw the error message didn't offer me a way to see what file or files were associated with the error message. It took me many hours to finally connect the error message to an issue with a USB port on the front of the computer. When I moved the cable between the external USB drive and the computer from a USB port on the front of the computer to one on the back, I was finally able to successfully create a system image on the external drive.

[ More Info ]

[/os/windows/win7] permanent link

Mon, Dec 28, 2015 10:41 pm

Apple Software Update on Microsoft Windows systems

The Apple Software Update application, which may be found in C:\Program Files (x86)\Apple Software Update on Microsoft Windows systems, is used to check for updates for Apple software products on those systems. While checking for updates, the software establishes HTTP connections to swcdn.apple.com and swcatalog.apple.com . You may find that a web server it is querying regarding updates, though, is in the IP address space of the Internet Service Provider (ISP) for the system on which the software runs because Apple has partnered with Akamai Technologies as have many other large companies, for use of Akamai's content delivery network (CDN) for the delivery of content from Apple. By partnering with a CDN provider a company can have its content delivered from servers closer to the end user.

[ More Info ]

[/os/windows/software] permanent link

Wed, Dec 23, 2015 11:04 pm

Adding the Microsoft Windows FTP Service to a Windows 7 system

If you wish to set up a Microsoft Windows 7 system as an File Transfer Protocol (FTP) server, Microsoft provides FTP server software which you can enable through the Turn Windows Features on or off capability under Programs and Features, which you can access from the Control Panel . You can configure the FTP server service to use "Basic" authentication so that users will need to provide a user name and password for an account on the system in order to transfer files to/from the FTP server or you can choose to set up the FTP server to use anonymous authentication, which will allow FTP users to type anonymous when prompted for a user name and then provide whatever they wish when prompted for a password.

[ More Info ]

[/os/windows/win7] permanent link

Tue, Dec 22, 2015 11:23 pm

Displaying mail account information with AppleScript

Apple's AppleScript scripting language provides a means to obtain information from applications on a OS X system. Applications have a "dictionary" that can be consulted to determine what properties can be queried or altered. E.g., to see the dictionary for the Mail application on an OS X system, I can open the AppleScript Editor program found in Applications/Utilities, then click on File, select Open Dictionary and scroll down until I see the Mail application listed. I can then click on it to highlight it and then click on the Choose button to open that dictionary.

[ More Info ]

[/os/os-x/applescript] permanent link

Sat, Dec 19, 2015 11:25 pm

Installing a Telnet client from Microsoft on Windows systems

If you need a telnet client on a Microsoft Windows system, e.g., a Windows Vista, 7, 8, Server 2008 R2, Windows Server 2008 system, etc., you can install PuTTY, which is probably the most popular telnet client for Microsoft Windows systems, created by Simon Tatham, or you can install one provided by Microsoft from a command line interface (CLI), i.e., a command prompt, using the pkgmgr command as shown below:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Administrator>pkgmgr /iu:"TelnetClient"

C:\Users\Administrator>

After you enter the pkgmgr /iu:"TelnetClient" command, you won't see any indication that the software has been installed. The command prompt will be redisplayed and you may have to wait a couple of minutes afterwards for the installation to be completed depending on the speed of your system. If you see a User Account Control dialog box displayed when you enter the command, provide a userid and password for an administrator account and confirm that you want to allow the action it displays.

After you've installed the telnet client application, you can type telnet at a command prompt to start the client, which will take you to the telnet client prompt:

Welcome to Microsoft Telnet Client

Escape Character is 'CTRL+]'

Microsoft Telnet>

The telnet client program, telnet.exe is installed in \windows\system32.

C:\Windows>dir /s telnet.exe
 Volume in drive C has no label.
 Volume Serial Number is 9420-A68C

 Directory of C:\Windows\System32

07/13/2009  08:39 PM            79,872 telnet.exe
               1 File(s)         79,872 bytes

 Directory of C:\Windows\winsxs\amd64_microsoft-windows-telnet-client_31bf3856ad
364e35_6.1.7600.16385_none_1426830c3ebb712d

07/13/2009  08:39 PM            79,872 telnet.exe
               1 File(s)         79,872 bytes

     Total Files Listed:
               2 File(s)        159,744 bytes
               0 Dir(s)  61,068,718,080 bytes free

[/network/telnet] permanent link

Fri, Dec 18, 2015 10:40 pm

Changing Default Application to Open a File under OS X

If you need to change the default application that will be used to open a particular file type on a Mac OS X system, you can do so by taking the following steps:
  1. Right-click on a file of that type in the Finder.
  2. Select Get Info.
  3. Click on the triangle to the left of "Open with", then select the application you wish to use to open files of that kind.
  4. Click on the Change All.. button.
  5. When asked to confirm that you want to change all similar documents to open with the application click on the Continue button.

Example

[/os/os-x] permanent link

Thu, Dec 17, 2015 11:23 pm

Star Wars in ASCII

A new Star Wars movie, "The Force Awakens" is being released on Friday December 18, 2015.

Force Awakens poster

The Star Wars ssaga has been told in movies, animated TV series, a comic book series, novels, games, and fan fiction. It has also been related in ASCII art .



                          -===                  ####
        What are you     ""o o                 {"o o}
          talking        _\ -/_                 { =}
           about?    #  /      \             {~~   //~}
                     \\//| __ |\\           {{~{  //}~}}
                      \/ |/  \| \\          {} {//  } {}
                         [][][]  ||         {} //   } {}
                         |\  /|  [#         {} H{{}}} {}
                         |_||_|  I]          @ H"||"} @
                         [ ][ ]  I             {"||"}
                         | || |                {"||"}
                         |_||_|                {"||"}
      __________________/__][_]________________[_][_]____________________

To view the story retold in ASCII art, use a telnet program to connect to a site in the Netherlands, towel.blinkenlights.nl. You can do so on an Apple OS X system by opening the Terminal program found in Applications/Utilities and then issuing the command telnet towel.blinkenlights.nl. You can issue the same command from a Linux system. You can stop the display by typing Ctrl-] and then typing quit at the telnet> prompt. On a Microsoft Windows system, you can use PuTTY; set the connection type to telnet rather than ssh. If you've ever created ASCII art, you can appreciate the magntitude of the effort by the following individuals:

Original Work   : Simon Jansen ( http://www.asciimation.co.nz/ )
Telnetification : Sten Spans ( http://blinkenlights.nl/ )
Terminal Tricks : Mike Edwards (pf-asciimation@mirkwood.net)




                                           /~\
                                          |oo )
                                          _\=/_
                          ___         #  /  _  \
                         / ()\        \\//|/.\|\\
                       _|_____|_       \/  \_/  ||
                      | | === | |         |\ /| ||
                      |_|  O  |_|         \_ _/  #
                       ||  O  ||          | | |
                       ||__*__||          | | |
                      |~ \___/ ~|         []|[]
                      /=\ /=\ /=\         | | |
      ________________[_]_[_]_[_]________/_]_[_\_________________________

[/graphics] permanent link

Wed, Dec 16, 2015 11:27 pm

OS X sips command and image dimensions

On a Mac OS X system, you can use the file command to determine the width and height of an image in pixels.
$ file example.png
example.png: PNG image data, 69 x 91, 8-bit/color RGBA, non-interlaced

You can also use the sips command with the -g parameter followed by pixelWidth or pixelHeight.

$ sips -g pixelWidth example.png
/Users/jdoe/Documents/example.png
  pixelWidth: 69
$ sips -g pixelHeight example.png
/Users/jdoe/Documents/example.png
  pixelHeight: 91

Make sure you capitalize those as shown above; if you don't and use PixelWidth or PixelHeight, i.e., you use an uppercase "P" rather than a lowercase "p", the result will be "<nil>".

$ sips -g PixelWidth example.png
/Users/jdoe/Documents/example.png
  PixelWidth: <nil>

If you only want to see the number, you can pipe the output of the command to the tail command, instructing that command to show only the last line of output, and then pipe the output of the tail command to the cut command, instructing that command to use the colon as the delimiter for separating items on the line and to show just the second field, which will be the number preceded by a space:

$ sips -g pixelWidth example.png | tail -n1 | cut -d":" -f2
 69
$ sips -g pixelHeight example.png | tail -n1 | cut -d":" -f2
 91

Or you can omit the tail command and just use cut by adding the -s argument to that command to suppress lines with no field delimiter character, i.e., lines with no colon in this case, assuming there will be none on the first line of output from the sips command.

$ sips -g pixelWidth example.png | cut -d":" -f2 -s
 69
$ sips -g pixelHeight example.png | cut -d":" -f2 -s
 91

If you don't want the space preceding the number, you can use a space character as the delimiter and specify f4 rather than f2, since there are two spaces output before "pixel" on the second line of ouput and a third one after the colon.

$ sips -g pixelWidth example.png | cut -d" " -f4 -s
69

If you wished to put that in a window that will be displayed to the user, you can use AppleScript.

set w to do shell script "sips -g pixelWidth /Users/jdoe/Documents/example.png | cut -d':' -f2 -s"
set h to do shell script "sips -g pixelHeight /Users/jdoe/Documents/example.png | cut -d':' -f2 -s"
display alert "Width:" & (w as text) & "
Height:" & (h as text)

Hit Enter after the double quote at the end of the second-to-last line to have a newline character appear in the ouput after the line with the width is displayed so that the height appears on a separate line. The ouput will be as shown below:

AppleScript display of sips output

[/os/os-x] permanent link

Tue, Dec 15, 2015 11:05 pm

Determining last Windows backup time from a command prompt

If you want to determine the last time a backup was made on a Microsoft Windows system using the built-in Windows backup utility, you can do so from a command-line interface (CLI), i.e., a command prompt, using the wbadmin utility.

C:\Users\Administrator>wbadmin /?
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2004 Microsoft Corp.

---- Commands Supported ----

START BACKUP              -- Runs a one-time backup.
STOP JOB                  -- Stops the currently running backup or recovery
                              operation.
GET VERSIONS              -- List details of backups recoverable from a
                              specified location.
GET ITEMS                 -- Lists items contained in a backup.
GET STATUS                -- Reports the status of the currently running
                              operation.

[ More Info ]

[/os/windows/commands] permanent link

Sun, Dec 13, 2015 4:10 pm

Video DownloadHelper

Another add-on for Firefox for downloading videos from YouTube pages is Video DownloadHelper. The add-on works in Chrome as well and also will allow you to download videos from other sites as well as the YouTube site. Like the Download YouTube Videos as MP4 extension, it allows you to select from various resolutions for the downloaded video, so you can trade off resolution against file size, i.e., a higher resolution and larger file size or a lower resolution and smaller file size.

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

Sat, Dec 12, 2015 10:52 pm

Download YouTube Videos as MP4 Add-on for Firefox

If you wish to be able to download YouTube videos to your own computer, you can use a site, such as Offliberty or, for the Firefox web browser, you can install an extension, aka add-on, that will provide that capability from within the browser. One such add-on for Firefox is Download YouTube Videos as MP4 by ialc. The extension places a download button on YouTube pages allowing you to easily download the video on the page as an MP4 or FLV file. If you select MP4 as the format for the downloaded file, you can choose from two resolutions: 720p or 360p.

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

Fri, Dec 11, 2015 10:33 pm

OS X dictionary lookup

If you have a Mac OS X system, there is a built-in dictionary application that you can use by moving the mouse pointer over a word and then hitting the control-command-D keys simultaneously. When you do so the word will be highlighted in yellow and, if the word is in the dictionary, its meaning will be displayed as well as thesaurus information for the word.

OS X dictionary lookup of legacy

If the word isn't in the dictionary, you will see "No results found" displayed.

So, if you encounter a word on a webpage that you don't recognize, you can go to dictionary.com to look up the definition of the word or you can stay on the page and look it up by hitting those three keys simultaneously.

[/os/os-x] permanent link

Wed, Dec 09, 2015 11:43 pm

Wrapping text and viewing the current line and column in the vi editor

If you use the vi or Vim text editors and wish to have lines automatically wrap to the next line when you get close to the margin, i.e., the 80th column, rather than having to hit the Return key, you can use the wrapmargin parameter, e.g., wrapmargin=10. To enter the command, while not in input mode type :wrapmargin= followed by the number you wish to use for the wrap margin.

The wrapmargin parameter is set to an integer number of characters. When set to any nonzero number, vi will watch the lines that you type in the input modes. When you get to within the "wraprmargin" number of characters of the 80th character on the line, the next space character that you type will cause vi to enter a carriage return for you. This parameter gives vi a word wrap feature for entering text data. When set to zero, the wrap margin feature is disabled.

Source: Unix for Application Developers by William A. Parrette ©1991, page 320

If you wish to have vi display the current line and column number as you type, use :set ruler. If it is turned on you will see the current line number and column number displayed at the bottom of the vi window, e.g., 24,67 if you were on line 24 at column 67. The numbers will change as you move the cursor whether you are in input mode or not. You can turn it off with :set noruler.

Alternatively, you can also use control-G on a Mac OS X system or Ctrl-G on a Linux system or with Vim on a Microsoft Windows system, i.e., hit the control, or Ctrl, and G keys simultaneously to see the current line and column numbers. You will see something like the following displayed at the bottom of the window:

"temp.txt" [Modified] line 30 of 34 --88%-- col 32

In the above example, while editing the file temp.txt the cursor was on line 30 of the 34 lines in the file and was at column 32 when I hit control-G. Since 30 is 88% of 34, the cursor was at a point 88 percent of the way through the file. Each time you hit control-G, the status information will be displayed for the current line and column when you hit the key combination.

With vi on a Mac OS X or Linux system, you can also use !}fmt when not in input mode, to automatically wrap the text in a paragraph so that a line doesn't exceed column 80 in that paragraph from the point where you enter that command.

[/software/editors/vi] permanent link

Wed, Dec 02, 2015 10:51 pm

Using networksetup for Wi-Fi networks on OS X systems

On a Mac OS X system, you can check on the status of a wifi connection using the wifi icon at the top of the screen. If you wish to check the status of a wifi connection from the command line, you can use the networksetup utility provided with the operating system. The command has a lot of options suitable for viewing the status of a wifi connection and managing wireless connectivity. You can view the available wireless networks, switch from one wireless network to another, power the wireless connection on and off, etc. using options supported by the command.

[ More Info ]

[/os/os-x] permanent link

Tue, Dec 01, 2015 11:06 pm

Finding and Using a Google Voice Number

I use my personal cell phone for work purposes as well, since I don't want to carry two cell phones. I have the phone's number registered with the U.S. government's National Do Not Call Registry. Unfortunately, though, that has not stopped all telemarketers from calling. Since I can't know the phone number for everyone who may call me for work-related purposes, I can't choose to ignore incoming calls based on whether I recognize the incoming number and often telemarketers spoof calling numbers, so that, for instance, if you have a phone number that is 555-555-5555, the telemarketer will spoof the number from which calls are being placed so that you see a similar number as the calling number, e.g., 555-555-5566, which may lead those called to assume the caller is someone local that they may know.

When I'm working I don't want to be interrupted by telemarketing calls, requests for donations, political spiels, etc. So I registered for a Google Voice number, which provides me with another phone number that I can provide to businesses or other entities that I believe may possibly sell my phone number to others or call me when I don't want interruptions because I'm working on something I need to focus on. Through the Google Voice webpage, I can configure the settings for the phone number provided by Google to automatically forward calls and text messages to the Google Voice number to my mobile number or stop the forwarding of calls and texts to the mobile number. When calls/texts aren't forwarded, callers can leave voice messages, which you can listen to through the Google Voice webpage or from email in your inbox. You can also view text messages the same way.

E.g., I wanted to check on refinancing my mortgage through LendingTree which required I provide a phone number at the website. I didn't want to provide my mobile number for fear I might start receiving a large number of calls when I'm trying to work. I don't want to turn off the phone, at such times which would mean I might miss work-related or calls or texts from family members. And I can't be certain that my phone number won't be sold to many telemarketers increasing the number of annoying telemarketing calls I receive. So I provided the Google Voice number. If at some point in the future I find I'm receiving a large number of unwanted calls to that number, I can just delete that number from my Google Account.

The process for obtaining a Google Voice number, which is free, is fairly simple.

[ More Info ]

[/network/web/services/google/voice] permanent link

Mon, Nov 30, 2015 9:54 pm

Fix for 802.1X authentication failing after password change

I changed my password for a MacBook Pro laptop running OS X 10.8.5. After I did so, since the password is also used for 802.1X authentication for a work wireless network, that authentication was failing. I would see "Authenticating" for a long time and then, eventually, a message indicating that the system couldn't join the relevent wireless network because "A connection timeout occurred." I was never prompted to provide a new password for authenticaion. I was able to fix the problem, by opening the Keychain Access utility found in Applications/Utilities then selecting Passwords from the Category list in the left pane of the Keychain Access window. In the right pane, I saw several entries for the wireless network identified as "802.1X Password" for Kind in the "login" Keychain. All but the top one had "WPA:" at the beginning of the Name. I selected the top one, though, because the Date Modified field for it contained "Today" whereas all of the other entries had a date value of Aug 14, 2013. When I double-clicked on the top entry with the modification date of today, another window opened with Name, Kind, Account, Where, and Comments fields under the Attributes tab. There was also a check box for "Show password". When I checked that box, a window opened stating "Keychain Access wants to use your confidential information..." requesting the "login" keychain pasword. I provided that password and clicked on the Allow button. I was then able to view the current 802.11X password and change the password for the 802.11x authentication to the wireless network. After clicking on Save Changes. I was then able to successfully complete the 802.1X authentiction seeing an "Authenticated via PEAP (MSCHAPv2) message in the System Preferences Network window.

[/os/os-x] permanent link

Mon, Nov 23, 2015 9:49 pm

Determining software versions from the command line

If you want to know which version of an application is installed on a Mac OS X system you can do so from within the GUI using the About option. E.g., in the Safari web browser you can click on Safari and select About Safari. You can also determine the version of applications installed on an OS X system by clicking on the Apple icon in the upper, left-hand corner of the screen then selecting About This Mac, then More Info, then System Report, then Software, and then clicking on Applications beneath Software as shown at Determining the version of the OS and applications under OS X.

However, if you wish to determine the version of an application from a command line interface (CLI), aka a shell prompt, which you can get using the Terminal application found in Applications/Utilities you can use the command system_profiler SPApplicationsDataType. If you pipe the output of the command to the more command you can page through the list that is output by hitting the space bar when the colon (:) prompt is displayed.

Jony Ive:
The Genius
Behind Apple's
Greatest Products
$ system_profiler SPApplicationsDataType | more
Applications:

    Microsoft Lync:

      Version: 14.2.1
      Last Modified: 10/2/15 8:52 PM
      Kind: Intel
      64-Bit (Intel): No
      App Store: No
      Get Info String: 14.2.1 (150923), © 2010 Microsoft Corporation. All rights reserved.
      Location: /Applications/Microsoft Lync.app

    Junos Pulse:

      Version: 5.0
      Last Modified: 4/17/14 4:27 PM
      Kind: Intel
      64-Bit (Intel): No
      App Store: No
      Location: /Applications/Junos Pulse.app

    Microsoft Database Utility:

      Version: 13.1.6
:

If you are interested in the version of a particular program, such as Safari, you can use the grep utility to search for the application name followed by a colon and then after grep display the two lines that appear after it finds a match. E.g.:

$ system_profiler SPApplicationsDataType | grep -A 2 "Safari:" 
    Safari:

      Version: 6.2.8

If you just want to see the version number as output, you can pipe the output of the above command to the cut utility, instructing it to display the string that starts in column 16 of the line that contains "Version" as shown below. The -c 16- parameter instructs cut to display characters from column 16 to the end of the line.

$ system_profiler SPApplicationsDataType | grep -A 2 "Safari:" | grep "Version:" | cut -c 16-
6.2.8
$ system_profiler SPApplicationsDataType | grep -A 2 "Junos Pulse:" | grep "Version:" | cut -c 16-
5.0

[/os/os-x] permanent link

Sun, Nov 22, 2015 8:43 pm

Viewing accounts that have access to a MySQL or MariaDB database

If you wish to know which accounts have access to a MySQL or MariaDB database, you can use the command select user from mysql.db where db='dbname'; where dbname is the name of the relevant database. E.g., if I want to view access to the Abc database, I can use the command below while logged into the MySQL/MariaDB DBMS as root (you can log in using the MySQL/MariaDB root account with mysql -u root -p):
MariaDB [(none)]> select user from mysql.db where db='Abc';
Empty set (0.00 sec)
MariaDB [(none)]>

In the above example, no accounts have been granted access to the database. If I want to grant all types of access to the abcsales1 account to all tables in the database, I can use the command shown below:

MariaDB [(none)]> GRANT ALL on Abc.* to 'abcsales1'@'localhost';
Query OK, 0 rows affected (0.04 sec)

MariaDB [(none)]> select user from mysql.db where db='Abc';
+-----------+
| user      |
+-----------+
| abcsales1 |
+-----------+
1 row in set (0.00 sec)

MariaDB [(none)]>

Bear in mind that the select user from mysql.db where db='dbname'; will only show users who have database-level access to the database named dbname. It is possible that an account can have access at the table, column, or proc level rather being granted access at the database level. To check for those access levels of access as well as database-level acess, use all of the commands below substituting the name of the database for dbname:



SELECT user,host FROM mysql.db WHERE db='dbname';
SELECT user,host FROM mysql.tables_priv WHERE db='dbname';
SELECT user,host FROM mysql.columns_priv WHERE db='dbname';
SELECT user,host FROM mysql.procs_priv WHERE db='dbname';

E.g.:

MariaDB [(none)]> SELECT user,host FROM mysql.db WHERE db='Abc';
+-----------+-----------+
| user      | host      |
+-----------+-----------+
| abcsales1 | localhost |
+-----------+-----------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT user,host FROM mysql.tables_priv WHERE db='Abc';
Empty set (0.00 sec)

MariaDB [(none)]> SELECT user,host FROM mysql.columns_priv WHERE db='Abc';
Empty set (0.00 sec)

MariaDB [(none)]> SELECT user,host FROM mysql.procs_priv WHERE db='Abc';
Empty set (0.00 sec)

MariaDB [(none)]>

References:

  1. how to know all users that can access certain database (mysql)?
    Asked: April 28, 2011
    Server Fault
  2. Managing database access with MariaDB or MySQL
    Date: July 17, 2015
    MoonPoint Support

[/software/database/mysql] permanent link

Sat, Nov 21, 2015 11:05 pm

Icns files

Icns files are used on Mac OS X systems to store icons for applications. The icns files end with a .icns extension. An icns file can store multiple icons within itself. The Apple Icon Image format used for the files supports icons of 16 × 16, 32 × 32, 48 × 48, 128 × 128, 256 × 256, 512 × 512, and 1024 × 1024 pixels in size. OS X can scale the fixed-size icons to be displayed at any intermediate size. You can view the icons stored within a .icns file on an OS X system using the Preview program found in the Applications directory.

[ More Info ]

[/os/os-x] permanent link

Fri, Nov 20, 2015 10:28 pm

SymDaemon high CPU Usage

The performance of a MacBook Pro laptop running OS X 10.8.5, aka "Mountain Lion", that I've been using was very poor today and the fan was making much more noise than usual. When I used top -o cpu and the Activity Monitor to check which process was causing the problem, I found that the Symantec SymDaemon process was the culprit. After I killed that process, performance improved considerably, the fan noise subsided and when I compared the CPU temperature before and after stopping the process with osx-cpu-temp, I found the CPU was considerably cooler afterwards. Likewise, when I checked the fan speed with smcFanControl before and aftwards, I found that smcFanControl showed the fans to be running considerably slower after the process was stopped.

[ More Info ]

[/os/os-x] permanent link

Fri, Nov 13, 2015 9:54 pm

Netsh show networks

To view the available WiFi networks from a Microsoft Windows system from a command line interface (CLI), enter the netsh wlan show networks command at a command prompt.
C:\users\jane>netsh wlan show networks

Interface name : Wireless Network Connection 5
There are 3 networks currently visible.

SSID 1 : ARRIS-0142
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : CCMP

SSID 2 : BY7VQ
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : CCMP

SSID 3 : 30F5A9
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : CCMP

You can view the signal strength for a wireless connection from the system using netsh wlan show interfaces.

C:\users\jane>netsh wlan show interfaces

There is 1 interface on the system:

    Name                   : Wireless Network Connection 5
    Description            : TP-LINK 450Mbps Wireless N Adapter
    GUID                   : 55a96587-9163-4f0a-a2c0-2f16705bea60
    Physical address       : c4:e9:84:15:d6:e4
    State                  : connected
    SSID                   : ARRIS-0142
    BSSID                  : 94:87:7c:03:01:40
    Network type           : Infrastructure
    Radio type             : 802.11n
    Authentication         : WPA2-Personal
    Cipher                 : CCMP
    Connection mode        : Auto Connect
    Channel                : 11
    Receive rate (Mbps)    : 216.7
    Transmit rate (Mbps)   : 216.7
    Signal                 : 32%
    Profile                : ARRIS-0142

    Hosted network status  : Not started

For the above Wi-Fi connection, the signal strength is fair at best with a strength of only 32%.

[/os/windows/commands] permanent link

Wed, Nov 11, 2015 8:49 pm

Searching for online copies of an image

If you have an image on your computer or find one online and want to know locations where that image appears on web sites, you can use the TinEye site or Google Images. Both sites allow you to upload an image or provide a URL for an online location for an image. The services will then return a list of all the locations where the image or similar images were found.

[ More Info ]

[/network/web/search] permanent link

Tue, Nov 10, 2015 10:29 pm

Junos Pulse Failed to Connect

On Friday the Juniper Networks Junos Pulse client software I use to connect to a work VPN stopped working on my MacBook Pro running OS X 10.8.5, aka "Mountain Lion". After the problem first occurred, whenever I started the Junos Pulse program which is at version 5.0.3, I would see a window with no connections listed whereas previously I would see the work VPN connection with a Connect button to the right of it. When I tried adding the prior VPN connection again, I would receive a "Failed to connect to the Juniper Unified Network Service" error message. Today was the first day I had to spend any significant amount of time troubleshooting the problem. I was able to resolve the problem using commands that had worked previously with another Junos Pulse VPN client problem.

[ More Info ]

[/os/os-x] permanent link

Wed, Nov 04, 2015 9:21 pm

Determining what application will open a file from the command line

If you wish to know what application will open a particular file type on a Microsoft Windows system, you can obtain that information from the command line using the ftype command.

c:\>ftype /?
Displays or modifies file types used in file extension associations

FTYPE [fileType[=[openCommandString]]]

  fileType  Specifies the file type to examine or change
  openCommandString Specifies the open command to use when launching files
                    of this type.

Type FTYPE without parameters to display the current file types that
have open command strings defined.  FTYPE is invoked with just a file
type, it displays the current open command string for that file type.
Specify nothing for the open command string and the FTYPE command will
delete the open command string for the file type.  Within an open
command string %0 or %1 are substituted with the file name being
launched through the assocation.  %* gets all the parameters and %2
gets the 1st parameter, %3 the second, etc.  %~n gets all the remaining
parameters starting with the nth parameter, where n may be between 2 and 9,
inclusive.  For example:

    ASSOC .pl=PerlScript
    FTYPE PerlScript=perl.exe %1 %*

would allow you to invoke a Perl script as follows:

    script.pl 1 2 3

If you want to eliminate the need to type the extensions, then do the
following:

    set PATHEXT=.pl;%PATHEXT%

and the script could be invoked as follows:

    script 1 2 3

If you open a command prompt window and type ftype with no options, you will see all the file associations for the system on which the command is run, i.e., which applications will open particular file formats. You can pipe the output of the command into the more command to page through the information using the space bar or redirect the output to a file with ftype > somefile.txt.


c:\>ftype | more
Access=C:\Program Files\Microsoft Office 15\Root\Office15\protocolhandler.exe "%
1"
Access.ACCDAExtension.15=C:\Program Files\Microsoft Office 15\Root\Office15\MSAC
CESS.EXE /NOSTARTUP "%1"
Access.ACCDCFile.15="C:\Program Files\Microsoft Office 15\Root\Office15\MSACCESS
.EXE" /NOSTARTUP "%1"
Access.ACCDEFile.15="C:\Program Files\Microsoft Office 15\Root\Office15\MSACCESS
.EXE" /NOSTARTUP "%1" %2 %3 %4 %5 %6 %7 %8 %9
Access.ACCDRFile.15="C:\Program Files\Microsoft Office 15\Root\Office15\MSACCESS
.EXE" /RUNTIME "%1" %2 %3 %4 %5 %6 %7 %8 %9
Access.ACCDTFile.15="C:\Program Files\Microsoft Office 15\Root\Office15\MSACCESS
.EXE" /NOSTARTUP "%1"
Access.ADEFile.15="C:\Program Files\Microsoft Office 15\Root\Office15\MSACCESS.E
XE" /NOSTARTUP "%1" %2 %3 %4 %5 %6 %7 %8 %9
Access.Application.15="C:\Program Files\Microsoft Office 15\Root\Office15\MSACCE
SS.EXE" /NOSTARTUP "%1" %2 %3 %4 %5 %6 %7 %8 %9
Access.BlankDatabaseTemplate.15="C:\Program Files\Microsoft Office 15\Root\Offic
e15\MSACCESS.EXE" /NOSTARTUP /NEWDB "%1"
Access.BlankProjectTemplate.15="C:\Program Files\Microsoft Office 15\Root\Office
15\MSACCESS.EXE" /NOSTARTUP /NEWDB "%1"
Access.Extension.15=C:\Program Files\Microsoft Office 15\Root\Office15\MSACCESS.
EXE /NOSTARTUP "%1"
Access.MDBFile="C:\Program Files\Microsoft Office 15\Root\Office15\MSACCESS.EXE"
 /NOSTARTUP "%1" %2 %3 %4 %5 %6 %7 %8 %9
-- More  --

You might think that you could just type ftype ext, where txt is a 3-letter extension, e.g., ftype docx, to determine what application will open a file with a .docx extension, but that won't work.

c:\>ftype docx
File type 'docx' not found or no open command associated with it.

c:\>ftype txt
File type 'txt' not found or no open command associated with it.

You will need to know that a .txt file is identified as a "textfile" and a .docx file, which is an Office Open XML file format, is identified as a "docxfile" for that method to work, but you can use just the 3-letter extension, if you pipe the output of the ftype command to the find command as shown below:

c:\>ftype | find "txt"
txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1

c:\>ftype | find "docx"
docxfile="%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE" "%1"

From the above output, I can see that the Windows Notepad application is the default program for opening text files, i.e., the program that will open any file with a .txt extension if I double-click on the file in the Windows Explorer. And I can see that the Windows Wordpad, aka Write, program will open .docx files by default.

[/os/windows/commands] permanent link

Tue, Nov 03, 2015 9:54 pm

Converting audio/video files to another format with VLC

The free and open-source (FOSS) VLC program can be used to convert audio and video files from one format to another. VLC is a cross-platform, audio/video (A/V) program that is available for Microsoft Windows, Mac OS X, Android, and iOS systems.

VLC originated as an academic project in 1996. It was rewritten from scractch in 1998 and released under the GNU General Public License (GPL) in 2001 - see the Wikipedia article VLC media player for further details on the development history for the application.

Steps for converting a file from one format to another, e.g., a FLAC audio file to an MP3 audio format are provided here.

[/software/audio_video/VLC] permanent link

Sun, Nov 01, 2015 4:09 pm

Running a Python script on an Apache web server

If you attempt to run a Python script on a web page on an Apache web server and see only the Python code displayed, then you may need to create a ScriptAlias directive in Apache's http.conf configuration file and restart the Apache webserver. If you see an "Internal Server Error" displayed when the script is being called by Apache on a Unix/Linux system, but the code is correct, then you may need to assign execute permission to the file so that Apache can run the script. You also need to be sure the script contains a line at the beginning of the file that provides the location of Python on the system.

[ More Info ]

[/languages/python] permanent link

Sat, Oct 31, 2015 10:53 pm

Driverquery

The driverquery command can be used on Microsoft Windows systems to obtain information on the device drivers in use on the system. You can use driverquery /si to determine which drivers on the system have been digitally signed and the /v option to obtain detailed, i.e., verbose, output for the drivers on the system. You can use the command wmic loadorder to obtain information on the load order for the drivers.

[ More Info ]

[/os/windows/commands] permanent link

Tue, Oct 27, 2015 10:07 pm

Installing iperf on CentOS

Iperf is a tool that can be used to determine the network bandwidth available between two end points. On one system you run iperf in server mode and on the other you run it in client mode. On both hosts iperf will report the available bandwidth. E.g., below is the output from a system running iperf in server mode:

[root@localhost install]# [  4] local 192.168.18.44 port 5001 connected with 172.25.2.72 port 55990
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.4 sec  3.00 MBytes  2.42 Mbits/sec

To install Iperf on a CentOS system with yum install iperf, you may need to configure the system to use the Extra Packages for Enterprise Linux (EPEL) repository, which you can do by issuing the command yum install epel-release. A repository is a source for software packages that can be installed with yum.

[ More Info ]

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

Mon, Oct 26, 2015 8:36 pm

Downloading a web page with Python

To download a webpage with a Python script, you can use the following, substituting the URL for the page you wish to download for the one for which you wish to download the source code:

import urllib2

url="http://www.example.com/somepage.html"

page =urllib2.urlopen(url)
source=page.read()
print source

If you wish the script to prompt for the URL and a location for a file where the source code for the web page will be stored, you can use the following:

import urllib2

url=raw_input("URL: ")
outfile=raw_input("Output file: ")

page =urllib2.urlopen(url)
source=page.read()

f=open(outfile, 'w')
f.write(source)
f.close()

The "w" in the f=open(outfile, 'w') line indicates the file should be opened for writing. Other possible modes for the file are listed below:

ModesDescription
r Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode.
rb Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. This is the default mode.
r+ Opens a file for both reading and writing. The file pointer placed at the beginning of the file.
rb+ Opens a file for both reading and writing in binary format. The file pointer placed at the beginning of the file.
w Opens a file for writing only. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing.
wb Opens a file for writing only in binary format. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing.
w+ Opens a file for both writing and reading. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing.
wb+ Opens a file for both writing and reading in binary format. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing.
a Opens a file for appending. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing.
ab Opens a file for appending in binary format. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing.
a+ Opens a file for both appending and reading. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.
ab+ Opens a file for both appending and reading in binary format. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.

If you named the script download_webpage.py, you could run it from a command line inteface, aka shell prompt, as follows:

$ python download_webpage.py
URL: http://www.example.com/somepage.html
Output file: example-somepage.html

References:

  1. Python Files I/O
    tutorialspoint - The largest Tutorials Library on the web

[/languages/python] permanent link

Thu, Oct 22, 2015 10:42 pm

Mirroring a display to an external monitor and obtaining information on it under OS X

To mirror what is displayed on a laptop's screen to an external monitor under Apple's OS X operating system, take the following steps after connecting the external monitor:
  1. Click on the Apple icon on the upper, left-hand of the screen and select System Preferences.
  2. Under Hardware, click on Displays.
  3. Click on the Arrangement tab for the display and check the check box next to Mirror Displays.

    LA2405 monitor - mirror displays

You should then see a copy of the information displayed on the laptop's builtin monitor also displayed on the external monitor.

[ More Info ]

[/os/os-x] permanent link

Tue, Oct 20, 2015 8:32 pm

Synching Google Drive from the command line

If you want to synchronize files stored on a computer with the Google Drive cloud from the command line, the only way to do so currently using the application provided by Google appears to be to kill the googledrivesync.exe process that handles the synchronization and then restart it. You can kill the processes - there are actually two of them running with the same "googledrivesync.exe" name - from the command line with taskkill /f /fi "imagename eq googledrivesync.exe" and then restart them with the command "C:\Program Files (x86)\Google\Drive\googledrivesync, assuming that the googledrivesync application is stored in the default location of "C:\Program Files (x86)\Google\Drive\.

[ More Info ]

[/network/web/services/google/drive] permanent link

Sun, Oct 18, 2015 9:00 pm

Stop Access from rounding number

For a field in an Access 2013 database that I wanted to hold the amperage for a device's power adapter, e.g., 1.5, I specified the field should be a number with a "fixed" format. But whenever I put in 1.5, Access would change it to 2. I clicked on the button to increase the number of decimal points, but Access would round the number 1.5 to 2.0 then. To resolve the problem, I clicked on View for the table and selected Design View.

Access design view

I could then see, when I selected the field that was to hold the amperage, that the Field Size value was set to Long Integer. An integer field, obviously, won't hold a fractional part for the number.

Access Long Integer field size

I set the value to Single instead by clicking in the field and selecting that option from the dropdown list, so I could store a floating point value in the field rather than an integer.

Access Single field size

From the dropdown list for field size, you can select the following values:

Setting

Description

Decimal precision

Storage size

Byte

Stores numbers from 0 to 255 (no fractions).

None

1 byte

Decimal

Stores numbers from -10^38-1 through 10^38-1 (.adp)
Stores numbers from -10^28-1 through 10^28-1 (.mdb, .accdb)

28

2 bytes

Integer

Stores numbers from -32,768 to 32,767 (no fractions).

None

2 bytes

Long Integer

(Default) Stores numbers from -2,147,483,648 to 2,147,483,647 (no fractions).

None

4 bytes

Single

Stores numbers from
-3.402823E38 to -1.401298E&45
for negative values and from
1.401298E-45 to 3.402823E38 for positive values.

7

4 bytes

Double

Stores numbers from
-1.79769313486231E308 to -4.94065645841247E-324
for negative values and from
4.94065645841247E-324 to 1.79769313486231E308 for positive values.

15

8 bytes

Replication ID

Globally unique identifier (GUID)

N/A

16 bytes

Note: you can see the values that each one can hold by hitting the F1 key to get online help on the topic after clicking on the value stored in the Field Size field while in Design View.

When I switched back to Datasheet View by clicking on View and then selecting Datasheet View, I was then able to change the value from 2.0 to 1.5 and have it remain as 1.5, i.e., Access had stopped rounding numbers to the nearest integer for the field.

References:

  1. Field Size Property

[/software/database/access] permanent link

Tue, Oct 13, 2015 9:35 pm

Obtaining the model number and serial number for a HDD from the command line

If you wish to obtain the model number and serial number for a hard disk drive (HDD) from the command line on a Microsoft Windows system, you can use the Windows Management Instrumentation command line tool wmic at a command prompt or get-wmiobject -class win32_diskdrive from a Windows PowerShell prompt.

For wmic, you can use the following command:

C:\Users\JDoe\Documents>wmic diskdrive get caption, model, serialnumber
Caption                          Model                            SerialNumber

TOSHIBA MQ01ABD075               TOSHIBA MQ01ABD075               73RISBDFS

Seagate Backup+ Desk USB Device  Seagate Backup+ Desk USB Device  NA5J4H3R

In the above example, I also included the caption parameter to get a description for the drive that may help me more easily identify it, though in this case the caption information and the model information are the same. In the above case, the Toshiba drive is the internal drive in the system while the Seagate is an external, USB-attached drive.

To use PowerShell to obtain the same information, I could use the command below:

PS C:\Users\JDoe> get-wmiobject -class win32_diskdrive | format-table Caption, Model, SerialNumber

Caption                                 Model                                   SerialNumber
-------                                 -----                                   ------------
TOSHIBA MQ01ABD075                      TOSHIBA MQ01ABD075                                 73RISBDFS
Seagate Backup+ Desk USB Device         Seagate Backup+ Desk USB Device         NA5J4H3R

You can obtain much more information on drives in PowerShell with the get-wmiobject -class win32_diskdrive | format-list * command. If the drive supports Self-Monitoring, Analysis and Reporting Technology (SMART), you can use the status command to learn if the drive may be failing or is encountering problems that could lead to a drive failue.

PS C:\Users\Jim> get-wmiobject -class win32_diskdrive | format-table Caption, Model, Status, SerialNumber

Caption                       Model                         Status                        SerialNumber
-------                       -----                         ------                        ------------
TOSHIBA MQ01ABD075            TOSHIBA MQ01ABD075            Pred Fail                                73RISBDFS
Seagate Backup+ Desk USB D... Seagate Backup+ Desk USB D... OK                            NA5J4H3R

The Toshiba drive has a status of Pred Fail, which indicates a SMART-enabled hard disk may be functioning correctly, but a failure is predicted soon. You can also retrieve the status of a drive using the wmic command.

C:\Users\JDoe\Documents>wmic diskdrive get model, status, serialnumber
Model                            SerialNumber  Status
TOSHIBA MQ01ABD075               73RISBDFS     Pred Fail
Seagate Backup+ Desk USB Device  NA5J4H3R      OK

Other parameters you can use with wmic to obtain drive information, such as the capacity of the drive, etc., are listed at Using wmic to get disk drive information.

A PowerShell command that can be used to determine which drive the operating system considers to be drive zero, drive one, etc. is shown below:

PS C:\Users\JDoe> Get-WmiObject Win32_PhysicalMedia | Format-Table Tag, SerialNumber

Tag                                                         SerialNumber
---                                                         ------------
\\.\PHYSICALDRIVE0                                                     73RISBDFS
\\.\PHYSICALDRIVE1                                          NA5J4H3R
\\.\CDROM1
\\.\CDROM0

References:

  1. Physical disk status is not OK
    Microsoft Developer Network
  2. Disk Drive Dangers - SMART and WMI
    I Programmer - programming, reviews and projects
  3. Using wmic to get disk drive information
    Date: July 10, 2010
    MoonPoint Support

[/os/windows/commands/wmic] permanent link

Mon, Oct 12, 2015 12:13 pm

MediaMonkey taking a long time to start playing music

My wife told me that MediaMonkey (MM) on her PC was taking a long time to start playing songs; it could take 20 seconds to begin playing a song after she double-clicked on it from the Windows Explorer to play the song. She showed the problem to me by having Windows 8 use Media Monkey as the default player for MP3 files. When she clicked on a song, I observed it did take as long as she reported, but when she then switched the default player to Windows Media Player, songs started playing almost immediately when she double-clicked on them. I checked the version of MediaMonkey on her system and found it was 4.1.7.1741. When I checked the MediaMonkey website at MediaMonkey >> Download, I found the current version is 4.1.9.1764. After I downloaded and installed that version, the problem no longer occurred.

[/os/windows/software/audio-video/MM] permanent link

Sun, Oct 11, 2015 5:54 pm

Adding or creating a K-Meleon Macro Module (KMM)

The open source K-Meleon web browser has its own macro language which can be used to extend the capabilities of the browser. Macros are stored in K-Meleon Macro Module (KMM) files, which can be placed in the macros directory beneath the direcory where you installed K-Meleon to make them available to all users of the browser on a system; K-Meleon runs on Microsoft Windows systems.

There are many .kmm files available for download in the K-Meleon Macro Library . Instructions for adding a KMM to a system are at K-Meleon - Adding a Macro Module. Instructions for creating macros are at K-Meleon - Creating a Macro Module.

[/network/web/browser/k-meleon] permanent link

Sat, Oct 10, 2015 4:06 pm

ACDSee Video Converter Pro - Error opening file for writing

When I attempted to install ACDSee Video Converter Pro 4.1 on my wife's computer, I received the mesage "Error opening file for writing" referencing the file CheckWinVer.exe.

ACDSee Video Converter Pro - Error opening file for writing

The problem was due to the fact that I hadn't right-clicked on the installation file and chosen "Run as administrator". When I aborted the installation and started over running it as administrator, the program installed successfully.

[/software/audio_video] permanent link

Sat, Oct 10, 2015 3:48 pm

Clearing Media Monkey and Windows Media Player Libraries

If you wish to clear the Windows Media Player (WMP) library, but not delete the music from your system, within the program while viewing your music, hit Ctrl-A to select all entries then right-click and select Delete. When a window opens prompting you as to whether you wish to delete items only from your library or wish to also delete the music files, e.g., MP3 files, from your system, leave "Delete from library only" selected and click on OK.

WMP - Delete from Library

In MediaMonkey, to clear the database, you can click on File then select Clear Database. You will then be prompted to type "YES" to ensure that you didn't inadvertently select to remove all entries from the Media Monkey music library for your account. For a family member who wanted to reinitialize her library, though, I found that after typing "YES" in all capital letters to proceed that a blue circling ring appeared for awhile, but afterwards all of the entries remained visible in the proram. If I clicked on File and selected Close or clicked on the "X" at the upper, right-hand corner of the Media Monkey window, the program would not close. When I closed the program through the Windows Task Manager, reopening it showed all the entries remained. Perhaps, because she had such an extensive music collection, the program may have been taking a long time to clear the database, but the library was never cleared after we performed several attempts to clear it. But there is another way to clear the database and start fresh. You can, instead, delete the Media Monkey database file, MM.DB. After killing the program through the Task Manager, I deleted that file, which, on a Windows 8 system is found at C:\Users\username\AppData\Roaming\MediaMonkey\MM.DB where username is the username for the account. Note: you may have to turn on the display of hidden files, folders, and drives through the Windows Explorer in order to view that location. I also deleted MM.DB-journal, which is found at that location. Then, when she reopened Media Monkey, the library was empty and she was able to add the music she wanted in the library back into it.

[/os/windows/software/audio-video] permanent link

Sat, Oct 03, 2015 7:15 pm

Controlling the volume on a Microsoft Windows system from the command line

To control the sound volume on a Microsoft Windows system, e.g., Windows 7 or 8, you can run the sndvol command from a command prompt. If you issue the command with no options, it will open the Volume Mixer that will allow you to adjust the audio volume.

Volume Mixer

You can view just the master volume slider if you use the -f option, i.e., sndvol -f.

Mixer

You can add an additional numeric parameter to the command line to control the horizontal and vertical position of the mixer window, if you wish, as explained at Windows 7 - Open the Volume Control popup from the command prompt.

[/os/windows/commands] permanent link

Fri, Oct 02, 2015 10:41 pm

Sending Encrypted Email with the OS X Mail Application

The Mail application found on Mac OS X systems supports the transmission and decoding of encrypted email that uses public key unfrastructure (PKI) certificates. You will see an open padlock icon on messages that will be sent unencrypted. If you have a public certificate for a recipient, you can click on the button with that symbol on it to encrypt the message.

OS X also provides the command line security utility for managing certificates. You can use security find-certificate email_address where email_address is the email address to which you wish to send email to determine if you already have a public certificate for the recipient in your keychain.

If you are using PKI software from Entrust on the system, you can also use it to retrieve public certificates for recipients.

[ More Info ]

[/os/os-x] permanent link

Fri, Sep 25, 2015 10:29 pm

HTML Button Tag

You can create a clickable button on a web page with Cascading Style Sheets (CSS) as explained in Creating a button with CSS or simply use the HTML button tag, i.e. <button>label_for_button</button>. You can apply a style attribute to the button to change the background color on the button, display attributes for the text, such as bold, etc. and can specify an action that will be taken if someone clicks on the button. The button tag has been part of HTML since version 4.0.

[ More Info ]

[/network/web/html] permanent link

Wed, Sep 23, 2015 8:10 pm

Saving an image as a transparent gif using IrfanView

The freeware/shareware IrfanView program for systems running the Microsoft Windows operating system provides the capability to convert images from one image file format to another by using its "save as" feature. If you have an image, e.g., a JPEG/JPG image, that you wish to convert to a transparent GIF format, you can do so by the following steps:
  1. Open the original image file, e.g., the JPG file.
  2. If you need to do any image cleanup, you can edit the image by clicking on Edit and selecting "Show Paint dialog"; a small window will then open with image editing tools that you can use, e.g., if you need to change any stray pixels to the color you wish to use as the transparent color. You can choose View and Zoom In, if you need to zoom into the image for a closer inspection.
  3. Then, to save as a transparent gif, click on File and select Save as.
  4. For "Save as type", choose GIF - Compuserve GIF.
  5. In the JPEG/GIF save options window, choose "Save transparent color" from the GIF section. You will then have three options: "use main window color for transparency", "choose transparent color during saving", or "set transparency value to palette entry". If you choose "choose transparent color during saving" when you save the file, you will be able to click on an area in the image that contains the color you wish to use as the transparent color.

    IrfanView JPEG/GIF save options

  6. Click on Save to save the image in the new format. Note: you need to click on the Save button on the Save Picture As window, not the Save button on the JPEG/GIF save options window. A Choose transparent color window will then open. Click somewhere on the image where the color exists that you wish to be the transparent color.

[/os/windows/software/graphics/irfanview] permanent link

Tue, Sep 22, 2015 9:12 pm

Safari CPU and Memory Usage on OS X

As with many other browsers, if you leave the Safari web browser open for an extended period of time with many tabs open, you may find that the overall system performance on a Mac OS X system decreases dramatically and you may have to suffer with the "spinning beachball" when trying to do even simple tasks, such as scrolling down a web page. The problem may be due to Safari consuming a lot of CPU cycles or most of the available memory. With some browsers, such as Firefox, where I've frequently encountered peformance issues if it is left running for a couple of days with many tabs open, it is difficult to determine which tab may be the culprit. With a browser such as Chrome, where tabs are run as separate processes, it is much easier. With Safari, you can use Debug menu options to obtain per tab memory and CPU utilization information by viewing the consumption of those resources by processes associated with those individual tabs.

[ More Info ]

[/network/web/browser/safari] permanent link

Sat, Sep 12, 2015 10:32 pm

Find email messages in a mbox file using python

I wanted to locate messages from any sender at a particular domain name in the mailbox for an account on a Linux system. The server where the acount resides uses sendmail and dovecot for email and the mailbox file for the account was in mbox format. When email is stored in mbox format, all email messages in the inbox are stored in the same text file. The beginning of each email message is indicated by a line whose first five characters consist of "From" followed by a space (the so named "From_ line" or "'From ' line" or simply "From line") followed by the sender's e-mail address.

In this case, the mailbox was huge with tens of thousands of messages in a file 24 GB in size and I wanted to extract just a few pertinent messages. So I created find-email.py, which can be run in either "brief" or "full" mode by changing the value of a variable named brief in the script. In brief mode, the script will just print the "from" line for any message where a sender's email address matches the specified address followed by the subject of the message and then the date the message was sent. When all messages in the file have been processed, it will print the number of matching messages found. In "full" mode, the script will print the entire email message whenever a match is found.

[/languages/python] permanent link

Fri, Sep 11, 2015 10:07 pm

Norton 360 Firewall Settings Option Grayed Out

While working on a system that had the Norton 360 software installed for antivirus protection, I wanted to ensure that I could query the system using the Simple Network Management Protocol (SNMP), but when I tried to check the Norton 360 firewall settings, I found the option to do so was grayed out. I had thought that I could check and modify the settings, if needed, by right-clicing on Norton 360 and choosing "Run as administrator", but I found that didn't work. In order to check the firewall settings I had to log into an administrator account rather than a regular user account.

[ More Info ]

[/security/firewalls/Norton_360] permanent link

Thu, Sep 10, 2015 10:42 pm

Burning an ISO Image to Disc under Mac OS X

To burn an ISO file to a disc, you can use the following steps on a Mac OS X system.
  1. Select a blank writable disc in the disc drive.
  2. Open the Finder and navigate to where the file is located.
  3. Right-click on the file, then choose Open with and Disk Utility.
  4. Select the .iso file by clicking on it, then click on the Burn button at the top of the window.

[/os/os-x] permanent link

Tue, Sep 08, 2015 8:04 pm

Changing the time stamp on a file or directory under Windows

On a Microsoft Windows system, files and directories have three time stamps associated with them: the creation time for the file or directory, the time it was last modified, and the time it was last accessed. If you wish to change any of those time stamps, you can use a utility such as the free NirCmd utility provided by Nir Sofer at NirSoft. E.g., you can change the date/time of the specified filename (creation time and modified time) using a command such as the one below:

nircmd.exe setfiletime "c:\temp\myfile.txt" "24-06-2003 17:57:11" "22-11-2005 10:21:56"

Nir also provides FolderTimeUpdate, which "scans all files and folders under the base folder you choose, and updates the 'Modified Time' of every folder according the latest modified time of the files stored in it. This tool might be useful if, for example, you backup a cluster of folders and then restore them into another disk, but the backup program doesn't restore the original modified time of the folders."

You can also use Windows PowerShell, which Microsoft has made available for Windows XP and later versions of its operating system to change those time stamps using a command similar to the following ones where name is the file or directory name for which you wish to change the time stamp:

$(Get-Item name).creationtime=$(Get-Date "mm/dd/yyyy hh:mm am/pm")
$(Get-Item name).lastaccesstime=$(Get-Date "mm/dd/yyyy hh:mm am/pm")
$(Get-Item name).lastwritetime=$(Get-Date "mm/dd/yyyy hh:mm am/pm")

[ More Info ]

[/os/windows/PowerShell] permanent link

Mon, Sep 07, 2015 8:52 pm

Entering UEFI from a Windows 8 system

I wanted to boot a Dell Inspiron 14 5000 series laptop (model number 14-5447) from a USB flash drive to perform an image backup of the internal hard disk drive (HDD). I had placed the Clonezilla backup program on a USB flash drive - see Creating a Clonezilla bootable flash drive - and wished to use it to create an image backup of the system's hard disk drive before upgrading the system from Windows 8.1 to Windows 10. But, in order to boot from the USB flash drive, I needed to change the Universal Extensible Firmware Interface (UEFI) settings to allow me to boot the system from the external USB flash drive. The steps to modify the system settings are listed at Entering UEFI from a Windows 8 system. Though these steps were written for this specific system, a similar process can be followed on other systems.

[/os/windows/win8] permanent link

Sun, Sep 06, 2015 4:55 pm

SSH Server for Windows

If you are searching for SSH server software for a Microsoft Windows system, there are a number of products to choose from, including ones that are free. Some commercial products are also free for personal use. Some of the choices include the following:
  1. Bitvise SSH Server
  2. Copssh
  3. freeSSHd
  4. OpenSSH for Windows, though development ceased years ago on it and I would no longer recommend it.
  5. PowerShell SSH Server for Windows
  6. SilverSHielD

You can also install OpenSSH server software for Cygwin.

The Bitvise SSH Server, PowerShell SSH Server for Windows, and SilverSHieLD are commercial products which have free for personal use versions.

[/reviews/software/windows/network/ssh] permanent link

Sat, Sep 05, 2015 10:48 pm

Updating a date entry from the command line in MySQL

When you update an entry for a column containing dates in a table in a MySQL or MariaDB database, you need to enclose the date in quotes. E.g.:

MariaDB [accounts]> UPDATE Invoices SET Date_Sent='2015-08-29' WHERE Name='Acme';

If you don't the contents of the date field will appear as 0000-00-00.

You also need to enclose the date in quotes when querying a database. E.g.:

MariaDB [accounts]> SELECT * FROM Invoices WHERE Date_Sent='2015-08-29';

Otherwise, you will get an empty set for the query results.

[/software/database/mysql] permanent link

Fri, Sep 04, 2015 12:44 pm

Viewing the source code for a webpage under Safari and changing the user agent

The Safari web browser from Apple doesn't by default provide a menu option that will allow you to view the underlying HTML code on a web page. But the browser does provide that capability, you merely need to enable the "Show Develop menu in menu bar" option.

Safari does provide a capability to change the user agent string it sends to websites, which sites use to identify the browser a visitor is using. Some sites may even limit access to material on the site to specific browsers. By changing the user agent the browser reports, you may be able to still view the content in such cases.

[ More Info ]

[/network/web/browser/safari] permanent link

Thu, Sep 03, 2015 9:41 pm

Resetting the password for the PRTG Network Monitor on Microsoft Windows

After you've installed the PRTG network monitoring software on a Microsoft Windows system, which provides Simple Network Management Protocol (SNMP) monitoring capabilities, when you log into the web interface for the first time, the login name and password for the default administrator login are both prtgadmin. You can leave the login name and password fields empty and click on the Default Login button to log in using these default credentials.

If you changed the password, but have forgotten the password, you can reset it by running the PRTG Administration Tool. Once you've opened the application, click on the Administrator tab then type a new password in the Password field and retype the password in the Confirm Password field. If you've also forgotten the login name you used, you will see it on that window.

PRTG Admin Tool

When you click on Save & Close, you will see the following message:

In order to activate the settings the following will be done by the PRTG Administration Tool:
- Stop and start the PRTG core server service.

The PRTG Administration Tool will close automatically afterwards.

OK to proceed?

If you are accessing the web interfce through a browser and provide the login credentials but don't see any message indicating that they are incorrect, but just see the page for entering the userid and password again, then you may need to enable cookies in the browser; I had to enable cookies in the K-Meleon browser to get past the login screen.

If you changed the port for the web interface, you can find it listed under the Web Server tab.

Note: these instructions apply to PRTG Administration Tool version V15.3.17.2995 and might not apply to other versions.

[/os/windows/software/network/snmp/prtg] permanent link

Wed, Sep 02, 2015 10:40 pm

Updating a MySQL table entry with a space in the table name

If you need to update the value for a column in a MySQL or MariaDB table, two relational database management systems named after the daughters, My and Maria, of the lead developer for the projects, Michael Widenius, where there is a space in the column name, use the backtick , aka, bakckquote, character, i.e., `, to enclose the name of the column. E.g., to update an entry in a table named "Sales" in a database named "packages", if the field was named "Work Phone", I could use the following:
MariaDB [(none)]> use personnel;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [personnel]> UPDATE Sales SET `Work Phone` = '555.555.5555' WHERE LName = 'Smith'; 
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [personnel]>

You can also use the command below to update the entry without first selecting the database with the Use command.

UPDATE `personnel.`Sales` SET `Work Phone` = '555.555.5555' WHERE `Sales`.`LName` = 'Smith';

References:

  1. MySQL UPDATE QUERY
    tutorialspoint - Simply easy learning

[/software/database/mysql] permanent link

Mon, Aug 31, 2015 10:28 pm

Viewing information about MySQL and MariaDB databases and tables

MySQL and MariaDB, which is a fork of MySQL are relational database management systems that share a common command syntax. For both, you can see available databases with the command show databases.
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| ann                |
| crystal            |
| grover             |
| horticulture       |
| justiceleague      |
| maker              |
| mars               |
| moon               |
| orwell             |
+--------------------+
10 rows in set (0.09 sec)

MariaDB [(none)]>

You can see the tables within a particular database by selecing the database with use dbname, where dbname is the name of the database, and then using show tables;.

MariaDB [(none)]> use crystal
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [crystal]> show tables;
+---------------------------+
| Tables_in_crystaltokyo    |
+---------------------------+
| smf_admin_info_files      |
| smf_approval_queue        |
| smf_attachments           |
| smf_ban_groups            |
| smf_ban_items             |
| smf_board_permissions     |
| smf_boards                |
| smf_buddies               |
| smf_calendar              |
| smf_calendar_holidays     |
| smf_categories            |
| smf_collapsed_categories  |
| smf_custom_fields         |
| smf_gallery_cat           |
| smf_gallery_comment       |
| smf_gallery_pic           |
| smf_gallery_report        |
| smf_group_moderators      |
| smf_hcb_reminders         |
| smf_links                 |
| smf_links_bans            |
| smf_links_categories      |
| smf_links_comments        |
| smf_log_actions           |
| smf_log_activity          |
| smf_log_banned            |
| smf_log_boards            |
| smf_log_comments          |
| smf_log_digest            |
| smf_log_errors            |
| smf_log_floodcontrol      |
| smf_log_group_requests    |
| smf_log_httpBL            |
| smf_log_karma             |
| smf_log_mark_read         |
| smf_log_member_notices    |
| smf_log_notify            |
| smf_log_online            |
| smf_log_packages          |
| smf_log_polls             |
| smf_log_reported          |
| smf_log_reported_comments |
| smf_log_scheduled_tasks   |
| smf_log_search_messages   |
| smf_log_search_results    |
| smf_log_search_subjects   |
| smf_log_search_topics     |
| smf_log_spider_hits       |
| smf_log_spider_stats      |
| smf_log_subscribed        |
| smf_log_topics            |
| smf_mail_queue            |
| smf_membergroups          |
| smf_members               |
| smf_message_icons         |
| smf_messages              |
| smf_moderators            |
| smf_openid_assoc          |
| smf_package_servers       |
| smf_permission_profiles   |
| smf_permissions           |
| smf_personal_messages     |
| smf_picture_comments      |
| smf_pm_recipients         |
| smf_pm_rules              |
| smf_poll_choices          |
| smf_polls                 |
| smf_profile_albums        |
| smf_profile_comments      |
| smf_profile_pictures      |
| smf_scheduled_tasks       |
| smf_sessions              |
| smf_settings              |
| smf_smileys               |
| smf_spiders               |
| smf_subscriptions         |
| smf_tags                  |
| smf_tags_log              |
| smf_themes                |
| smf_topics                |
+---------------------------+
80 rows in set (0.00 sec)

MariaDB [crystal]>

You can view details on the columns in a particular table by using DESCRIBE tablename where tablename is the name of the table.

MariaDB [crystal]> DESCRIBE smf_smileys;
+--------------+----------------------+------+-----+---------+----------------+
| Field        | Type                 | Null | Key | Default | Extra          |
+--------------+----------------------+------+-----+---------+----------------+
| id_smiley    | smallint(5) unsigned | NO   | PRI | NULL    | auto_increment |
| code         | varchar(30)          | NO   |     |         |                |
| filename     | varchar(48)          | NO   |     |         |                |
| description  | varchar(80)          | NO   |     |         |                |
| smiley_row   | tinyint(4) unsigned  | NO   |     | 0       |                |
| smiley_order | smallint(5) unsigned | NO   |     | 0       |                |
| hidden       | tinyint(4) unsigned  | NO   |     | 0       |                |
+--------------+----------------------+------+-----+---------+----------------+
7 rows in set (0.05 sec)

MariaDB [crystaltokyo]>

You can also use EXPLAIN tablename, since EXPLAIN and DESCRIBE are synonyms, but the DESCRIBE keyword is more often used to view information about a table's structure, whereas EXPLAIN is more often used to obtain a query execution plan, i.e., an explanation of how MySQL would execute a query.

References:

  1. Showing all MySQL databases or all tables in a database
    Date: July 27, 2014
    MoonPoint Support
  2. MySQL :: MySQL 5.0 Reference Manual :: 13.8.2 EXPLAIN Syntax
    MySQL :: Developer Zone

[/software/database/mysql] permanent link

Sat, Aug 29, 2015 10:44 pm

Install MOD Stop Spammer v2.3.9 in other themes

The Stop Spammer mod can be used on a Simple Machines Forum (SMF) site in conjuction with the httpBL mod to deny spammers access to a forum. The package uses the Stop Forum Spam site's database of spammers, which tracks IP addreses, email addresses and usernames used by forum spammers.

To use the package, you need to obtain an API key from the Stop Forum Spam site; you will provide that key at the settings page for the mod once you have installed the package. You can view your keys at the Stop Forum Spam API Keys page.

When you install the package, you can choose to install it for some or all of the themes installed on the site. During the installation, the following three files will be installed in the images/icons/ directory for the themes that you choose during the Stop Spammer mod installation:

moreinfo.gif
spammer.gif
suspect.gif

E.g., if I chose to install the mod for the "Blue Moonlight" theme, the following would appear during the installation process:

Blue Moonlight
Extract File ./Themes/Blue_Moonlight_SMF2/images/icons/spammer.gif
Extract File ./Themes/Blue_Moonlight_SMF2/images/icons/suspect.gif
Extract File ./Themes/Blue_Moonlight_SMF2/images/icons/moreinfo.gif

You can get to the setings page for the package by putting index.php?action=admin;area=regcenter;sa=settings at the end of the URL for the forum.

[/network/web/forums/smf] permanent link

Thu, Aug 27, 2015 10:37 pm

httpBL Viewlog Error

Tonight I finally had time to locate and fix the cause of a viewlog error message I had been seeing when attempting to view the httBL logs for a Simple Machines Forum (SMF) site. The problem was caused by the httpBL.template.php file in the Themes/default directory being empty, i.e., a zero byte file. When I replaced it with the file by that name from the zip file I downloaded to use for the httpBL installation, the problem disappeared.

[ More Info ]

[/network/web/forums/smf] permanent link

Wed, Aug 26, 2015 10:07 pm

Safari - Certificate has an invalid issuer

When I put in the HTTPS URL for a website in Safari, I saw the message below:

Safari can't verify the identity of the website "example.com".

The certificate for this website is invalid. You might be connecting to a website that is pretending to be "example.com", which could put your confidential information at risk. Would you like to connect to the website anyway?

[ Show Certificate ] [ Cancel ] [ Continue ]

When I clicked on Show Certificate, I saw "This certificate has an invalid ussuer.

Since this was a trusted work site, I downloaded a .p7b file containing the issuer certificate. I then opened the Keychain Access app, which is in Applications/Utilities, then clicked on File, then Import Items, then selected the .p7b file I downloaded. I then no longer saw the certificate warning message in Safari. I didn't have to restart Safari to have it recognize the website's certifcate as valid.

A .p7b extension is used for X.509 certificates. X.509 is a public key infrastructure (PKI) standard which specifies standard formats for public key certificates, certificate revocation lists, authorization certifcates, and a certification path validation algorithm.

[/network/web/browser/safari] permanent link

Sun, Aug 23, 2015 9:31 pm

Problems encountered when installing httpBL

To combat forum spammers attempting to register on a Simple Machines Forum (SMF) site, I installed the httpBL package (also available from the SMF mods page on this site). The mod uses the http:BL API from Project Honey Pot to stop spammers from accesing your forum. Instructions for installing and using it are at Adding httpBL to Block Forum Spammers.

I encountered several problems while installing the package. The first one was when I attempted to install it for all themes on the site. I had installed 18 additional themes for the site. The install process indicated an issue with only one of the themes, the Excellent Love theme. An install test failed for that theme. When I investigated the cause of the problem I found it was due to a file in the theme having line endings appropriate for a text file on a Mac OS X system, but I was installing it on a Linux system. I resolved that problem by converting the line endings, i.e, the "newlines", in the file to the appropriate one for a Linux system as explained in Test failed for Excellent Love theme for httpBL install.

After resolving the problem with the theme, I encountered another problem installing the software. I saw a Database Error message stating that the log_httpBL table didn't exist for the forum, which took me a long time to track down and fix.

Then once I had the software installed and the mod's page indicated it was working ok, when I attempted to view the httpBL logs by going to the Administration Center then selecting Members, then MOD httpBL, and then selecting one of the logs, or from the MOD httBL page when I selected Spammers Log, Humans Log, or Errors Log, I saw the following error message:

An Error Has Occurred!
Unable to load the 'viewlog' template.

Checking for where the error mesage might be found, I saw the following:

$ grep -rwl "Unable to load" --include=*.php
Sources/Load.php
Themes/default/languages/index.english.php

The error message is coming from Themes/default/languages/index.english.php. In that file, I see the following:

$txt['theme_template_error'] = 'Unable to load the \'%1$s\' template.';

When I checked to see where theme_template_error occurred, I found the following:

$ grep -rwl "theme_template_error" --include=*.php
Sources/Load.php
Themes/default/languages/index.english.php

The Project Honey Pot site is unavailable at the moment. If I visit the website at www.prjecthoneypot.org, I see the following error message:

502 Bad Gateway
nginx/0.7.65

Since the httpBL mod logs contain information on IP addresses retrieved from the Project Honey Pot dabase, perhaps because the site is unavailable the logs can not be displayed at the moment.

Update: when the Project Honey Pot site became available again I still experienced the problem viewing the httpBL logs. I finally traced the cause of the problem to a zero byte httpBL.template.php file. Replacing that file fixed the problem.

[/network/web/forums/smf] permanent link

Sat, Aug 22, 2015 10:31 pm

Forum Spammers

After setting up a Simple Machines Forum (SMF) site, I found a spammer registered from a Ukrainian IP address before I even registered the administrator account for the forum. I changed the forum configuration so that new members must be approved by the administrator and then installed themes for the forum. When I had completed installing themes, I noticed an attempt to register on the forum by five other spammers.
IDusernameEmail AddressIP Address
5boersmaizc solanonicole120@gmail.com 193.201.224.158
6gjssknuaehdazusmm@gmail.com 46.151.52.63
7KennethFERM sepetriw@yandex.com 193.201.224.171
3vsrvrzune ybficpefo@gmail.com 46.151.52.35
4yadiragoldieu1a andarytsq@outlook.com 142.54.185.122

When I searched the Stop Forum Spam site, I didn't find the username boersmaizc listed, but I did find the email address listed with many entries from the IP address 193.201.224.158 listed. The IP address is assigned to OpaTelecom in Ukraine. There were many instances of the solarnicole email address being used by the spammer from the 193.201.224.158 address, but also instances of that email address being associated with IP addresses in Argentina (190.221.23.158), China (119.253.252.22, 112.20.190.20, 117.185.124.73, 115.28.39.12, 120.198.245.36, 117.177.243.43, and 122.89.138.111), Finland (109.70.176.1), France (212.129.21.28), Hong Kong (182.239.127.140), Kahzakhstan (82.200.245.107), Russia (78.25.98.250), Thailand (203.190.251.116), and the United States (209.66.200.64) - PDF. The IP address in France was marked as "Toxic IP address or "bad" email domain".

There was another Ukrainian IP address in the list, 193.201.224.171, in the same block of IP addresses, 193.201.224.0 - 193.201.227.255.

Another Ukrainian IP address on the list was 46.151.52.63. A search at the Réseaux IP Européens website revealed that IP address was assigned to PE Radashevsky Sergiy Oleksandrovich (ISP ReedLan). RIPE is the regional internet registry for Europe, Russia, the Middle East, and Central Asia. Another Ukrainian IP address, 46.151.52.35, from the same 46.151.48.0 - 46.151.55.255 block of addresses was in the list.

The remaining IP address was 142.54.185.122, which the American Registry for Internet Numbers (ARIN), a RIR, linked to Zhou Pizhong in North Kansas City, Missouri. A Stop Forum Spam search showed many entries for that IP address, which it associated with the United States, for August 22 with many prior entries as well.

All of the entries were awaiting membership approval; I deleted all of them. When I did so, I noticed another attempt to register from a Ukrainian IP address, 46.151.52.37. I deleted that one as well.

[/network/web/forums/smf] permanent link

Sat, Aug 22, 2015 12:37 pm

Ukrainian forum spammer at 46.151.52.64

I set up a Simple Machines Forum (SMF) forum today using SMF 2.0.10, the latest supported release of the software. When I logged into the forum immediately after setting it up there was already one spam posting, which was a long block of text with many spam links within it.

When I viewed the member information for the spammer, I saw the following:

Username:uwzedekzk
Website:http://www.true-religion.us.org/
ICQ: http://www.icq.com/whitepages/about_me.php?uin=510521626
MSN:http://members.msn.com/prtazkixe@gmail.com

In the spam posting, I found a link to the website from "true religion jeans outlet" along with a lot of other links.

When I checked the spammer's profile information, I saw the following:

Username:uwzedekzk
Posts:1 (N/A per day)
Email:jyhnjknmo@gmail.com
Gender:Male
Age:31
Location:Brazil

Date Registered:Today at 08:32:47 AM
IP:46.151.52.64
Hostname: 
Local Time:August 22, 2015, 09:44:49 AM
Last Active:Today at 08:32:52 AM

The signature the spammer had on his profile was "oakley glasses" which was a link to http://www.oakley-sunglass.us.org/. The registration time for the spammer was listed as 8:32:47 AM. When I checked the registration time for the administrator account I created when setting up the forum, it was 08:34:58 AM, so the spammer posted two minutes prior even to the registration of the administrator account.

The 2.1 version of SMF allows one to restrict registrations during the installation process to require admin approval, but that isn't part of the installation procedure for 2.0 versions. Instead, you need to log into the forum as an administrator after installing the software and change the registration option so that members can't register immediately. I did change the setting immediately after logging in as the administrator to Admin Approval by clicking on Admin, selecting Features and Options, then Members , then Registration, then Settings. The choices for registration are as follows:

With "Immediate Registration" as the default option when the forum software is installed, spammers can post spam if you don't act quickly to change the option. But even though I logged in as the administrator immediately after completing the installation and changed the option, I was still too late to prevent this particular spammer from posting spam.

On the profile page for the spammer, I selected Actions and then Ban this user. I then selected an expiration period of Never for a full ban for the spammer. For Triggers, I left "Ban on Email Address (e.g. *@badsite.com)" selected with the email address he used and also left "Ban on Username" selected with his username, uwzedekzk. I also selected "Ban on IP (e.g., 192.168.10-20.*)" selected for his IP address, which was 46.151.52.64. Then from his profile page, I again selected Actions and then chose "Delete this account".

When I performed a Stop Forum Spam site search, I didn't find the spammer's username nor email address listed, but I found a large number of entries for the IP address for August 22, 2015. The spammer used many usernames where the names were just random strings of characters and the email addresses likewise used random strings of characters, but all using "@gmail.com". The Stop Forum Spam Contry Check - Ukraine page currently shows "7775469 entries in our database from Ukraine (20.31 percent of total)", i.e., about 1/5 of forum spam is originating from Ukrainian spammers. The Spam sources by country page currently shows that their statistics for the last year show spam originating from Ukrainian IP address space in 51.7% of the spam reports (PDF).

Since the spammer uses random email addresses and usernames, I removed the email check from the SMF spammer check, leaving just the IP address check by selecting Members and then Ban list. The Stop Forum Spam site search reported "Found 1000 entries for "46.151.52.64". I saw a prior incident with a Ukraninian forum spammer r little over 5 years ago, in July of 2010, when a Ukrainian spammer manged to post spam to one of my wife's forums.

[/network/web/forums/smf] permanent link

Tue, Aug 18, 2015 9:38 pm

Counting number of cells with date before or equal to today

If you have a range of cells in an Excel worksheet that contain a date and you wish to obtain a count of the number of those cells that have a date that is prior to or equal to today, you could use the formula below, presuming the relevant cells containing the date are in the range E2:E810:

COUNTIF(E2:E810,"<="&TODAY())

The ampersand concatenates today's date after the <=. If you wanted a count for only those dates prior to today, but not including today, you could replace the <= with <.

If you need to count cells based on multiple criteria, you can use COUNTIFS. E.g., if for the above range of cells I want to count the number of cells that not only have a date prior to or equal to today, but only count the cells if there is some value in another cell in the row, i.e., if the date in column E is prior or equal to today and there is some value in column P in that row, i.e., column P is not blank, I can use the formula below:

=COUNTIFS(E2:E810,"<="&TODAY(), P2:P810, "<>"&"")

E.g., I need to track when an expiration date stored in column E for an item has passed, but I only want to count the entries when I've contacted the user associated with the item notifying him that he needs to renew the item. In column P in the worksheet, I store the date I contacted the user. If I haven't yet contacted the user, the cell is empty.

I also want to now how many expiration notices I sent today, so use the formula below for that number:

=COUNTIFS(E2:E810,"<="&TODAY(), P2:P810, "="&TODAY())

The formula checks the values in column E from E2 to E810 to determine if the date in those cells is less than or equal to today and, if so, whether today's date is in the corresponding cell in column P. If both criteria are met, then the count is incremented by 1.

References:

  1. Countif greater than or equal to a date
    Date: February 13, 2015
    MoonPoint Support
  2. Excel countifs function
    Date: March 14, 2014
    MoonPoint Support
  3. COUNTIF in Excel - count if not blank, greater than, duplicate or unique
    By: Svetlana Cheusheva
    AbleBits

[/os/windows/office/excel] permanent link

Sun, Aug 16, 2015 11:00 pm

Obtaining BIOS information in Microsoft Windows

If you need to obtain information regarding the BIOS in a system running a Microsoft Windows operating system (OS), you can do so from a command prompt using the wmic command. E.g. to obtain the BIOS version, you can use wmic bios get smbiosbiosversion. You can also use the wmic bios get biosversion command, which may also show the BIOS date, depending on the BIOS manufacturer. Other commands that you can run are systeminfo | find "BIOS" and msinfo32. The latter command will open a window showing BIOS information along with a plethora of other information.

[ More Info ]

[/os/windows/utilities/sysmgmt] permanent link

Sat, Aug 15, 2015 9:34 pm

Locating the database used for an SMF forum

You may occasionally need to know the name of the database used for Simple Machines Forum (SMF) installation, e.g., perhaps while troubleshooting a problem or if you need to modify an entry in a table or remove all of the tables for the forum with phpMyAdmin. To identify the database, in the directory where the forum files are stored, look for Settings.php . Look for the "Database Info" section in the file:

########## Database Info ##########
$db_type = 'mysql';
$db_server = 'localhost';
$db_name = 'jane_smf';
$db_user = 'jane';
$db_passwd = 'ASecretPwd';
$ssi_db_user = '';
$ssi_db_passwd = '';
$db_prefix = 'janeswebsite_';
$db_persist = 0;
$db_error_send = 0;

In the above example, I can see that the database name is jane_smf and that the userid for access to the database through MySQL or MariaDB is jane with a password of ASecretPwd. Within the jane_smf database, the tables for her forum begin with janeswebsite_. One database could be used for multiple forums with the tables for each beginning with a specific database prefix.

If you do need to remove all of the tables beginning with a specific prefix from a database, e.g., in the case where a database is used for multiple forums, you can use the instructions at Dropping tables with a similar prefix from a MySQL database to remove just those for a specific forum.

[/network/web/forums/smf] permanent link

Wed, Aug 12, 2015 11:00 pm

Changing the SSH listening port on OS X

Mac OS X systems have a /etc/sshd_config file for configuring SSH server settings just as one finds on Linux/Unix systems. On a Linux or Unix system, you can edit that file and change the Port line to change the listening port for the SSH daemon from the standard port of 22 to some other port. On Linux/Unix systems you will find the following line in the file:

#Port 22

To change the port on which the system listens for SSH connections from SSH clients, you merely remove the "#" from the beginning of the line, which signifies the line is a comment, and repace "22" with the new port you wish to use for SSH connections and then restart the SSH server service.

You can do the same on an Apple OS X system, but the change will have no effect on the port the SSH daemon will listen on, which you can verify using the netstat command, which will still show the system listening on the standard SSH port.

$ netstat -a | grep ssh
tcp4       0      0  *.ssh                  *.*                    LISTEN     
tcp6       0      0  *.ssh                  *.*                    LISTEN

To change the listening port on an OS X system, you must, instead, edit /System/Library/LaunchDaemons/ssh.plist. E.g., if you use the vi text editor, you can use the following command:

sudo vi /System/Library/LaunchDaemons/ssh.plist

In the file, you will see the following section:

<dict>
        <key>Listeners</key>
        <dict>
                <key>SockServiceName</key>
                <string>ssh</string>

Replace the ssh in the line <string>ssh</string> with the new port you wish to use, e.g., 50022. To prevent confusion later, it is probably best not to use a well-known port number, i.e., it is probably better to pick a port above 1,023. And you may also want to avoid using a registered port, since those are ports commonly used by a variety of applications. Registered ports are those from 1,024 to 49,151.

Once you've replaced "ssh" with a nonstandard port number in ssh.plist, you need to restart the SSH server service, which you can do with the following two commands:

sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist

You can then verify that the SSH service is listening on the new port with the netstat command. E.g., if you selected 50,022 for the new port, you could use the command below:

$ netstat -an | grep 50022
tcp6       0      0  *.50022                 *.*                    LISTEN
tcp4       0      0  *.50022                 *.*                    LISTEN

Note: you can't use the launchctl stop and launchctl start commands to stop and restart the SSH server service regardless of whether it is listening on a standard or nonstandard port. You won't see any error messages, but the commands will have no effect as you can check by issuing a netstat command after the stop command.

$ sudo launchctl stop com.openssh.sshd
$ netstat -a | grep ssh
tcp4       0      0  *.ssh                  *.*                    LISTEN     
tcp6       0      0  *.ssh                  *.*                    LISTEN     
$ sudo launchctl start com.openssh.sshd
$

[/os/os-x] permanent link

Sat, Aug 08, 2015 11:00 pm

Booting a Dell Dimension 2400 from a USB flash drive

To boot a Dell Dimension from a USB flash drive, for example a Clonezilla Live USB drive, connect the USB flash drive, power on the system, then hit F12 to get the boot menu when you see the Dell logo. From the boot device menu, select "USB Flash Device".
Boot Device Menu
================

  1. Normal
  2. Hard-Disk Drive C:
  3. IDE CD-ROM Device
  4. Diskette Drive
  5. USB Flash Device

  6. System Setup
  7. IDE Drive Diagnostics
  8. Boot to Utility Partition

Enter a choice: 1

You can configure the system to always attempt to boot from a USB device before the hard disk drive (HDD) by hitting F2 when you power on the system and the Dell logo appears to enter the BIOS setup. Under Hard-Disk Drive Sequence, you can put "USB Device" at the top of the list, if you wish by using the "+" or "-" keys to rearrange the order in which the BIOS will choose boot devices. You will need to put "USB Device" prior to "System BIOS boot devices" to have the system attempt to boot from a USB drive first. You can select "USB Device" and use the minus key to move it to be entry 1 in the list.

1. USB Device
2. System BIOS boot devices
3. Hard disk drive (not installed)

[/pc/hardware/dell] permanent link

Fri, Aug 07, 2015 7:21 pm

Obtaining hard disk drive and optical drive information on an Ubuntu system

On a Ubuntu Linux system, you can determine the hard disk drive (HDD) serial number, disk capacity, and manufacturer with the command sudo lshw -class disk:

$ sudo lshw -class disk
[sudo] password for jdoe: 
  *-disk                  
       description: ATA Disk
       product: QUANTUM FIREBALL
       vendor: Quantum
       physical id: 0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda
       version: A35.
       serial: 186021137091
       size: 27GiB (30GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=59915410
  *-cdrom
       description: SCSI CD-ROM
       physical id: 1
       bus info: scsi@1:0.0.0
       logical name: /dev/cdrom
       logical name: /dev/sr0
       capabilities: audio
       configuration: status=nodisc
$

You can obtain information on an optical drive, such as a CD-ROM or DVD drive using the dmesg command. Piping the output to egrep allows you to filter out extraneous data.

$ dmesg | egrep -i 'cdrom|dvd|cd/rw|writer'
[    1.183545] sr0: scsi3-mmc drive: 48x/48x cd/rw xa/form2 cdda tray
[    1.183556] cdrom: Uniform CD-ROM driver Revision: 3.20
$

From the above output, I can see the read and write speed for the CD/RW drive in the system is 48 speed.

You can also obtain the speed of the drive by examining the contents of /proc/sys/dev/cdrom/info.

$ cat /proc/sys/dev/cdrom/info
CD-ROM information, Id: cdrom.c 3.20 2003/12/17

drive name:		sr0
drive speed:		48
drive # of slots:	1
Can close tray:		1
Can open tray:		1
Can lock tray:		1
Can change speed:	1
Can select disk:	0
Can read multisession:	1
Can read MCN:		1
Reports media changed:	1
Can play audio:		1
Can write CD-R:		0
Can write CD-RW:	0
Can read DVD:		0
Can write DVD-R:	0
Can write DVD-RAM:	0
Can read MRW:		1
Can write MRW:		1
Can write RAM:		1


$

You can obtain the manufacturer and model number for a CD-ROM, CD/RW, or DVD drive using the cd-drive utility from the libcdio-utils package. If it isn't installed, you can install it on an Ubuntu system with sudo apt-get install libcdio-utils.

$ cd-drive
The program 'cd-drive' is currently not installed.  You can install it by typing:
sudo apt-get install libcdio-utils
$ sudo apt-get install libcdio-utils

Once you've installed the package, you can view vendor, model number, and other information for the drive, including functions the drive supports by issuing the command cd-drive.

$ cd-drive
cd-drive version 0.83 i686-pc-linux-gnu
Copyright (c) 2003, 2004, 2005, 2007, 2008, 2011 R. Bernstein
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
The driver selected is GNU/Linux
The default device for this driver is /dev/cdrom

Drivers available...
  GNU/Linux ioctl and MMC driver     
  cdrdao (TOC) disk image driver     
  bin/cuesheet disk image driver     
  Nero NRG disk image driver         

CD-ROM drive supports MMC 3

                       Drive: /dev/cdrom
Vendor                      : HL-DT-ST
Model                       : CD-ROM GCR-8483B
Revision                    : 1.05
Profile List Feature

Core Feature
	ATAPI interface

Morphing Feature
	Operational Change Request/Notification not supported
	Synchronous GET EVENT/STATUS NOTIFICATION supported

Removable Medium Feature
	Tray type loading mechanism
	can eject the medium or magazine via the normal START/STOP command
	can be locked into the Logical Unit

Random Readable Feature

CD Read Feature
	C2 Error pointers are not supported
	CD-Text is supported

Initiator- and Device-directed Power Management Feature

Ability to respond to all commands within a specific time Feature

Vendor-specific code ffde Feature

Hardware                                  : CD-ROM or DVD
Can eject                                 : Yes
Can close tray                            : Yes
Can disable manual eject                  : Yes
Can select juke-box disc                  : No

Can set drive speed                       : No
Can read multiple sessions (e.g. PhotoCD) : Yes
Can hard reset device                     : No

Reading....
  Can read Mode 2 Form 1                  : Yes
  Can read Mode 2 Form 2                  : Yes
  Can read (S)VCD (i.e. Mode 2 Form 1/2)  : Yes
  Can read C2 Errors                      : No
  Can read IRSC                           : Yes
  Can read Media Channel Number (or UPC)  : Yes
  Can play audio                          : Yes
  Can read CD-DA                          : Yes
  Can read CD-R                           : Yes
  Can read CD-RW                          : Yes
  Can read DVD-ROM                        : No

Writing....
  Can write CD-RW                         : No
  Can write DVD-R                         : No
  Can write DVD-RAM                       : No
  Can write DVD-RW                        : No
  Can write DVD+RW                        : No

$

In the above example, I can see the drive model number is GCR-8483B, so can look online for futher information that might be available from the manufacturer, if needed.

Note: all of the above examples were run on a Ubuntu 12.04 LTS system.

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

Sat, Aug 01, 2015 10:33 pm

Resetting the mouse in Ubuntu

I could no longer move the mouse pointer on an eMachines netbook system running Ubuntu 12.04. I could use Alt-Tab to move between open windows, but could not move the mouse pointer using the touchpad. Using the instructions at Restarting your touchpad/mouse in Ubuntu in simple steps, I used the Alt-F2 key combination to obtain a "run a command" field. I tried gksudo modprobe -r psmouse then hit Alt-F2 again and entered gksudo modprobe psmouse but found no difference. I already had a terminal window open, so I switched to it with Alt-Tab, though you can open one by hitting Alt-F2 and entering gnome-terminal . I entered the command sudo modprobe -r psmouse there and provided my password when prompted. The screen then went black for a moment and I appeared to have been logged off. I provided the login password for my account, hit Alt-F2, typed gnome-terminal, then typed sudo modprobe psmouse. That restored mouse movement using the touchpad, though I did see the message "System program problem detected Do you want to report the problem now?" I chose to report the problem. That led to another window opening with the message "Sorry, Ubuntu 12.04 has experienced an internal error. If you notice further problems, try restarting the computer." When I chose to look at details, I saw the following:

Executable Path
  /usr/bin/Xorg
Package
  xserver-xorg-core 2:1:.11.4-0ubuntu10.13
Problem Type
  Xorg crashed with SIGABRT in raise()
.tmp.uity.support.test.0

A crash report for the incident was placed in /var/crash.

At that point after submitting the report, I decided to reboot.

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

Sat, Jul 25, 2015 10:49 pm

Compiling Apache from source files on a CentOS 7 system

I needed to build Apache from an SRPM file, since I needed to change options for suexec and recompile it. I downloaded the httpd source code, i.e., the "source RPM", httpd-2.4.6-19.el7.centos.src.rpm, from the CentOS Mirror site. But when I attempted to rebuild Apache, I encountered the error message "configure: error: APR not found. Please read the documentation." When I got past that error message I saw the error message "configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/". I was able to get past those issues, but the process of recompiling suexec wasn't as quick as I had hoped it would be.

[ More Info ]

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

Fri, Jul 24, 2015 10:06 pm

Using diskutil to obtain disk drive info on OS X

To obtain information on the disk drives attached to a Mac OS X system, including the Self-Monitoring, Analysis and Reporting Technology (S.M.A.R.T), aka SMART, status of drives. you can use the diskutil list command, which will show all of the disk drives attached to the system.

Pams-Computer:~ pam$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *250.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            249.7 GB   disk0s2
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *8.0 GB     disk1
   1:                 DOS_FAT_32 SI_IMPRESS              8.0 GB     disk1s1
Pams-Computer:~ pam$

[ More Info ]

[/os/os-x] permanent link

Wed, Jul 22, 2015 6:20 pm

Bopup Scanner

If you need to determine which IP address on your LAN are in use and the media access control (MAC) address associated with them, Bopup Scanner from B Labs is a handy free utility that will quickly scan a range of IP addresses and provide the MAC addresses for the systems within the specified IP address range. It can also tell you if any of the systems are functioning as web servers listening on TCP ports 80 or 8080.

[ More Info ]

[/network/tools/scanning/bopupscanner] permanent link

Sun, Jul 19, 2015 9:57 pm

Configuring a Custom Service from the CLI on a NetScreen Firewall

If you need to configure a custom service from the command line interface (CLI) you obtain by a Secure Shell (SSH) connection to a Juniper NetScreen Firewall running ScreenOS, you can use the set service command. E.g., to create a custom service for an SSH server listening on a non-standard port for SSH, you could use something like the following, if the server is listening on port 2005:

set service "Auburn SSH" protocol tcp src-port 1024-65535 dst-port 2005-2005

The text in quotation marks immediately after set service is just a descriptive name you can give to the service to make the purpose of the custom service more immediately identifiable.

If you have not yet created an address book entry for the system running the custom service, you can use the set address command to create it.

[ More Info ]

[/security/firewalls/netscreen] permanent link

Fri, Jul 17, 2015 10:52 pm

Managing database access with MariaDB or MySQL

Database access for MariaDB or MySQL database users can be controlled through the GRANT, REVOKE and DROP commands. You can see a list of the users with the select user from mysql.user; command. If you add host to that command, e.g., SELECT user, host from mysql.user;, you can also see the hosts/IP addresses from which users are allowed to connect to databases.

[ More Info ]

[/software/database/mysql] permanent link

Thu, Jul 16, 2015 11:19 pm

Speed of spinning disk drives

A hard disk drive in a computer today will normally be a 3.5 inch or 2.5 inch drive, which is the size of the platters on which data is stored inside drives. Read/write heads move over the spinning platters to read and record data. Laptops will have a 2.5" drive and desktop systems will likely have a 3.5" drive, though may have a 2.5" drive. Before these sizes became common, there were 5.25" drives when Parallel ATA (PATA) drives were used. Seagate released the first 5.25" drive in 1980 and Rodime released the first 3.5" hard drive in 19831. Before 5.25" inch drives were used in desktop systems there were 8" drives. You can find some of the history of hard drive development in the Wikipedia article History of hard disk drives and the PCWorld article by Rex Farrance, Timeline: 50 Years of Hard Drives.

Hard disk drives have spinning platters within them, much as an old record player will spin a record, though the platter in a HDD spins much faster. Today you may find drives that spin at 5,200 revolutions per minute (RPM) or 7,200 revolutions per minute (RPM). What does that equate to in miles per hour (MPH)?

If a platter in the HDD is 3.5" in diameter then the radius is 1/2 that number, i.e. 1.75". A platter in a 2.5" drive has a radius of 1.25". The circumference of a circle is 2πr, i.e., 2 times the radius times the mathematical constant pi, which is approximately 3.14159265. So for a point on the outer edge of a 3.5" drive's platter that is spinning at 7200 RPM where a point on the outer edge of the platter travels 2 * π * r inches per revolution, the speed in MPH is approximately 75 MPH:

2 * 3.14 * 1.75 in/rev * 7200 rev/min * 60 minutes/hour / 12 inch/foot / 5280 foot/mile

For a 2" drive, the speed is approximately 53.5 MPH:

2 * 3.14 * 1.25 * 7200 * 60 / 12 / 5280

In kilometers per hour, those numbers equate to 120.7 kph for the 3.5" disk drive and and 86 kph for the 2.5" drive.

If a drive is spinning at the slower 5400 RPM, then the speed in MPH for a 3.5" drive is approximately 28 MPH (45 kph):

3.14 * 1.75 * 5400 * 60 / 12 / 5280 ≈ 28

For a 2.5" drive it is approximately 20 MPH (32 kph):

3.14 * 1.25 * 5400 * 60 / 12 / 5280 ≈ 20

References:

  1. Timeline: 50 Years of Hard Drives
    By: Rex Farrance
    PCWorld
  2. History of hard disk drives
    Wikipedia, The Free Encyclopedia

[/info/pc/hdd] permanent link

Tue, Jul 14, 2015 10:40 pm

Screencapture command on Os X

You can take a screen shot from a command line interface (CLI) on a Mac OS X system by using the screencapture command. The screen capture program is located in /usr/sbin. You can see the available options by using screencapture -h; the -h option isn't a valid option for the application, but it will cause the app to print the options it does accept.

$ which screencapture
/usr/sbin/screencapture
$ screencapture -h
screencapture: illegal option -- h
usage: screencapture [-icMPmwsWxSCUtoa] [files]
  -c         force screen capture to go to the clipboard
  -C         capture the cursor as well as the screen. only in non-interactive modes
  -d         display errors to the user graphically
  -i         capture screen interactively, by selection or window
               control key - causes screen shot to go to clipboard
               space key   - toggle between mouse selection and
                             window selection modes
               escape key  - cancels interactive screen shot
  -m         only capture the main monitor, undefined if -i is set
  -M         screen capture output will go to a new Mail message
  -o         in window capture mode, do not capture the shadow of the window
  -P         screen capture output will open in Preview
  -s         only allow mouse selection mode
  -S         in window capture mode, capture the screen not the window
  -t<format> image format to create, default is png (other options include pdf, jpg, tiff and other formats)
  -T<seconds> Take the picture after a delay of <seconds>, default is 5
  -w         only allow window selection mode
  -W         start interaction in window selection mode
  -x         do not play sounds
  -a         do not include windows attached to selected windows
  -r         do not add dpi meta data to image
  -l<windowid> capture this windowsid
  -R<x,y,w,h> capture screen rect
  files   where to save the screen capture, 1 file per screen
$

By default, a screenshot will be stored in PNG format, but you can select other formats with the -t (lowercase "t") option. You can specify that you want to use PDF, JPG, or TIFF, instead. You can use the -T (uppercase "T") option to specify a delay in seconds between the time the command is issued and the time the screen shot is taken, which gives you the opportunity to switch to another window to have a screenshot taken of it. The advantage of screenshot over the GUI Preview program found in the Applications folder for taking a picture of a window is that with Preview sometimes pulldown menus will disappear from a window when you switch to Preview to take a screen shot. With screencapture, you can issue the command with a delay, the default is 5 seconds, switch to the relevant window, select the menu or other option, and then wait the number of seconds specified for screencapture to capture the contents appearing in that window at that time. E.g., the command below will wait 10 seconds to take a snapshot of what is appearing on a window that is the current one when 10 seconds elapses.

$ screencapture -T 10 grayed.png
libpng warning: zero length keyword
libpng warning: Empty language field in iTXt chunk
$

You won't see any indication that the screen capture occurred, so you need to just wait until the specified time has elapsed before looking for the output file, which will be placed in the current directory from which you issued the command if you didn't specify a path, but only the file name. The "libpng warnings" don't indicate that the screen shot couldn't be taken; the output file specified is a valild PNG file.

[/os/os-x] permanent link

Mon, Jul 13, 2015 10:49 pm

ChromeCacheView - Cache viewer for Google Chrome Web browser

I recently overwrote a file with notes about a problem I had to deal with that was residing on a web server by moving another file over top of it accidentally. I was in a hurry to complete my notes so I could go to bed; I thought about waiting until the morning to complete the notes, but thoughit I could complete them in just a few more minutes, but when I used !:1 as a shorthand in a mv command, I didn't realize that the second item on the last command line entry was the filename for the file with my notes. I didn't realize what I had done until I tried to view the web page with my notes from the PC I was using at the time for the SSH connection to the web server.

Since I had viewed the notes in the Google Chrome browser on the Microsoft Windows-based system I was on shortly before I overwrote them, I thought I might be able to find a copy of the notes in the browser's cache. But since I didn't grasp what I had done until I refreshed the page in the browser, it was now too late to get the data from the Chrome cache, since the cached page now just showed the "404 file not found" message due to the file no longer existing on the web server. So I thought there still might be a slim chance that I could recover the notes web page from a Volume Shadow Copy, i.e., a prior version of the file stored on the Windows system. I thought, if I could identify the particular cache file used for that webpage, there might be a prior version of that file stored by the Volume Shadow Copy Service. I thought I could possibly use ChromeCacheView, which is a small, free program that will allow you to examine the Google Chrome web browser cache. With that program you can view a list of all cached web pages and view the cached copies of those pages stored on the system. I was able to identify the particular file in the C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Cache directory that held that particular cached webpage. The file was data_4, but unfortunately, I wasn't able to find a prior version of the file. Though if you need to examine the Chrome cache on a Microsoft Windows system, ChromeCacheView is a very useful tool well-suited to that purpose. You can also put chrome://cache in the Chrome addres bar to see a list of URLs of cached pages, but ChromeCacheView provides many more capabilities for operations on that list of cached items.

[/network/web/browser/chrome] permanent link

Sun, Jul 12, 2015 9:04 pm

Resetting the admin password for an SMF Forum

I needed to reset a forgotten administrator password for a Simple Machines Forum (SMF) forum running SMF 2.0.10 today. To do so, since phpMyAdmin was installed on the server hosting the forum, I used phpMyAdmin to access the database for the forum and then found the entry in the _members table for the administrator account. I saw the following fields for the password (actual values not shown):
ColumnTypeFunctionNullValue
passwordvarchar(64)   d2d0b6f8f5e59d26550054b2f08bc7ceb514992b
password_saltvarchar(255)   f284

I replaced the value in the password field with a new password and deleted the contents of the password_salt field and then clicked on the Go button to update the record in the table for the administrator account.

After I logged into the forum with the administrator account, I checked the record in the table in the database for the forum again and found that there was a new value in the passwd_salt field and the entry in the password field was re-encrypted and was now a long sequence of digits and characters again rather than the plain text password I entered

A password salt is "random data that is used as an additional input to a one-way function that hashes a password or passphrase. The primary function of salts is to defend against dictionary attacks versus a list of password hashes and against pre-computed rainbow table attacks." By not storing a password in a database in plain text, even if someone gains unauthorized access to the database, even if they can then view passwords stored in the database, they can't see the actual password used for the account associated with the password. If the password was simply stored in an encrypted form, if the attacker who gained access to the database had access to a "rainbow table", i.e., a table that matched the plain text version of a password with its encrypted form, he could deduce the orginal password. But by using a random "salt" value as part of the encrypted password generation, a rainbow table won't help the attacker, since even if Sam and Sally both use the same password and the same encryption function is used to generate the stored password for both of them, because the random salt value is used as part of the process to obtain the encrypted version of the password, the value stored in the password for Sally wil not match that for Sam. So an attacker can't look up an encrypted entry in a rainbow table and find a match for the unencrypted password used to create the encrypted version and won't even know that Sam and Sally have the same password. This helps protect Sam and Sally, even if all of their data on the site where the database is stored is compromised, since the malefactor doesn't get a password for them that they might have used on other sites as well.

References:

  1. I accidentally lost my admin account! What can I do? - Online Manual
    SMF Online Manual

[/network/web/forums/smf] permanent link

Sat, Jul 11, 2015 10:58 pm

Restoring home and start pages in Chrome after installing Yahoo Messenger

After my wife installed the Yahoo Messenger Suite so that she could chat with a friend using it, on opening the Google Chrome browser, the Yahoo Search - Web Search page would appear. She didn't want that; she wanted to have google.com as her home page and to have a tab open to that when she started the browser as had occurred prior the the installation of the Yahoo Messenger software. She said she had chosen not to install the Yahoo toolbar and not to have it make such changes when she installed the software, so was irked to find her home page was "hijacked" to be a Yahoo search page. I found that I need to change both her home page and the start page for Chrome to put her settings back to what they had been prior to the installtion of the software.

[ More Info ]

[/network/web/browser/chrome] permanent link

Fri, Jul 10, 2015 11:12 pm

Recovery of Corrupted QuickBooks File

I received a call today from someone who reported that she had started compressing a QuickBooks file, since she wanted to upload the data to Intuit's site (QuickBooks 2013 provides a "condense" function that is accessible from the File menu by choosing Utilities then Condense data), but during the process of removing old entries from many years ago the company owner needed her to do some work in QuickBooks so she terminated the compression operation. As soon as she told me that I suspected she was calling because by doing so the company file had been corrupted. That seemed to be the case, because she said she could no longer find any entries in the file for this year besides those for today. She thought that the QuickBooks data was being backed up to an external, USB-attached disk drive on her system, but when I checked its contents I found that the last backup to that drive had occurred a couple of years ago.

Fortunately the data was stored on a Microsoft Windows system running a version of Windows that uses Microsoft's Volume Snapshot Service , which allows you to simply right-click on a file or folder name, choose Properties and then click on the Previous Versions tab and select from shadow copies of the file or folder that were made previously, though in this case I didn't even need to do that.

[ More Info ]

[/financial] permanent link

Fri, Jul 10, 2015 12:29 pm

Using wmic to get disk drive information

If you want to obtain information on the internal and external drives attached to a Microsoft windows system from a command line prompt, you can use the wmic command. To view just the model number for drives, you can use wmic diskdrive get model.
c:\>wmic diskdrive get Model
Model
ST31000528AS
ST6000DX000-1H217Z
Generic- Multi-Card USB Device
WD My Book 1230 USB Device


c:\>

You can also use wmic diskdrive get Name, Manufacturer, Model to get the name of the drive in the system and manufacturer, though for the manufacturer you may just see (Standard disk drives). Though, if you have a model number, such as ST31000528AS, you can often deduce the manufacturer without even doing an online search on the model number. E.g., Seagate starts model numbers with "ST", so I know that the ST31000528AS and ST6000DX000-1H217Z are Seagate drives. And I know the "WD" in "WD My Book 1230 USB Device" means the drive is a Western Digital external disk drive.

You can also obtain the capacity of each drive in bytes by using the size parameter.

c:\>wmic diskdrive get model, size
Model                           Size
ST31000528AS                    1000202273280
ST6000DX000-1H217Z              6001172513280
Generic- Multi-Card USB Device
WD My Book 1230 USB Device      4000710389760


c:\>

So the ST31000528AS drive is 4000710389760 byte / 1,000 byte/kilobyte / 1,000 kilobyte/megabyte / 1,000 megabyte/gigabyte / 1,000 gigabyte/terrabyte = 4 TB using the 1,000 number used by manufacturers rather than the 1,024 byte/kilobyte, etc. number often used in computing. E.g., see the Wikipedia article on Gigabyte.

If you want to see the list of other drive parameters you can check, use wmic diskdrive get /?.

c:\>wmic diskdrive get /?

Property get operations.
USAGE:

GET [<property list>] [<get switches>]
NOTE: <property list> ::= <property name> | <property name>,  <property list>

The following properties are available:
Property                                Type                    Operation
========                                ====                    =========
Availability                            N/A                     N/A
BytesPerSector                          N/A                     N/A
Capabilities                            N/A                     N/A
CapabilityDescriptions                  N/A                     N/A
CompressionMethod                       N/A                     N/A
ConfigManagerErrorCode                  N/A                     N/A
ConfigManagerUserConfig                 N/A                     N/A
DefaultBlockSize                        N/A                     N/A
Description                             N/A                     N/A
DeviceID                                N/A                     N/A
ErrorCleared                            N/A                     N/A
ErrorDescription                        N/A                     N/A
ErrorMethodology                        N/A                     N/A
Index                                   N/A                     N/A
InstallDate                             N/A                     N/A
InterfaceType                           N/A                     N/A
LastErrorCode                           N/A                     N/A
Manufacturer                            N/A                     N/A
MaxBlockSize                            N/A                     N/A
MaxMediaSize                            N/A                     N/A
MediaLoaded                             N/A                     N/A
MediaType                               N/A                     N/A
MinBlockSize                            N/A                     N/A
Model                                   N/A                     N/A
Name                                    N/A                     N/A
NeedsCleaning                           N/A                     N/A
NumberOfMediaSupported                  N/A                     N/A
PNPDeviceID                             N/A                     N/A
Partitions                              N/A                     N/A
PowerManagementCapabilities             N/A                     N/A
PowerManagementSupported                N/A                     N/A
SCSIBus                                 N/A                     N/A
SCSILogicalUnit                         N/A                     N/A
SCSIPort                                N/A                     N/A
SCSITargetId                            N/A                     N/A
SectorsPerTrack                         N/A                     N/A
Signature                               N/A                     N/A
Size                                    N/A                     N/A
Status                                  N/A                     N/A
StatusInfo                              N/A                     N/A
SystemName                              N/A                     N/A
TotalCylinders                          N/A                     N/A
TotalHeads                              N/A                     N/A
TotalSectors                            N/A                     N/A
TotalTracks                             N/A                     N/A
TracksPerCylinder                       N/A                     N/A

The following GET switches are available:

/VALUE                       - Return value.
/ALL(default)                - Return the data and metadata for the attribute.
/TRANSLATE:<table name>      - Translate output via values from <table name>.
/EVERY:<interval> [/REPEAT:<repeat count>] - Returns value every (X interval) se
conds, If /REPEAT specified the command is executed <repeat count> times.
/FORMAT:<format specifier>   - Keyword/XSL filename to process the XML results.

NOTE: Order of /TRANSLATE and /FORMAT switches influences the appearance of outp
ut.
Case1: If /TRANSLATE precedes /FORMAT, then translation of results will be follo
wed by formatting.
Case2: If /TRANSLATE succeeds /FORMAT, then translation of the formatted results
 will be done.

[/os/windows/commands/wmic] permanent link

Fri, Jul 10, 2015 12:23 pm

Windows Versions System Requirements

The hardware requirements Microsoft lists for various versions of its operating systems has remained the same for processor speed and memory from Windows Vista through Windows 7, 8, and 8.1. Microsoft recommends a 1 GHz or faster Central Processing Unit (CPU) and 1 gigabyte (GB) of system memory. And from Windows 7 through Windows 8.1 the amount of available hard drive space recommended has been 16 GB available hard disk space for the 32-bit version or or 20 GB for the 64-bit version.

[ More Info ]

[/os/windows] permanent link

Wed, Jul 08, 2015 11:39 pm

Plaintext authentication disallowed on non-secure (SSL/TLS) connections

Someone reported to me recently that she could no longer check her email. She was using Outlook and kept getting prompted to provide the password, but when she provided it Outlook wasn't able to check her incoming email and she would be prompted for the password again.

She told me the password she was using, so I established a telnet connection to port 110, the Post Office Protocol version 3 (POP3) port from another system using PuTTY and entered her userid and password. The email server, which uses Dovecot to provide IMAP and POP3 service, acknowledged that was the correct password.

+OK [XCLIENT] Dovecot ready.
user nell
-ERR Unknown command.
user nell
+OK
pass Rugs1234
+OK Logged in.
stat
+OK 52 483564
quit

If you connect to port 110, the pop3 port, you can enter a user command to provide the userid (I don't know why dovecot always responded to the first submission of that command with -ERR Unknown command, when I used PuTTY to connect, but then accepted it on the second submission) and then a pass command followed by the password. You can then issue a stat or uidl command to check on the number of messages in the inbox and their size. For the stat command, the first number in the response is the number of messages and the second number is their size in bytes. The uidl command shows the unique message id for each message. You can end the session with the quit command.

Since the password seemed to be correct, I had her try again to download her email while I observed what was happening with tcpdump on the mail server by issing the command tcpdump -i enp1s4 'port 110' -A from the root account. I used i enp1s4, because enp1s4 is the network interface on that particular system. The -A at the end instructs tcpdump to print each packet (minus its link level header) in ASCII.

What I observed was her system sending the USER command and her userid. But then Outlook on her system would send the AUTH command and the server would reply ".-ERR [AUTH] Plaintext authentication disallowed on non-secure (SSL/TLS) connections"

10:29:34.219018 IP 10-45-1-012-dhcp.gsv.md.example.com.50990 > 

localhost.localdomain.pop3: Flags [P.], seq 8:19, ack 29, win 16418, length 11
E..3!.@.{...H-.H.......n.....(."P.@"....USER nell

10:29:34.219182 IP localhost.localdomain.pop3 > 10-45-1-012- 
dhcp.gsv.md.example.com.50990: Flags [P.], seq 29:115, ack 19, win 115, length 86
...-ERR [AUTH] Plaintext authentication disallowed on non-secure (SSL/TLS) connections.

The AUTH command indicates an authentication mechanism to the server as noted in Request for Comments (RFC) 1734 POP3 AUTHentication command. RFCs are the mechanism for defining Internet standards.

When I observed what was happening with the same tcpdump command when I connected to the server from another system on its LAN by a telnet connection to port 110, I saw the following:

# tcpdump -i enp1s4 'port 110' -A

10:27:30.475105 IP 192.168.0.6.63448 > localhost.localdomain.pop3: Flags [P.], seq 67:76, 

ack 120, win 256, length 9
E..1.1@...r;...........n......Q.P.......user nell
10:27:30.475211 IP 192.168.0.6.63448 > localhost.localdomain.pop3: Flags [P.], seq 76:78, 

ack 120, win 256, length 2
E..*.2@...rA...........n......Q.P...n...
....
10:27:30.475264 IP localhost.localdomain.pop3 > 192.168.0.6.63448: Flags [.], ack 78, win 

115, length 0
E..(g.@.@.N..........n....Q.....P..s.u..
10:27:30.475319 IP localhost.localdomain.pop3 > 192.168.0.6.63448: Flags [P.], seq 

120:125, ack 78, win 115, length 5
E..-g.@.@.N..........n....Q.....P..s.z..+OK

10:27:30.534264 IP 192.168.0.6.63448 > localhost.localdomain.pop3: Flags [.], ack 125, win 

256, length 0
E..(.6@...r?...........n......Q.P...{.........
10:27:36.602821 IP 192.168.0.6.63448 > localhost.localdomain.pop3: Flags [P.], seq 78:91, 

ack 125, win 256, length 13
E..5.E@...r#...........n......Q.P.../...pass Rugs1234
10:27:36.602938 IP 192.168.0.6.63448 > localhost.localdomain.pop3: Flags [P.], seq 91:93, 

ack 125, win 256, length 2
E..*.F@...r-...........n......Q.P...n...
....
10:27:36.603007 IP localhost.localdomain.pop3 > 192.168.0.6.63448: Flags [.], ack 93, win 

115, length 0
E..(g.@.@.N..........n....Q.....P..s.u..
10:27:36.735972 IP localhost.localdomain.pop3 > 192.168.0.6.63448: Flags [P.], seq 

125:141, ack 93, win 115, length 16
E..8g.@.@.N..........n....Q.....P..s....+OK Logged in.

I.e., the server was accepting a plaintext password, though it wasn't accepting one from her system. When I entered the AUTH command from the telnet session to port 110, it was accepted without that error message.

+OK [XCLIENT] Dovecot ready.
user nell
-ERR Unknown command.
user nell
+OK
AUTH
+OK
PLAIN
.
pass Rugs1234
+OK Logged in.

I then remembered that she had told me her ISP replaced her network equipment recently. She has an IP that remains constant unless the router is replaced at her end in which case the new device has a different media access control (MAC) address and will be assigned a different IP address.

I put the new IP address in the /etc/mail/access file, so that sendmail would allow relaying from that IP address without any authentication. I.e., I added a line with her IP address followed by RELAY.

10.45.1.12                              RELAY

I then ran the makemap hash command to generate a new /etc/mail/access.db file.

# makemap hash /etc/mail/access </etc/mail/access

But that only allowed her to send email via sendmail without authentication. I also had to update dovecot's configuration file at /etc/dovecot/dovecot.conf and change the IP address there for her system so that she could use plaintext authentication, i.e., an unencrypted password (I need to go to her location and change the Outlook configuration there to use other than plaintext authentication). I didn't recall that change was needed until finding a note I had made previously regarding dovecot's logon_trusted_networks setting.

The relevant section of the dovecot.conf file is shown below for cases where plaintext authentication is being allowed.

# Space separated list of trusted network ranges. Connections from these
# IPs are allowed to override their IP addresses and ports (for logging and
# for authentication checks). disable_plaintext_auth is also ignored for
# these networks. Typically you'd specify your IMAP proxy servers here.
login_trusted_networks = 192.168.0.0/24 192.168.7.0/24 10.45.1.12

In this case dovecot was configured to allow plaintext logins from two 192.68 subnets and her specific IP address. But since her IP address had changed to a new one, dovecot was no longer permitting plaintext authentication from her system. After changing the login_trusted_networks line to match her particular IP address, I restarted dovecot.

# service dovecot restart
Redirecting to /bin/systemctl restart  dovecot.service

When I had her try again, she was then able to download her email.

Note: IP addresses, userid, and password are, of course, not the actual ones used.

[/network/email/dovecot] permanent link

Tue, Jul 07, 2015 11:33 pm

Setting up Time Machine and backing up an OS X system

Mac OS X systems come with a backup program named Time Machine, which can be found in the Applications folder. If you attach an external drive to the system and configure Time Machine to use it, the program will backup the system automatically and maintain the following backups:

The app will delete the oldest backups when the backup drive becomes full.

[ More Info ]

[/os/os-x/Time_Machine] permanent link

Mon, Jul 06, 2015 10:53 pm

Juniper NetScreen SNMP Information

Juniper NetScreen Firewalls running the ScreenOS operating system, including older models, such as a Netscreen-5GT firewall, can be configured for Simple Network Management Protocol (SNMP) support to monitor bandwidth utilization, etc. SNMP information can be viewed or configured through the web-based interface or via the command line interface (CLI) using get snmp, set snmp and unset snmp commands.

[ More Info ]

[/security/firewalls/netscreen] permanent link

Sun, Jul 05, 2015 9:55 pm

Testing access to a website using PuTTY

Microsoft doesn't provide a telnet program with its current operating systems by default, but a commonly used program for telnet and SSH on Microsoft Windows systems is PuTTY which is free. A telnet client is provided with many Linux distributions and one is available with Apple's OS X operating system. PuTTY is also available for Unix/Linux systems. E.g., see How To Install & use Putty in Ubuntu Linux written by Pradeep Kumar on July 13, 2014.

With a telnet program you can send commands/headers to a web server to emulate those that a browser would send to a web server and observe the responses from the server. This can be useful in some troubleshooting efforts. E.g, see Testing acces to a website using PuTTY for how to configure PuTTY on a Microsoft Windows system to perform a basic connectivity test to port 80 and request a web page for a particular site from the server.

[/network/web/server] permanent link

Sat, Jul 04, 2015 12:56 pm

Chrome Memory Usage under Windows

Oftentimes I've found that a web browser is responsible for high memory utilization or high CPU usage on a system. But determing what tab or tabs is culpable can be difficult. Fortunately, Google provides a mechanism for doing so within its Chrome browser. By putting chrome://memory in the address bar in a tab within the browser, you can get details on the total memory usage by all browsers open on the system and the memory consumed by tabs within Chrome.

[ More Info ]

[/network/web/browser/chrome] permanent link

Fri, Jul 03, 2015 7:53 pm

Partitioning and formatting a drive with Clonezilla

Clonezilla, which is a live CD based on Debian Linux, provides the capability to clone one disk drive to another. You can boot a system from the live CD and make an image copy of one drive to another. Alternatively, you can store an image of an entire drive or partitions on a drive in files on another drive. If the drive to be used for the backup is not already partitioned and formatted, you can obtain a command prompt and use the fdisk command to partition the drive and mkfs.ext3 to format the drive.

[ More Info ]

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

Thu, Jul 02, 2015 11:01 pm

OS X Wireless Diagnostics

On a Mac OS X system, at the bottom of the display you see when you hold down the Option key while clicking on the icon for wireless networking, you will see "Open Wireless Diagnostics"; select that option to start the wireless networking diagnostics program provided by Apple. The utility can be used for troubleshooting Wi-Fi network problems and to generate a report of information related to wireless networking on the system, which may assist you with troubleshooting Wi-Fi issues on the system.

[ More Info ]

[/os/os-x/wireless] permanent link

Tue, Jun 30, 2015 10:09 pm

Transferring files with scp through a bastion host on an OS X system

I need to transfer files through a bastion host periodically. To edit files on a webserver, I need to first establish a Secure Shell (SSH) connection to the bastion host, logging in using an RSA SecurID token. Once I've provided my login credentials, the bastion host prompts me for the system to which I want to connect to from it, which in this case is the web server. So my ssh login to the webserver is tunneled through the bastion host.

I normally go through the process once a month from my MacBook Pro laptop running the OS X operating system when I need to place a monthly newsletter on the web server. I use an SSH command similar to the following to log into the bastion host where gold.example.com is the fully qualified domain name (FQDN) of the web server and bastion1.example.com is the bastion host.

ssh -L 22001:gold.example.com:22 jasmith1@bastion1.example.com

The -L option specifies I want to tunnel a local port on my laptop, in this case I chose 22001, to port 22 on the web server, gold.example.com. A tunnel is set up from my laptop to the web server through the bastion host by using that option once my login is completed to the bastion host.

Then, to transfer a file via secure copy from my laptop to the web server, I can use a command like the following one to transfer a file named July.txt from the laptop to the web server:

$ scp -P 22001 July.txt jasmith1@127.0.0.1:/data/htdocs/clubs/groot/newsletter/2015/.
jasmith1@127.0.0.1's password:

The -P option to the scp command specifies I want to use TCP port 22001, since that is the port for the end of the tunnel on my laptop. The 127.0.0.1 address I'm specifying is the localhost, aka "loopback", address on my laptop. I.e., I'm connecting to port 22001 on the laptop itself. The tunnel I set up earlier results in any connection to that port being forwared through the tunnel to the web server, so I'm specifying my userid for the web server and the password prompt I receive is for the web server. The file July.txt will thus be placed in the directory /data/htdocs/clubs/groot/newsletter/2015 on the web server with the same name, July.txt.

If I wanted to pull a file from the webserver via the tunnel, I could use a command such as the following:

scp -P 22001 jasmith1@127.0.0.1:/data/htdocs/clubs/groot/July.html .

That command would retrieve the file July.html from the web server and place it on the laptop with the same name.

[/network/ssh] permanent link

Mon, Jun 29, 2015 10:35 pm

Seting up an FTP server on a CentOS 7 system

The vsftpd package can be used on a CentOS 7 system to provide FTP server service from the system. After installing the package, you may want to customize its configuration for your needs. After configuring it, you will need to start the service with systemctl start vsftpd and will need to issue the systemctl enable vsftpd command to ensure it starts automatically when the system boots. You will also need to allow FTP connectivity in to the system from FTP clients by configuring the firewall software on the CentOS 7 systems as well, which by default is firewalld for CentOS 7 systems.

[ More Info ]

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

Sun, Jun 28, 2015 9:08 pm

Viewing Policies and Configuring a Policy for FTP

You can check the current policies in a Juniper NetScreen firewall running the ScreenOS operating system, such as a Netscreen-5GT firewall, with get policy all, but you can also display just those policies affecting transmissions from one particular zone to another zone by adding a from from_zone to to_zone to the end of the command. E.g. get policy from untrust to trust would show only those policies that apply to traffic from the untrust zone to the trust zone.

To view only those policies that apply to a particular service, such as FTP, I could use get policy from untrust to trust | include FTP.

ns5gt-> get policy from untrust to trust | include FTP
    24 Untrust  Trust    ACME VPN     VIP(untrust) FTP                  Permit enabled ---X-X
    25 Untrust  Trust    ACI          VIP(untrust) FTP                  Permit enabled ---X-X
ns5gt->

Steps are listed here that can be used to create a policy that will allow FTP connectivity from external systems to an internal FTP server behind the firewall.

[/security/firewalls/netscreen] permanent link

Sat, Jun 27, 2015 8:13 pm

You don't have permission to access /phpmyadmin on this server

When I tried to access phpMyAdmin on a CentOS 7 system running Apache web server software, I saw the message below:

Forbidden

You don't have permission to access /phpmyadmin on this server.

I looked for phpmyadmin.conf, but couldn't find it on the system, but then realized that I needed to use an uppercase "M" and "A"

# locate phpmyadmin.conf
# locate phpMyAdmin.conf
/etc/httpd/conf.d/phpMyAdmin.conf

I thought I had allowed access from all internal systems on the same LAN to phpMyAdmin on the webserver by modifying phpMyAdmin.conf to allow access from the subnet on which the internal systems resided. I checked the configuration file again and it appeared I had allowed access there.

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1 192.168.0
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1 192.168.0
     Allow from ::1
   </IfModule>
</Directory>

Since the internal systems were on a 192.168.0.0/24 subnet, I had added 192.168.0 previously to the Require IP and Allow from lines, so that access was allowed both from the localhost address, 127.0.0.1, i.e., from the system itself, and from other systems on the LAN. I knew I had done that quite some time ago and that the Apache webserver had been restarted a number of times subsequent to that change.

I checked the IP address the server was seeing for the system from which I had tried accessing it using http://www.example.com/phpMyAdmin and realized it was seeing the external IP address of the firewall behind which the webserver resides, because I had used the fully qualified domain name (FQDN) for the server, i.e., www.example.com, which caused the connectivity from the internal system to the web server to go out through the firewall and back in. When I used the internal IP address for the webserver on which phpMyAdmin resided with http://192.168.0.22/phpMyAdmin, I was able to access the phpMyAdmin interface from an internal system on the LAN on which it resides.

References:

  1. Installing phpMyAdmin on a CentOS System Running Apache
    Date: August 8, 2010
    MoonPoint Support

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

Fri, Jun 26, 2015 11:21 pm

Monitoring performance on an OS X system

If you wish to monitor the performance of an OS X system, Apple provides a number of utilities with the operating system to allow you to monitor CPU, memory, and network utilization as well as other system parameters. The Activity Monitor found in Applications/Utilities provides a graphical user interface (GUI) for monitoring CPU, memory, and, to a limited extent, network utilization. The top command found on Linux systems is also present and provides a command line tool for monitoring memory and CPU utilization. For network monitoring, there is also the Network Utility in Applications/Utilities.

[/os/os-x] permanent link

Thu, Jun 25, 2015 10:46 pm

Defining a name for a cell in Google Sheets

If you are using Google Sheets, which is a free online spreadsheet service that is part of Google Docs, for spreadsheets and need to define a name for a cell as one can do in Microsoft Excel, select the cell for which you wish to create a name so that you can reference the cell by that name rather than its specific location, such as Sales!B3 to reference the cell in column B row 3 on the Sales worksheet, take the following steps, assuming you wished the name to be Bobs_Sales:
  1. Select Data from the menu bar at the top of the spreadsheet window.
  2. Select Named ranges.
  3. Click on Add a range.

    Named ranges - add a range

  4. Fill in the name you wish to use to refer to the cell and below it the location, which can include the sheet name, if you have multiple worksheets in the spreadsheet, followed by an exclamation mark, i.e., !, and then the cell location, i.e., columan and row, e.g., Sales!B3.

    Named ranges - name defined

  5. Click on Done to add the name and close the Named ranges window by clicking on the "X" in the upper, right-hand corner.

You could then put =Bobs_Sales in a cell in the same sheet or another sheet in the workbook to have the value stored in Sales!B3 appear in the location where you've placed =Bobs_Sales. That allows you to use a name that is easy for you to remember rather than having to remember or look up the specific location for the data.

[/network/web/services/google] permanent link

Sun, Jun 21, 2015 5:05 pm

Formatting the output from the date command on a Linux system

I wanted to put a time stamp in a log file whenever a script on a Linux system is run. If you just enter date with no parameters at a shell prompt, you will see something like the following:

$ date
Sun Jun 21 16:10:49 EDT 2015

But you can modify how the output from the date command is presented by specifying command line parameters for the command using date +format, where format is how you wish the output formatted. Parameters that can be used to format the display are listed below:

Format StringDescription
%%a literal %
%alocale's abbreviated weekday name (e.g., Sun)
%Alocale's full weekday name (e.g., Sunday)
%blocale's abbreviated month name (e.g., Jan)
%Blocale's full month name (e.g., January)
%clocale's date and time (e.g., Thu Mar 3 23:05:25 2005)
%Ccentury; like %Y, except omit last two digits (e.g., 21)
%dday of month (e.g, 01)
%Ddate; same as %m/%d/%y
%eday of month, space padded; same as %_d
%Ffull date; same as %Y-%m-%d
%glast two digits of year of ISO week number (see %G)
%Gyear of ISO week number (see %V); normally useful only with %V
%hsame as %b
%Hhour (00..23)
%Ihour (01..12)
%jday of year (001..366)
%khour ( 0..23)
%lhour ( 1..12)
%mmonth (01..12)
%Mminute (00..59)
%na newline
%Nnanoseconds (000000000..999999999)
%plocale's equivalent of either AM or PM; blank if not known
%Plike %p, but lower case
%rlocale's 12-hour clock time (e.g., 11:11:04 PM)
%R24-hour hour and minute; same as %H:%M
%sseconds since 1970-01-01 00:00:00 UTC
%Ssecond (00..60)
%ta tab
%Ttime; same as %H:%M:%S
%uday of week (1..7); 1 is Monday
%Uweek number of year, with Sunday as first day of week (00..53)
%VISO week number, with Monday as first day of week (01..53)
%wday of week (0..6); 0 is Sunday
%Wweek number of year, with Monday as first day of week (00..53)
%xlocale's date representation (e.g., 12/31/99)
%Xlocale's time representation (e.g., 23:13:48)
%ylast two digits of year (00..99)
%Yyear
%z+hhmm numeric timezone (e.g., -0400)
%:z+hh:mm numeric timezone (e.g., -04:00)
%::z+hh:mm:ss numeric time zone (e.g., -04:00:00)
%:::znumeric time zone with : to necessary precision (e.g., -04 , +05:30)
%Zalphabetic time zone abbreviation (e.g., EDT)

Table from HowTo Format Date For Display or Use In a Shell Script by Vivek Gite on February 27, 2007

E.g., if I wanted to display the date in the form of year-month-day, I could use the following:

$ date +"%y-%m-%d"
15-06-21

If you use a lowercase "y", then the year will be displayed as a two-digit year, i.e. "15" in this case for 2015, but if I wanted to have the year displayed as a four-digit year, I could use an uppercase "Y" as shown below:

$ date +"%Y-%m-%d"
2015-06-21

In this case I also wanted to log the time in 24-hour format, aka "military time", on the same line as the date, so I could append a %T.

$ date +"%Y-%m-%d %T"
2015-06-21 16:31:40

If I wanted to store the results of the command in a variable, I could use the following:

$ NOW=$(date +"%Y-%m-%d %T")
$ echo $NOW
2015-06-21 16:48:15

[/os/unix/commands] permanent link

Fri, Jun 19, 2015 10:23 pm

Markup Data Folder does not exist

If you see a "Markup Data Folder does not exist!" error message while you are using the CoffeeCup HTML Editor, which is a program used to edit pages for a website, which references a directory, such as "C:\Users\Public\Documents\CoffeeCup Software\HTML Editor\Markup\HTML4.01\." it may be because you installed CoffeeCup HTML Editor using a different account than the one you are now using.
O'Reilly - Get Started Today

Markup Data Folder does not exist

I encountered that error after installing the software for a family member. I had installed the software under an administrator account, but when I was later testing the software under her account I saw that error message appear frequently. You can remedy the problem by copying fhe folder from the account under which it was installed to another account where you wish to use the software.

You can do that In Windows 8 while logged into a non-privileged account, i.e., one that isn't in the administrator group, by right-clicking on the Start button, then choosing Command Prompt (Admin) and providing a userid and password for an account that is in the administrator group. E.g., in this case I provided the credentials for the account under which I installed the software, since it was an account in the administrator group.

You can find the Markup directory beneath C:\Users\userid\AppData\Roaming\CoffeeCup Software\CoffeeCup HTML Editor\Markup where userid is the user name for the account under which you installed the CoffeCup HTML Editor. E.g., supposing the userid was JDoe, I would see the following:

 Volume in drive C has no label.
 Volume Serial Number is 5C60-1B61

 Directory of C:\Users\JDoe\AppData\Roaming\CoffeeCup Software\CoffeeCup HTML Editor\Markup

06/12/2015  12:51 PM    <DIR>          .
06/12/2015  12:51 PM    <DIR>          ..
06/12/2015  12:51 PM    <DIR>          CSS2.1
06/12/2015  12:51 PM    <DIR>          CSS3
06/24/2010  11:44 AM             3,055 doctypes.txt
06/12/2015  12:51 PM    <DIR>          Entities
06/12/2015  12:51 PM    <DIR>          HTML
03/12/2014  09:45 AM            22,830 html-entities.conf
06/12/2015  12:51 PM    <DIR>          HTML4.01
06/12/2015  12:51 PM    <DIR>          HTML5
06/12/2015  12:51 PM    <DIR>          Markdown
03/06/2014  09:43 AM            70,692 opengraph.dat
12/16/2013  08:22 AM           944,004 schema.dat
06/12/2015  12:51 PM    <DIR>          XHTML1
06/28/2010  02:17 PM                93 _default.css
               5 File(s)      1,040,674 bytes
              10 Dir(s)  3,738,071,187,456 bytes free

From an admin command prompt, I could then copy the contents to a similar location under another account where I want to be able to use the software. E.g., supposing I wanted to copy from the JDoe account to a Jane account, I could use the xcopy command below.

xcopy /s "C:\Users\JDoe\AppData\Roaming\CoffeeCup Software\CoffeeCup HTML Editor" "C:\Users\Jane\AppData\Roaming\CoffeeCup Software\CoffeeCup HTML Editor\."

There are over 800 files in the folder and its subfolders. Once they are copied, if you had the HTML Editor open during that process, close and reopen it.

I also encountered a problem while configuring the HTML Editor to display files in browsers on the system, which gives you the opportunity to see what a page will look like in multiple browsers. That problem was also related to directory permissions, since the CoffeeCup HTML Editor was attempting to create files in a directory where only accounts in the administrator group should be able to create files - see Configuring CoffeCup HTML Editor for browser support.

References:

  1. "Markup Data Folder Does Not Exist" Error
    By: Scott Swedorski
    Date: June 6, 2013
    HTML Editor, Website & Web Design Software | CoffeeCup Software

[/os/windows/software/coffeecup] permanent link

Thu, Jun 18, 2015 11:19 pm

Viewing information on wireless networks from shell prompt

On an Ubuntu Linux system, you can use the iwconfig command at a shell prompt, i.e., a command line interface, to view information on available networks. Iwconfig is part of the wireless-tools package.

If you are currently connected to a wireless network, you will see something similar to the following, if you run the command with no arguments specified. In the example below, the system is connected to a wifi network that has a service set identification (SSID) of T28J5 at a bit rate of 1 Mbs.

$ iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"T28J5"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1F:90:B2:9F:A4   
          Bit Rate=1 Mb/s   Tx-Power=14 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=70/70  Signal level=-33 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:65   Missed beacon:0

eth0      no wireless extensions.

You can specify a wireless interface to avoid the display of extraneous information for interfaces that are not wireless interfaces, e.g., iwconfig wlan0.

I can see from the above output that the wireless interface supports the 802.11 b, g, and n standards.

The arguments for the command can be seen by issuing the command iwconfig --help at a shell prompt.

$ iwconfig --help
Usage: iwconfig [interface]
                interface essid {NNN|any|on|off}
                interface mode {managed|ad-hoc|master|...}
                interface freq N.NNN[k|M|G]
                interface channel N
                interface bit {N[k|M|G]|auto|fixed}
                interface rate {N[k|M|G]|auto|fixed}
                interface enc {NNNN-NNNN|off}
                interface key {NNNN-NNNN|off}
                interface power {period N|timeout N|saving N|off}
                interface nickname NNN
                interface nwid {NN|on|off}
                interface ap {N|off|auto}
                interface txpower {NmW|NdBm|off|auto}
                interface sens N
                interface retry {limit N|lifetime N}
                interface rts {N|auto|fixed|off}
                interface frag {N|auto|fixed|off}
                interface modulation {11g|11a|CCK|OFDMg|...}
                interface commit 
       Check man pages for more details.

You can also use the iwlist command to display some additional information from a wireless network interface that is not displayed by iwconfig. The main argument is used to select a category of information; iwlist displays in detailed form all information related to this category, including information already shown by iwconfig.

The options, which you can view by typing iwlist --help or just iwlist at a shell prompt, for the command are shown below:

$ iwlist
Usage: iwlist [interface] scanning [essid NNN] [last]
              [interface] frequency 
              [interface] channel 
              [interface] bitrate 
              [interface] rate 
              [interface] encryption 
              [interface] keys 
              [interface] power 
              [interface] txpower 
              [interface] retry 
              [interface] ap 
              [interface] accesspoints 
              [interface] peers 
              [interface] event 
              [interface] auth 
              [interface] wpakeys 
              [interface] genie 
              [interface] modulation

If you are connected to a wireless network already, you can view information on that network by typing ifwlist scan. E.g., in the example below, the system is connected to a wireless network that has a SSID of T28J5, which can support a maximum transmission rate of 54 Mbs.

$ iwlist scan
lo        Interface doesn't support scanning.

wlan0     Scan completed :
          Cell 01 - Address: 00:1F:90:B2:9F:A4
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=70/70  Signal level=-36 dBm  
                    Encryption key:on
                    ESSID:"T28J5"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000733f20181
                    Extra: Last beacon: 22940ms ago
                    IE: Unknown: 00055432384A35
                    IE: Unknown: 010882848B0C12961824
                    IE: Unknown: 030101
                    IE: Unknown: 0706555320010B1B
                    IE: Unknown: 200100
                    IE: Unknown: 2A0100
                    IE: Unknown: 32043048606C
                    IE: Unknown: DD0900037F010100200000

eth0      Interface doesn't support scanning.

If you know the designation for the wireless interface in the system, e.g. wlan0 in this case, you can avoid attempting to scan interfaces, such as eth0, which is a wired rather than wireless interface, by specifying the wireless interface when issuing the command, e.g., iwlist wlan0 scan.

$ iwlist wlan0 scan
wlan0     Scan completed :
          Cell 01 - Address: 00:1F:90:B2:9F:A4
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=70/70  Signal level=-33 dBm  
                    Encryption key:on
                    ESSID:"T28J5"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=000000075edbf181
                    Extra: Last beacon: 57620ms ago
                    IE: Unknown: 00055432384A35
                    IE: Unknown: 010882848B0C12961824
                    IE: Unknown: 030101
                    IE: Unknown: 0706555320010B1B
                    IE: Unknown: 200100
                    IE: Unknown: 2A0100
                    IE: Unknown: 32043048606C
                    IE: Unknown: DD0900037F010100200000

You can see the current bitrate with iwlist <interface> bitrate.

$ iwlist wlan0 bitrate
wlan0     unknown bit-rate information.
          Current Bit Rate=1 Mb/s

If you are already connected to a wifi network and want to disconnect you can type ifconfig interface down where interface is the designation for the relevant wireless interface, e.g., wlan0. You can see a list of all available interfaces with ifconfig -a. If you don't run the ifconfig wlan down command from the root account or use sudo on a Ubuntu system, you will receive a "permission denied" error message. You can use sudo ifconfig to run the command from an account with sudo privileges.

$ ifconfig wlan0 down
SIOCSIFFLAGS: Permission denied
$ sudo ifconfig wlan0 down
[sudo] password for jdoe:
$

But with the above method, the system may bring the interface back up automatically a few seconds later. You can use the command-line tool nmcli for controlling NetworkManager, instead. To disable the wifi interface, you can use nmcli nm wifi off.

$ nmcli nm wifi off
$

You can re-enable the wifi interface with nmcli nm wifi on. If the system has previously connected to an available wifi network and has the credentials stored to automatically connect to that network, when you issue the nmcli nm wifi on command, it will automatically reconnect to the network.

You can see the current status of the wifi interface with nmcli nm wifi. E.g., if it is enabled, you would see the following:

$ nmcli nm wifi
WIFI      
enabled

If you wish to see a list of the stored wifi networks you can use the nmcli con command, which shows information about NetworkManager's connections. For information on a particular one you can use nmcli con list id identifier, where identifier is the id for the wireless network, e.g., T28J5 or in the example below VA Internet for the guest network at a hospital.

$ nmcli con list id "VA Internet"
connection.id:                          VA Internet
connection.uuid:                        8cd16736-f340-42a8-b103-1b87d24973b9
connection.type:                        802-11-wireless
connection.autoconnect:                 yes
connection.timestamp:                   1434474233
connection.read-only:                   no
connection.permissions:                 
802-11-wireless.ssid:                   'VA Internet'
802-11-wireless.mode:                   infrastructure
802-11-wireless.band:                   not set
802-11-wireless.channel:                0
802-11-wireless.bssid:                  not set
802-11-wireless.rate:                   0
802-11-wireless.tx-power:               0
802-11-wireless.mac-address:            90:4C:E5:2F:6F:2E
802-11-wireless.cloned-mac-address:     not set
802-11-wireless.mac-address-blacklist:  
802-11-wireless.mtu:                    auto
802-11-wireless.seen-bssids:            
802-11-wireless.security:               not set
ipv4.method:                            auto
ipv4.dns:                               
ipv4.dns-search:                        
ipv4.addresses:                         
ipv4.routes:                            
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    not set
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     not set
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv6.method:                            auto
ipv6.dns:                               
ipv6.dns-search:                        
ipv6.addresses:                         
ipv6.routes:                            
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes

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

Mon, Jun 15, 2015 10:23 pm

Batch file to display average ping times

If you run the ping command in windows with no parameters specified other than the system to ping, the output will look similar to the following:

C:\>ping google.com

Pinging google.com [216.58.217.142] with 32 bytes of data:
Reply from 216.58.217.142: bytes=32 time=12ms TTL=55
Reply from 216.58.217.142: bytes=32 time=16ms TTL=55
Reply from 216.58.217.142: bytes=32 time=13ms TTL=55
Reply from 216.58.217.142: bytes=32 time=13ms TTL=55

Ping statistics for 216.58.217.142:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 12ms, Maximum = 16ms, Average = 13ms

If I want to just see the ping times and no other output from the ping command, I could use a FOR /F command such as is shown below. The "pipe" character, |, used to pipe output from one command to another should be prefixed with ^, which serves as an "escape character".

C:\>for /f "tokens=7 delims== " %g in ('ping google.com ^| find "Reply from"') do @echo %g
22ms
15ms
13ms
22ms

To do the same thing from a batch file, I could put the following commands in a batch file:

@echo off

set HostToPing="google.com"

for /f "tokens=7 delims== " %%g in ('ping %HostToPing% ^| find "Reply from"') do echo %%g

The differences are that I would need to use %%g, instead of %g in the batch file and I could use echo in the batch file rather than @echo, since I put @echo as the first line of the batch file to turn off the display of the comands themselves.

By default, when you run the ping command on a Microsoft Windows system, it will issue 4 pings then stop. But you can control the number of pings sent by using the -n count parameter, where count is the number of pings to send.

    -n count       Number of echo requests to send.

If I want to monitor the average response time to pings to a given host over a long period of time, I could issue the ping command with a very large number of echo requests specified or use the -t parameter, e.g., ping -t to have the pings run indefinitely:

    -t             Ping the specified host until stopped.
                   To see statistics and continue - type Control-Break;
                   To stop - type Control-C.

I could store the results in a file by redirecting output from the command with the output redirection character >, i.e., ping -n 500000 google.com >pingoutput.txt. Or I could just look at the line where ping displays the average and create a loop where pings are run periodically. The line where the average is shown by ping looks like the following:

Minimum = 14ms, Maximum = 17ms, Average = 15ms

To just look at that average value, but also time stamp the output, so I can determine if ping times to a particular host are changing significantly over the course of a day, I could use code similar to the following in a batch file, substituting the particular host I'm interested in for google.com and using the timeout command present in Microsoft Windows 7/2008 and later versions to specify the pause period between instances of the ping command being run. The timeout command is similar to the sleep or wait commands that may be present in other operating systems. In the example below the timeout value is 2 minutes. In this case >> must be used to append to the output file, since > would overwrite the output file each time ping was run.

@echo off

set HostToPing="google.com"

:loop
set datetime=%date% %time%
for /f "tokens=9" %%g in ('ping %HostToPing% ^| find "Average ="') do echo %datetime% %%g >>ping_times.txt
timeout /t 120
goto loop

If I name the batch file avgpingtime.bat and run it from a command prompt, I would see the following until the batch file is stopped with Ctrl-C.

C:\>avgpingtime

Waiting for   0 seconds, press a key to continue ...

Waiting for   0 seconds, press a key to continue ...

Waiting for   0 seconds, press a key to continue ...

Waiting for   0 seconds, press a key to continue ...

Waiting for   0 seconds, press a key to continue ...

Waiting for   0 seconds, press a key to continue ...

Waiting for   0 seconds, press a key to continue ...

Waiting for   0 seconds, press a key to continue ...

Waiting for  14 seconds, press a key to continue ...

Until the batch file s terminated with Ctrl-C, it would display its countdown from 120 to 0 each time the timeout command is executed. The results stored in the text file would be similar to the following:

C:\>more google_ping_times.txt
Mon 06/15/2015 20:35:10.22 25ms
Mon 06/15/2015 20:37:13.15 33ms
Mon 06/15/2015 20:39:16.13 16ms
Mon 06/15/2015 20:41:19.12 22ms
Mon 06/15/2015 20:43:22.10 25ms
Mon 06/15/2015 20:45:25.13 22ms
Mon 06/15/2015 20:47:28.12 17ms
Mon 06/15/2015 20:49:31.12 20ms
Mon 06/15/2015 20:51:34.13 15ms
Mon 06/15/2015 20:53:23.37 20ms

The batch file could also be scheduled to run with the Windows Task Scheduler.

[/os/windows/commands] permanent link

Sun, Jun 14, 2015 10:37 pm

Configuring sendmail to accept email from other email servers

A default installation of sendmail usually yields a configuration where sendmail will only accept email from email clients on the server on which sendmail is running. Usually, you will want to allow external email servers to send email to valid email addresses on the server. To do so, edit /etc/mail/sendmail.mc. Comment out the following line by putting dnl at the beginning of the line:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

The line should then appear as follows:

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

You then need to rebuild the /etc/mail/sendmail.cf file from the /etc/mail/sendmail.mc file using the m4 command as shown below:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Once you've rebuilt the sendmail.cf file, you need to restart sendmail. You may be able to restart sendmail with a /etc/init.d/sendmail restart command, though on some Linux systems, e.g., CentOS 7, you will see a No such file or directory error message, if you try that command. On a CentOS 7 system, you can restart sendmail with systemctl restart sendmail.

# /etc/init.d/sendmail restart
-bash: /etc/init.d/sendmail: No such file or directory
# systemctl restart sendmail
#

Or you can also use service sendmail restart on a CentOS 7 system to restart sendmail.

# service sendmail restart
Redirecting to /bin/systemctl restart  sendmail.service
#

Once you've restarted sendmail, external servers sending email to domain names present in the local-host-names file, should no longer receive "relaying denied" error messages in bounced email. They still would not be able to send email to email addresses for domain names not in that file. I.e., the server won't function as an "open mail relay".

[/network/email/sendmail] permanent link

Sat, Jun 13, 2015 9:53 pm

Determining what package provides a file on a CentOS system

If you wish to know which package provides a particular file on a CentOS system, you can use the yum whatprovides command followed by the path to the file and its name. E.g., if I wanted to determine what package provides the mysql command on a system, I could determine its location with the which command and then use the yum whatprovides command to determine the package that included the file.
$ which mysql
/usr/bin/mysql
$ yum whatprovides /usr/bin/mysql
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.umd.edu
 * epel: mirror.us.leaseweb.net
 * extras: mirror.nexcess.net
 * updates: mirror.cs.pitt.edu
1:mariadb-5.5.41-2.el7_0.x86_64 : A community developed branch of MySQL
Repo        : base
Matched from:
Filename    : /usr/bin/mysql



1:mariadb-5.5.41-2.el7_0.x86_64 : A community developed branch of MySQL
Repo        : @updates
Matched from:
Filename    : /usr/bin/mysql

From the above output, I can see the mysql program was provided in the mariahdb package.

Another means to determine what package provided a file installed on the system is to use the RPM Package Manager (RPM) utility.

$ rpm -qf /usr/bin/mysql
mariadb-5.5.41-2.el7_0.x86_64

Details on that package could be obtained by using the rpm -qi mariadb command.

$ rpm -qi mariadb
Name        : mariadb
Epoch       : 1
Version     : 5.5.41
Release     : 2.el7_0
Architecture: x86_64
Install Date: Mon 16 Feb 2015 09:33:02 PM EST
Group       : Applications/Databases
Size        : 50862464
License     : GPLv2 with exceptions and LGPLv2 and BSD
Signature   : RSA/SHA256, Thu 05 Feb 2015 11:27:55 AM EST, Key ID 24c6a8a7f4a80eb5
Source RPM  : mariadb-5.5.41-2.el7_0.src.rpm
Build Date  : Thu 05 Feb 2015 11:12:40 AM EST
Build Host  : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://mariadb.org
Summary     : A community developed branch of MySQL
Description :
MariaDB is a community developed branch of MySQL.
MariaDB is a multi-user, multi-threaded SQL database server.
It is a client/server implementation consisting of a server daemon (mysqld)
and many different client programs and libraries. The base package

If you are interested in what package may provide a file that isn't currently installed on a system, you could use the yum whatprovides command or, alternatively use the www.rpmfind site to perform a search on the file name. In this case, for mysql, the site will return a long list of packages that could provide the file.

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

Sat, Jun 13, 2015 7:29 pm

Getting sendmail to accept email for a domain

In order to configure sendmail to accept email for a particular domain name, you need to add the domain name to /etc/mail/local-host-names. E.g., suppose sendmail on my server accepts email for moonpoint.com, but I also want it to handle email for example.com. I would then edit the /etc/mail/local-host-names file adding example.com to the the file, so it would contain the following lines:

# local-host-names - include all aliases for your machine here.
moonpoint.com
example.com

Any line that begins with the pound or hash character, i.e., #, is a comment and domain names are added one per line. After editing the file, you need to generate a new local-host-names.db file by running the command below from the root account:

# makemap hash /etc/mail/local-host-names < /etc/mail/local-host-names
makemap: /etc/mail/local-host-names: line 2: no RHS for LHS moonpoint.com
makemap: /etc/mail/local-host-names: line 6: no RHS for LHS example.com

Don't worry about the "no RHS for LHS" lines; they are to be expected. You can verify that your sendmail server will now handle email for the new domain by using the sendmail -bv command followed by the name of an account or alias on the system (aliases are added to /etc/aliases and a new aliases list generated by running newaliases). E.g., if jan is the name of an account on the system, I could then test that email will be delivered to the local jan account if I were to send a message to jan@example.com.

# sendmail -bv jan@example.com
jan@example.com... deliverable: mailer local, user jan

The "mailer local, user jan" reference informs me that sendmail will deliver email addressed to jan@example.com to the local jan account. When I ran the command prior to updating the local-host-names file, I saw the following:

# sendmail -bv jan@example.com
jan@example.com... deliverable: mailer relay, host smtp.mandrillapp.com, user jan@example.com

The "mailer relay" reference informed me that sendmail was not configured to deliver email to the local account if someone on the system sent email to jan@example.com, but would, instead, send the email through another email server to what it believed was an external email account.

To get external email servers to use the server on which I'm running sendmail to delier email for the example.com domain, I need to have an appropriate mail exchanger (MX) record configured for the domain - see Checking MX Records - or at least ensure that there is no MX record pointing to some other server. E.g., I could use the command nslookup -querytype=mx example.com to check the MX records for example.com.

# nslookup -querytype=mx example.com
Server:         10.255.176.37
Address:        10.255.176.37#53

example.com   mail exchanger = 10 smtp.example.com.

If my server running sendmail is accessible at the IP address for smtp.example.com, then other email servers will send email for any any email address at example.com to it.

[/network/email/sendmail] permanent link

Fri, Jun 12, 2015 10:12 pm

Port forwarding with PuTTY

The free PuTTY program for Microsoft Windows systems allows you to establish SSH connections. The program includes port forwarding capability, so that you can forward connectivity to a port on the system running PuTTY to a port on the SSH server to which you have connected using PuTTY or even another system accessible from the SSH server. E.g., suppose you can remotely connect to a SSH server at your home or business, but you can't access a web server at home or at the business location remotely. One option you can use is have PuTTY "listen" on the system on which it runs on a port, e.g., port 8888, and for any connection to that port on the local system on which PuTTY is running, forward the connection to the remote web server through the SSH server as explained at Port forwarding to another device with PuTTY. Such port forwarding can be performed to any TCP port.

Alternatively, you can set up a SOCKS proxy using PuTTY as noted at Using PuTTY to set up a SOCKS Proxy Connection. Instructions for configuring some browsers ito use a SOCKS proxy are provided from the links below:

[/os/windows/network/ssh/putty] permanent link

Mon, Jun 08, 2015 10:53 pm

AgentService CPU Utilization

I've found that a MacBook Pro laptop I use often will slow unbearably. When I check the cpu utilization, I usually find some third-party application is consuming an inordinate amount of CPU time slowing the system. Today the problem was due to the AgentService process associated with an enterprise backup program, Connected Backup, from Hewlett Packard (HP). HP acquired the software when it purchased Autonomy Corporation, which had itself obtained the software through the purhcase of Iron Mountain's technology arm, "Iron Mountain Digital". Previously, I've seen the same CPU utilization problem due to the AMPAgent process from Kace.

[ More Info ]

[/os/os-x] permanent link

Fri, Jun 05, 2015 9:46 pm

Removing email addresses, etc. stored within your browser

When you go to websites where a form is present with fields for an email address, etc., such as the Facbook page for logging into the site, when you click on the field for the email address you may see a list of email addresses that the browser has saved to auto fill fields in forms for you. If you wish to have the browser "forget" those email addresses and other information, the steps to take are as follows:

Chrome
Firefox

[/network/web/browser] permanent link

Wed, Jun 03, 2015 10:30 pm

Importing Amazon reports into Excel 2013

To import an Amazon affiliate report into Excel 2013, download the report as a tab separated values (TSV) report, then take the following steps in Microsoft Excel 2013 to import the data, which can also be used for any text file containing tab delimited data:
  1. Click on File.
  2. Click on Open.
  3. Under Open select the location where the downloaded file is located and select the report.txt file you downloaded.
  4. A "Text Import Wizard Step 1 of 3" window will open. You can check the check box next to "My data has headers". You can skip the first title row, if you wish, by changing the "Start import at row" value from the default value of 1. Click on Next when you've made any changes needed.

    Text Import Wizard Step 1 of 3

  5. At step 2, leave "Tab" selected as the delimiter and click on Next.

    Text Import Wizard Step 2 of 3

  6. At step 3, you can leave "General" selected for the "Column data format" and click on Finish.

    Text Import Wizard Step 3 of 3

Once the data is imported, you can click on the vertical lines between the column headers to adjust the width of individual columns to accomodate column titles and data. Or to have the text wrap within the current column width, you can click on a column designator, such as "A", "B", etc., or click on the "1" to the left of the first row to choose all columns on that row, and then right-click and choose Format Cells, Alignment, and then select Wrap Text under Text Control, and then click on OK.

To save the file in an Excel spreadsheet format, select File and Save As, select a location and name for the file, and then change the "Save as type" value from "Text (Tab delimited) (*.txt)" to "Excel Workbook (*.xlsx)" or other file type.

[/os/windows/office/excel] permanent link

Tue, Jun 02, 2015 11:15 pm

Importing a contact list from Outlook into Event Planner 2015

If you wish to import a contact list from Microsoft Outlook into Event Planner 2015, which is part of Hallmark Card Studio 2015, first export the contact list from Outlook into a format that Event Planner can import, such as a Microsoft Access .mdb, Excel .xls, or comma separated values (CSV) file, e.g., see Exporting contacts from Outlook 2010. Though, when I tried importing from a Microsoft Access .mdb file, a ODBC Microsoft Access Driver Login Failed window opened with the message "Unrecognized database format 'C:\Users\Jane\Documents\Contacts.mdb'" after I was prompted for a login name and password, so I exported the data as an Excel .xls file, instead. I was able to successfully import from an Excel .xls spreadsheet.

Once you have exported the data from Outlook, in Event Planner, click on File then select Import. When prompted to "Select the data source you are importing from, select "Access (*.mdb), Excel (*.xls) or Comma Delimited (*.csv) files". The other options are "Existing Event Planner installation" and "Outlook Express". Outlook Express is a different application than Outlook, though both were created by Microsoft, and stores information in its own format, which is not the one used by Microsoft Outlook, so you will need to import from an mdb, xls, or csv file.

Import Data Source

After clicking on Next, browse to the location of the file you exported, e.g. Contacts.xls, and select it then click on Next. You will then need to map fields from the imported file to Address Book fields in the Event Planner.

Import Address Book Fields

Some Outlook fields won't have an exact match with Event Planner fields. E.g., Outlook has a company name field for its contacts, whereas the Event Planner does not, so you will have to map a company name to last name. To perform the mapping, you will need to click on an entry in the left-most "Select a value from your database" column in the Import Address Book Fields window, then select an entry from "Choose the Address Book field to which you want to map the value", and then click on the Add button to complete the mapping. You may have to open the exported file in an application such as Excel to determine what the column headers are for entries to make an appropriate mapping. You may not even need to map some values if you feel you don't need them in the Event Planner contact list, e.g., "gender", "sensitivity", etc. have no comparable Event Planner fields.

Company name to last name mapping

You will need to do this for each entry in the left column

Note: Tested with Event Planner 2015 version 3.0.3.1, which is part of Hallmark Card Studio 2015, but may apply to other versions as well.

[/os/windows/software/graphics/Event-Planner] permanent link

Fri, May 29, 2015 9:29 pm

Counting cells that aren't blank in Google Sheets

To count the number of cells containing content, i.e., those that aren't blank, in Google Sheets, which is part of Google Docs and is Google's online equivalent of Microsoft Excel you can use COUNTIF or COUNTA. E.g., suppose you wish to count the number of cells in column A from A2 to A64 which contain data, ignoring any cells that are blank. You could use COUNTIF(A2:A64,"<>"). The "<>", instructs Google Sheets to only count cells that don't have a null value, i.e., ones containing some data. Alternatively, you could use COUNTA(A2:A64). If you wanted the number that were blank, you could use COUNTBLANK(A2:A64).

[/network/web/services/google] permanent link

Thu, May 28, 2015 9:58 pm

Copying command output to the clipboard under Microsoft Windows

When you are using the Microsoft Windows command line interface, you may need to copy the output of commands somewhere else, such as notepad or some other text editor. You can copy and paste the output of commands by right-clicking on the Command Prompt title bar and selecting Edit, then Mark and then highlighting the text you wish to copy in the command prompt window and hitting Enter to copy it to the Windows clipboard. Or you can click within the Command Prompt window below the title bar which will give you the option to select Mark without selecting Edit first. Either method will then allow you to use Edit and Paste or Ctrl-V to paste the text into other applications.

Another alternative is to redirect the output of a command to a file using the redirect character, >. E.g., if you wished to put the output of the dir command in file example.txt, you could use dir > example.txt.

If you wish to see the output in the command window and also have it copied to the clipboard at the same time, another alternative is to use the "pipe" character, | followed by clip. E.g., if you wanted to see all the files in a directory with many files and also have the output of the command placed in the Windows clipboard, you could use dir | clip. You could then paste the contents of the clipboard into other applications.

[/os/windows/commands] permanent link

Tue, May 19, 2015 9:10 pm

Determining if a package is installed under Ubuntu

To determine if a package is installed on a Ubuntu Linux system, you can use the command dpkg -s packagename where packagename is the name of the package.

$ dpkg -s python-software-properties
Package: python-software-properties
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 196
Maintainer: Michael Vogt <michael.vogt@ubuntu.com>
Architecture: all
Source: software-properties
Version: 0.82.7.5
Depends: python2.7, python (>= 2.7.1-0ubuntu2), python (<< 2.8), python-apt (>= 0.6.20ubuntu16), lsb-release, python-gnupginterface, unattended-upgrades, iso-codes, python-pycurl
Description: manage the repositories that you install software from
 This software provides an abstraction of the used apt repositories.
 It allows you to easily manage your distribution and independent software
 vendor software sources.

If a package isn't installed, you will see output similar to the following:

$ dpkg -s linssid
Package `linssid' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

You can use the dpkg-query -l command with the wild card character, *, to see a list of packages that match a specified pattern. E.g., to see all packages that begin with python-py:

$ dpkg-query -l 'python-py*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
un  python-pyatspi <none>         (no description available)
ii  python-pyatspi 2.4.0+dfsg-0ub Assistive Technology Service Provider Interf
ii  python-pycurl  7.19.0-4ubuntu Python bindings to libcurl
un  python-pycurl- <none>         (no description available)
un  python-pygment <none>         (no description available)
un  python-pyicu   <none>         (no description available)
ii  python-pyinoti 0.9.2-1        simple Linux inotify Python bindings
un  python-pyinoti <none>         (no description available)
un  python-pylons  <none>         (no description available)

An asterisk, "*", can represent one or more characters. You can also use a question mark, "?", to represent just one instance of any character. E.g.:

$ dpkg-query -l 'xin*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  xinit          1.3.1-1        X server initialisation tool
ii  xinput         1.5.99.1-0ubun Runtime configuration and test of XInput dev
jim@lancelot:~/Documents/blog$ dpkg-query -l 'xin??'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  xinit          1.3.1-1        X server initialisation tool

To get a list of all packages on the system, use dpkg-query -l.

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

Sun, May 17, 2015 10:51 pm

Tools for Cutting Craft Sticks

My wife asked me to help her cut a large number of Woodsies Craft Sticks for floorboards for a doll house project she has started. The wooden craft sticks, which look like large popsicle sticks or tongue depressers, have rounded ends, but she needed square ends for some and others with a 45-degree angle at the ends. I thought I could simply cut them with a pair of electrician's scissors, which worked well for the first couple of craft sticks I cut; it was easy to cut through them with the scissors and the scissors left fairly smooth edges, but I found after the first couple of sticks that subsequent cuts through other sticks tended to splinter the cut ends. My saws were too large, but she had a Revell Razor Saw designed for craft projects which worked well, but, since I had to go to the local True Value hardware store for some C-clamps anyway, I looked for something there that might help speed cutting through a large number of the craft sticks. I found a Master Mechanic Mult Cutter there, which uses blades similar to what you might find in a box cutter. I found it was easy to put a stick on its anvil and then cleanly and easily cut through the craft sticks by squeezing its handle, which pressed the blade through the stick and against the anvil. I thought I'd note the tools used here, so I'd know what to buy should I need to replace the blades in the tools in the future or should anyone else possibly be looking for tools to cut those craft sticks, since I've seen others noting problems cutting similar items without frayed/splintered ends, e.g., What is the best way to cut popsicle sticks?

[/info/tools] permanent link

Sat, May 16, 2015 10:31 pm

Configuring SNMP on a Windows 7 System

The Simple Network Management Protocol (SNMP) provides a mechanism for managing network-connected devices using a standard protocol for a wide variety of networked devices, such as routers, switches, servers, workstations, printers, etc. Microsoft Windows systems support SNMP, but they are not configured by default to support SNMP. But once you've installed and configured SNMP on a Windows system you can monitor a variety of system parameters on it from an SNMP network management system. Steps for configuring SNMP on a Microsoft Windows 7 system are detailed here.

Instructions for installing SNMP on systems running Windows XP are at Installing SNMP Under Windows XP.

[/os/windows/win7] permanent link

Fri, May 15, 2015 8:23 pm

Determining the Office 2013 Product Key

If Microsoft Office 2013 is installed on a PC and you need to know the product key, but there is no product key sticker on the system, you can obtain the product key from a command prompt using the command cscript “C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS” /dstatus for the 32-bit version or cscript “C:\Program Files\Microsoft Office\Office15\OSPP.VBS” /dstatus for the 64-bit version. If Microsoft Office is installed beneath Program Files (x86) that indicates you have the 32-bit version, since that is where 32-bit versions of applications are installed.

But you will only be shown the last 5 characters of the 25-character product key, because, unlike with prior versions of Microsoft Office, Microsoft is no longer storing the entire product key in the registry where it can be retrieved. So the product key you obtain is only likely useful to you if you have multiple Microsoft Office 2013 product keys and need to determine which one is used on which system. Or if you purchased the software online and received the product key by email, you could use those last 5 characters to search your email or your system for any message or file containing the full product key.

When you run the commands, you will see output similar to the following:

C:\>cscript "\Program Files\Microsoft Office\Office15\OSPP.VBS" /dstatus
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------
---------------------------------------
SKU ID: 064383fa-1538-491c-859b-0ecab169a0ab
LICENSE NAME: Office 15, OfficeProPlusR_Retail edition
LICENSE DESCRIPTION: Office 15, RETAIL channel
LICENSE STATUS:  ---LICENSED---
Last 5 characters of installed product key: B96XY
---------------------------------------
---------------------------------------
---Exiting-----------------------------

If the software was preinstalled on the system, there is likely a sticker with the full Microsoft Office 2013 product key. But, if it wasn't and you need the full product key, but can't find it via a search through email or files on the system, if you registered and activated the software, you may be able to log into a Microsoft account that you have via Microsoft Office: My Account. You should be able to see the product key there and redownload the software, also, if needed. A last resort might be to contact Microsoft support using contact information from Microsoft's Contact Us page. But you will likely need some way of proving that you purchased the software to have any chance of being issued another product key.

References:

  1. How to find your Office 2013 product key after installation
    Support - support.office.com

[/os/windows/office] permanent link

Thu, May 14, 2015 11:03 pm

Checking and setting the NTP server on a Mac OS X System

The systemsetup -getnetworktimeserver command can be used on a Mac OS X system to determine the time server with which the system's click is being synchronized.. You need administrator access to utilize the command; you can use sudo to run it if your account has administrative privileges.

$ systemsetup -getnetworktimeserver
You need administrator access to run this tool... exiting!
$ sudo systemsetup -getnetworktimeserver
Password:
Network Time Server: ntp.example.com

You can set the Network Time Protocol (NTP) server with which the system will synchronize its clock by specifying -setnetworktimeserver, instead. E.g.:

$ systemsetup -setnetworktimeserver us.pool.ntp.org

You can query an NTP server with the sntp command.

$ sntp us.pool.ntp.org
2015 May 14 22:50:29.664176 +4.438430 +/- 0.099854 secs

[/os/os-x] permanent link

Wed, May 13, 2015 9:07 pm

Monitoring Interface Bandwidth Utilization on a NetScreen Firewall

While checking on a performance problem at a site using a NetScreen 5GT firewall, I found that when I accessed the Interface Bandwidth report from the web-based management interface that the report was showing zero Kbps for the utilized bandwidth on all interfaces, which was obviously wrong, since data was flowing through the firewall. I found that I needed to enable traffic shaping mode on the firewall to get that report to actually show the bandwidth being used for the interfaces on the firewall.

Traffic shaping is a mechanism to give certain types of data flows precedence over others with lower priority traffic being buffered. In this case I didn't actually "shape" the traffic, but just enabled traffic shaping mode so that I could see the current bandwidth being used on interfaces.

[ More Info ]

[/security/firewalls/netscreen] permanent link

Tue, May 12, 2015 11:22 pm

Checking and setting NTP information on a NetScreen firewall

While checking the configuration of a Juniper Networks netscreen-5gt firewall, I noticed that the time was incorrect and that it was not set up to query a Network Time Protocol (NTP) server to ensure its time was accurate. To check or set the NTP configuration on a Juniper Networks NetScreen firewall, From the web management interface, you can check and set the Network Time Protocol (NTP) information for a Juniper NetScreen firewall, such as the NetScreen-5GT firewall, by clicking on Date/Time beneath the Configuration option on the menu.

The NTP configuration can also be viewed and set from a command line interface accessible by SSH using get ntp and set ntp commands. Up to three NTP servers can be configured. The time interval for NTP queries can be specified.

[ More Info ]

[/security/firewalls/netscreen] permanent link

Mon, May 11, 2015 9:52 pm

Adding Plugins Folders to Corel PaintShop Pro X7

In Corel PaintShop Pro X7, select File, Preferences then File Locations. In the File Locations window, click on Plug-ins, which will show the current plug-in file folders. Click on the Add button and browse to the directory where plugins are located that you wish to add to PaintShop Pro. Click on OK once you've located the directory, then click on OK again to close the File Locations window.

Plug-ins File Locations

Make sure Enable is checked in the File Locations window and Use sub folders, if the plug-ins are within a subfolder of a selected folder.

To use an added plugin, click on Effects, then Plugins, then select the plugin you wish to use.

Select_Plugin.png

[/os/windows/software/graphics/corel/psp] permanent link

Sun, May 10, 2015 5:55 pm

Google Index Status and Crawl Errors

If you use Google Analytics to monitor your site, Google provides a number of reports that can be used to find issues related to Google's crawling of your site, such as Google Index Status and Crawl Errors.

For instance, I often use Google to find articles on my own site when I encounter a problem that I resolved previously while working on someone's computer when I can't remember exactly what I did previously or the cause of the same issue when I previously encountered it. I go to google.com and spcify some keywords I know would be on the page or blog posting I created and follow the keywords with site:support.moonpoint.com so Google returns only results from my site. But I've recently found that Google is reporting it has found no results for my site when I know it should be finding them since I know the Googlebot has crawled the site subsequent to my posting the entries on the site, some of which I posted quite some time ago, and since it has shown me results that indicate it has indexed material from the site only the day before. Checking the Index Status report for my site, I found that the number of pages indexed has declined considerably since this time last year, whereas I haven't deleted pages and have added over one hundred pages/blog entries since that time. Checking the Crawl Errors report, I see quite a few "Not found" entries I need to fix, but they don't explain the decline in the number of indexed entries, so I know I need to do further investigation.

[/network/web/services/google/analytics] permanent link

Sat, May 09, 2015 8:12 pm

Quicken 2015 Mortgage Balance Discrepancy

I use Quicken 2015 Home & Business to manage our finances. One annoyance I encountered recently was that when I viewed the details for the mortgage account, the balance was listed correctly, but on the left side of the screen where the balances are listed for all accounts, the balance shown for the mortgage account under the Property section was wrong. The amount that was displayed was the amount shown for the current balance when I looked at the transaction display for the account plus the original balance when we purchased the house. The two balances had matched previously; I think the incorrect amount under the Property section of Accounts started appearing with an incorrect amount after I reconciled all of the transactions in the mortgage account. But even after I unchecked entries to make them unreconciled to see if that would eliminate the discrepancy, the discrepancy remained. And that discrepancy resulted in an incorrect equity being shown when I clicked on Equity when viewing the mortgage account. The equity was being shown as a negative value, i.e., Quicken was claiming I owed more on the house than the house was worth.

I exited from the program then restarted it, but the discrepancy remained. So I decided to backup the Quicken data file and then perform a repair operation. So I backed up our data by going to File, Backup and Restore, then Backup Quicken File. Then, to run a repair operation, I clicked on File then File Operations. From that option I could select Validate and Repair, but before I selected it, I noticed that now the amount shown for the balance owed on the mortgage was correct under Property in the listing of accounts. It seems that just performing the backup resulted in the discrepancy being resolved. I certainly didn't expect that to resolve the problem, but I was glad just doing that apparently resolved the problem. Quicken was also now showing a correct positive equity value based on what I had estimated for our home's current value minus what we still owed on the mortgage.

[/financial] permanent link

Fri, May 08, 2015 10:11 pm

High Chrome memory utilization

Checking on the cause for slow performance on a Microsoft Windows system, I opened the Task Manager and saw that memory utiilization was high. Clicking on the Memory column header to order the list of processes by memory utilization, I saw that the Google Chrome web browser was consuming most of the memory; there were many Chrome tabs open in the browser.

Task Manager - Chrome Memory Utilization

I could see that the Chrome tab consuming the most memory was one consuming 937.2 MB of memory.

To determine what webpages associated with tabs open in Chrome are consuming excessive amounts of memory or CPU time, put chrome://memory in the address bar of the browser. That will provide information on the amount of memory consumed by each tab open in the browser as can be seen in this example. Since the entries aren't ordered by memory utilization, you will need to scroll through the list to find the tabs consuming the most memory.

In this case, when I scrolled through the list I saw the tab that was consuming 937.2 MB of memory had a CNN.com article open in it. When I went to that tab I saw a "Shockwave Flash has crashed" message at the top of the tab. When I clicked on "Reload", I saw that memory utilization for that tab inreased slightly. Moving back to a prior page in the tab with the back arrow resulted in the Task Manager then showing the highest memory utilization for a Chrome process to be about half the 937.2 MB shown previously. I closed the tab to free memory.

[/network/web/browser/chrome] permanent link

Thu, May 07, 2015 10:32 pm

Increasing disk space for a VM under VMWare Fusion 5.0.5

If you find that the disk drive space you originally allocated for a Virtual Machine (VM) under VMWare is now inadequate, the process for increasing the size of the drive allocated to the VM is fairly simple, but you will have to delete any existing snapshots before you can increase the size of the disk drive for the VM, which, though easily done, can take take some time - I found it took an hour on my MacBook Pro to delete a snapshot for a Windows XP VM. Once you've deleted existing snapshots, you can then expand the disk drive size to accomodate your needs. Files with a .vmdk extension are created to hold the VM's disk drive.

[ More Info ]

[/VM/vmware] permanent link

Wed, May 06, 2015 9:29 pm

Curl SSL certificate problem

When attempting to download a file via HTTPS from a website using curl, I saw the error message "SSL3_GET_SERVER_CERTIFICATE:certificate verify failed".

$ curl -o whitelist.txt https://example.com/BLUECOAT/whitelist.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0c
url: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify fail
ed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

When I added the -k option, I was able to download the file successfully.

$ curl -o whitelist.txt -k https://example.com/BLUECOAT/whitelist.txt

But I wanted to know what the issue was with the public key certificate and I wanted to get that information from a Bash shell prompt. You can get the certificate from a website using the command openssl s_client -showcerts -connect fqdn:443, where fqdn is the fully qualified domain name for the website, e.g. example.com. Port 443 is the standard port used for HTTPS. The certificate should be stored as a .pem file. When I used openssl s_client -showcerts -connect example.com:443 >example.pem, I saw the message "verify error:num=19:self signed certificate in certificate chain" displayed, which revealed the source of the problem.

A self-signed certificate is one that has been signed by the same entity whose identity it certifies. For a site using a self-signed certificate, your traffic to and from that site is protected from eavesdroppers along the path of the traffic, but the certificate doesn't offer validation that the site belongs to the entity claiming to own it. But, if you have other reasons to trust the site or are only concerned about third parties eavesdropping on your communications with the site, then a self-signed certificate may be adequate. E.g., the site could be your own site or belong to someone or an entity you know is in control of the website. Some organizations use self-signed certificates for internal sites with the expectation that members/employees will ignore browser warnings for the internal websites, though if people become accustomed to ignoring such errors there is the danger that they will also be more prone to ignore such warnings for external sites where a site's true controlling entity isn't the one they expect.

$ openssl s_client -showcerts -connect example.com:443 >example.pem
depth=1 /C=US/ST=Maryland/L=Greenbelt/O=ACME/OU=EXAMPLE/CN=EXAMPLE CA
verify error:num=19:self signed certificate in certificate chain
verify return:0
read:errno=0

The s_client parameter uses a generic SSL/TLS client to establish the connection to the server.


       s_client  This implements a generic SSL/TLS client which can establish
                 a transparent connection to a remote server speaking SSL/TLS.
                 It's intended for testing purposes only and provides only
                 rudimentary interface functionality but internally uses
                 mostly all functionality of the OpenSSL ssl library.

The certificate is stored in example.pem in this case. You would need to edit the file to remove everything but the "BEGIN CERTIFICATE" and "END CERTIFICATE" lines below and the lines that lie between those two lines.

-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----

Or you can use a Bash script retrieve_certifcate to obtain the certificate; it will stip off the extraneous lines. The code for the script is shown below:

#!/bin/sh
#
# usage: retrieve-cert.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}

echo |\
openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |\
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'

You can obtain information for the certificate from the PEM file using the command openssl x509 -text -in example.pem. If -issuer is appended, then only the issuer information will be displayed, so I could see that the cerificate was self-signed with the following command:

$ openssl x509 -noout -in example.pem -issuer
issuer= /C=US/ST=Maryland/L=Greenbelt/O=ACME/OU=EXAMPLE/CN=EXAMPLE CA

If you just want to verify the status of a certificate from the command line without storing the certificate locally, you can add the -verify 0 option.


       -verify depth - turn on peer certificate verification

E.g.:

$ openssl s_client -showcerts -verify 0 -connect example.com:443 
verify depth is 0
CONNECTED(00000003)
depth=1 /C=US/ST=Maryland/L=Greenbelt/O=ACME/OU=EXAMPLE/CN=EXAMPLE CA
verify error:num=19:self signed certificate in certificate chain
verify return:0
88361:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed:/SourceCache/OpenSSL098/OpenSSL098-52.6.1/src/ssl/s3_clnt.c:998:

You can ignore all output from the command but the "verify error" line with commands like the following:

$ openssl s_client -showcerts -verify 0 -connect example.com:443 2>&1 | grep "verify error"
verify error:num=19:self signed certificate in certificate chain

For another internal website, when I accessed the site in Firefox with https://cmportal, Firefox reported the following:

This Connection Is Untrusted

You have asked Firefox to connect securely to cmportal, but we can't confirm that your connection is secure.

Normally, when you try to connect securely, sites will present trusted identification to prove that you are going to the right place. However, this site's identity can't be verified.

What Should I Do?

If you usually connect to this site without problems, this error could mean that someone is trying to impersonate the site, and you shouldn't continue.

When I viewed the technical details for the certificate, Firefox informed me that:

code760cmportal uses an invalid security certificate. The certificate is only valid for the following names: 192.168.160.242, servera.example.com (Error code: ssl_error_bad_cert_domain)

When I tried downloading the home page for the site with curl, I saw the message below:

$ curl https://cmportal
curl: (51) SSL peer certificate or SSH remote key was not OK

I was able to get past that error with the -k or --insecure parameter to curl, though then the page returned reported I was being denied access to the requested web page due to invalid credentials.

I downloaded the certificate for that site with openssl; since openssl would wait for input after verify return:0, I used an echo "" | to get it to complete.

$ echo "" | openssl s_client -showcerts -connect cmportal:443 >example.pem
depth=2 /C=US/O=Acme/OU=Anvils/OU=Certification Authorities/OU=Anvils Root CA
verify error:num=20:unable to get local issuer certificate
verify return:0
DONE

I removed all the lines before "BEGIN CERTIFICATE" and all those after "END CERTIFICATE" and then checked the certificate for that .pem file with the openssl command. That showed me a reference to servera whereas I had accessed the site using cmportal..

$ openssl x509 -noout -in example.pem -subject
subject= /C=US/O=Acme/OU=Anvils/OU=Services/CN=servera.example.com

If you've accepted a self-signed certificate, or a certificate with other issues, in Firefox, you can view the certificate following the steps noted in Forgetting a certificate in Firefox.

References:

  1. Retrieving Password Protected Webpages Using HTTPS With Curl
    Date: September 8, 2011
    MoonPoint Support
  2. How To Verify SSL Certificate From A Shell Prompt
    Date: May 23, 2009
    nixCraft
  3. Example sites with broken security certs [closed]
    Asked: November 9, 2009
    Stack Overflow
  4. Command line tool for fetching and analyzing SSL certificate
    Asked: April 17, 2014
    Server Fault
  5. OpenSSL Command-Line HOWTO"
    Published: June 13, 2004
    Most recent revision: June 25, 2014
    By: Paul Heinlein
    madboa.com
  6. x509 - Certificate display and signing utility
    OpenSSL: The Open Source toolkit for SSL/TLS

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

Tue, May 05, 2015 10:32 pm

Checking WiFi status on Mac OS X

To check the status of a WiFi connection on a Mac OS X system, you can click on the wireless networking icon, which is a series of curved lines one beneath the other, at the top of the screen while holding down the Option key. You will then see the currently connected WiFi network with a check mark next to it and details regarding the wireless connection.

WiFi status

The following parameters will be displayed for the wireless connection currently in use:

For information on checking signal stength and other wireless parameters from the command line on an OS X system, see Checking WiFi signal strength from the command line on OS X.

[/os/os-x/wireless] permanent link

Mon, May 04, 2015 10:24 pm

Outlook 0x800ccc0f error message

I had a user on a Windows 7 system contact me today to report that he was unable to check email from his system, but others at his location were not experiencing problems. He was able to get to websites with his browser, so there didn't appear to be an issue with Internet access. He told me that Outlook was displaying a 0x800ccc0f error message, but he didn't know what version of Outlook was present on his system, so I had him check in Outlook by going to Help then About Microsoft Office Outlook. He reported the version number was 14.0. I had to look up the version name corresponding to that number. The name to version number correlation is shown below:
Version NameVersion Number
Outlook 978.0
Outlook 988.5
Outlook 20009.0
Outlook XP/200210.0
Outlook 200311.0
Outlook 200712.0
Outlook 201014.0
Outlook 201315.0

So that version corresponded to Outlook 2013. With the version number, I was able to provide instructions on how to determine what POP3 server was handling his email. It was pop3.firespring.com, so I had him run a traceroute to it, i.e., tracert pop3.firespring.com. He told me that was not completing successfully and some of the lines had values of over 100 ms for the time for a response from the system at that particular hop, so I at first thought there might be a congestin issue with the network path to the mail server. If other systems on the same LAN weren't experiencing the problem, then perhaps his system was more sensitive to delays, perhaps with a lower timeout value. But when I tried a traceroute from a Mac system, I saw the same traceroute issue, but a telnet connection to the POP3 mail server on the POP3 port, port 110, i.e., telnet pop3.firespring.com 110 resulted in an immediate OK response from the server which seemed to rule out that hypothesis. So I suggested he contact his mail service provider which found that he had an unusually large message on the server. When that message was deleted from the server by the email server provider his problem went away; apparently Outlook on his system was timing out when it couldn't download that message in a reasonable amount of time and then displaying the 0x800ccc0f error message.

References:

  1. Outlook versions and trivia
    MSOutlook.info

[/os/windows/office/outlook] permanent link

Fri, May 01, 2015 10:16 pm

elemarketers spoofing calling numbers

The U.S. Federal Communications Commission (FCC) in conjuction with the Federal Trade Commission (FTC) estabilshed a Do Not Call List. U.S. residents who don't want to receive calls from telemarketers can add their phone numbers to the FCC's Do Not Call Registry. Once a number has been added to the registry, telemarketers are not supposed to call the number unless one of the following conditions applies:

I've had our phone numbers on the registry for years. I believe adding the numbers may have reduced the telemarketing calls, but many telemarketers ignore the Do Not Call Registry. I have been filing a complaint through the FTC National Do Not Call Registry website whenever I receive such calls. I fill out the Submit a Complaint form after receiving such calls in hopes that if many others are submitting complaints regarding the same calling number that the telemarketing company will be fined for its disregard of the regulations that apply to them.

Lately, though, I've been finding that a large number of such calls are from "spoofed" numbers. E.g., today I received a robocall with a spiel that began with "This is Rachel at Card Holder Services". The spiel ended with a note that this would be my final notice, but I've been receiving such telemarketing calls from "Rachel at Card Holder Services" for months, each ending with the reference to a "final notice". The only option at the end of the spiel was to hit 9 to speak to someone. The person remarked about my desire to reduce my credit card rate; I said "No, I want to be removed from the calling list". I asked very politely, but the person immediately disconnected. I called the number that appeared as the calling number on my cell phone. After several rings, I received a recorded message typical of what you would find on someone's personal voicemail. I figured the telemarketer had spoofed the calling number and didn't leave a message, but a short while later I received a call from the person who had that number who was wondering who had called him and why. I told him about the telemarketing call and said I suspected when I heard his voicemail that a telemaketer had spoofed his number. He understood and mentioned he finds telemarketing calls annoying as well. The area code and first 3 numbers of his number matched those for my cell phone, likely because the telemarketer by using a number that would seem to be local to me would be more likely to have someone answer the robocall. Some people may avoid the plague of telemarketing calls by only answering numbers they recognize, but I use my cell phone for work and can't tell by looking at an incoming number whether it is a work-related call or an annoying telemarketer, since I can't know the number for everyone who may call me on a work-related matter and those calling on work-related matters may be in other parts of the country. Nor can one even reliably assume today that an area code reveals the geographical area of the caller.

As long as a significant percentage of people buy whatever a telemarketer is selling, telemarketers won't stop calling no matter how annoying most people find such calls. But someone would be exceedingly foolish to provide a credit card number and other personal information to some unknown caller offering to reduce one's credit card rate in return for providing such information to the caller. Since I've been getting such calls for months, I can only assume that a significant number of people do so, though. When I know the caller is ignoring the Do Not Call Registry, I assume that the caller's business practices are dubious at best. And certainly when the calling number has been spoofed, it would be prudent to assume that the caller is a scammer who may use any credit card number you provide for his own nefarious ends or sell it to others.

According to the FCC Caller ID and Spoofing page a telemarketer must:

Under the Truth in Caller ID Act, violators can be subjected to a penalty of up to $10,000 for each violation of the rules.

So what can you do in such cases? I filed a complaint for the above mentioned call via the FTC Do Not Call Registry complaint form. You can also file a complaint through the FCC's consumercomplaints.fcc.gov site by submitting a Phone Complaint. For the "Phone Issues" field, you can select "Telemarketing (including do not call and spoofing". It only takes a few minutes to complete the complaint forms and I filed a complaint in this case there as well.

Will filing such complaints do any good? The Rachel With Cardholder Services’ Coughs Up Refunds article published on January 19, 2015 on the ABC News site notes:

The Federal Trade Commission, the nation’s consumer watchdog, has reached a settlement with a collection of companies it says used that ploy. And now a special administrator is preparing to mail out checks to victims.

The total amount available to repay consumers is $700,000. The FTC says it is mailing out 16,590 checks this week. Each check will be for $42.95 and must be cashed within 60 days.

But that article also notes:

In fact, after the FTC took its first action against “Rachel,” investigators were frustrated when the calls continued, likely placed by other sketchy companies.

I'm not looking for a remuneration for the disruption to my work and wasted time from such calls, but I would like to see companies that ignore the Do Not Call Registry and use spoofed numbers fined and, hopefully, put out of business. I hope that others will also file complaints and that an accumulation of such complaints will lead the FTC or FCC to track down at least some of these companies and take action against them.

[/phone] permanent link

Fri, May 01, 2015 6:11 pm

How to fix a problem with Entourage 2008 not indexing all email

After an issue with my MacBook Pro a few weeks ago that resulted in Microsoft Entourage 2008 for Mac crashing, I found that searches for email would not return all pertinent messages. I could search on subject, "from" addresses, etc. and see results, but not all messages I knew were in the inbox or other folders. E.g., if I searched by subject for daily logs I receive, the search would not return any messages between December 31, 2014 and March 31, 2015, though I could see they were in the inbox if I ordered it by subject.

To correct the problem, I clicked on the Apple icon in the upper, left-hand corner of the screen, chose System Preferences and then Spotlight from the Personal group. I confirmed that Messages & Chats was checked (all entries were checked by default).

Spotlight Search Results

I then clicked on the Privacy button.

Spotlight Privacy

Within the Privacy window, I clicked on the plus sign, "+", and addeded my home directory, e.g., jdoe, to the list of directories that should not be searched. When you do so, a warning window will open with a message similar to the one below:

Are you sure you want to prevent Spotlight from searching in "jdoe"?

If you exclude this location from Spotlight searches, the search feature won't work in some applications.

Clicking on OK will add the directory and its subdirectories to the exclusion list. After adding the home directory, I clicked on it to highlight and select it, then clicked on the minus sign, "-" to remove the directory from the exclusion list and cause a reindexing of that directory. I then closed the Spotlight window.

I don't know how long the reindexing process took to complete. I didn't peform any further searches in Entourage until the following day; at that time searches did return all messages.

[/network/email/clients/entourage] permanent link

Thu, Apr 30, 2015 11:17 pm

Forgetting a certificate in Firefox

While using a MacBook Pro with Firefox ESR 31.6.0, I needed to have it "forget" a certificate for a website that I had it temporarily accept, because of an issue with the site's certificate. The process for doing so is as follows:
  1. In Firefox, click on the icon of three short horizontal bars at the upper, right-hand corner of the Firefox window, which will give you a menu where you should select Preferences.
  2. Select Advanced and click on the Certificates tab under it.

    Firefox - Advanced - Certificates

  3. Click on View Certificates.
  4. Click on the Servers tab.

    Firefox Certificate Manager - Servers

  5. Locate the server for which you wish to delete the certificate. It will have a lifetime value of "Permanent", if you permanently accepted it or a value of "Temporary", if you only temporarily accepted it. Click on it to highlight it, then click on the Delete button.
  6. You will then see a message asking "Are you sure you want to delete these server exceptions", which will show the server(s) you have selected and also note "If you delete a server exception, you restore the usual security checks for that server and require it uses a valid certficate." Click on OK. If you want to view the certificate before deleting it, you can click on the View button.
  7. Click on OK to close the Certificate Manager window. You can then close the Advanced window.

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

Wed, Apr 29, 2015 11:17 pm

Importing text data from a webpage into Excel 2013

I needed to import a whitelist consisting of a list of fully qualified domain names from a web page into a Microsoft Excel spreadsheet. The web page was just a text file with one entry per line, which made it easy to import data directly from the page in Excel 2013. The steps to import such data from a web page are as follows:
  1. Click on Data from the menu at the top of the Excel window.
  2. Select Get External Data and From Web.

    Get External Data From Web

  3. Type the URL for the webpage from which you wish to obtain the data into the Address bar of the New Web Query window which will have opened.

    New Web Query

  4. The contents of the webpage will be displayed and you can click on the Import button.
  5. You will then be asked "Where do you want to put the data?" The default location will be $A$1, i.e., the cell in the first column and first row.

    Import Data

    You can change the location or leave it as is and then click on OK to have the data inserted in the sheet in the Excel workbook

If you need to update the data from the webpage when working in the spreadsheet later, you can select Refresh All all from the Excel toolbar and then select Refresh.

Import Data

The contents of the sheet will then be refreshed with the latest data from the web page.

[/os/windows/office/excel] permanent link

Tue, Apr 28, 2015 10:51 pm

Checking wifi signal strength from the command line on OS X

I took a friend to a VA hospital today. I took my MacBook Pro laptop with me and while I was there I used the wireless guest service at the facility. The performance of the wireless service was awful today as it was on a previous visit. To determine if the problem might be attributable to signal strength, I used the airport command, which is available on OS X systems. The utility is located in /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/. Help information on the command is available using airport -h.

$ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -h
Supported arguments:
 -c[<arg>] --channel=[<arg>]    Set arbitrary channel on the card
 -z        --disassociate       Disassociate from any network
 -I        --getinfo            Print current wireless status, e.g. signal info, BSSID, port type etc.
 -s[<arg>] --scan=[<arg>]       Perform a wireless broadcast scan.
				   Will perform a directed scan if the optional <arg> is provided
 -x        --xml                Print info as XML
 -P        --psk                Create PSK from specified pass phrase and SSID.
				   The following additional arguments must be specified with this command:
                                  --password=<arg>  Specify a WPA password
                                  --ssid=<arg>      Specify SSID when creating a PSK
 -h        --help               Show this help

To view the status for a wireless connection, use airport -I or airport --getinfo.

$ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
     agrCtlRSSI: -67
     agrExtRSSI: 0
    agrCtlNoise: -86
    agrExtNoise: 0
          state: running
        op mode: station 
     lastTxRate: 7
        maxRate: 144
lastAssocStatus: 0
    802.11 auth: open
      link auth: none
          BSSID: ec:44:76:81:e4:40
           SSID: VA Internet
            MCS: 0
        channel: 11

The signal strength for a connection is the value for agrCtlRSSI. "RSSI" stands for received signal strength indication. The higher the number, the stronger the wireless signal. The maximum value that may be reported will depend on the wireless devices being used. Cisco Systems wireless cards have a maximum value of 100 while Wi-Fi chipsets from Atheros will return a value from 0 to 128. For Apple OS X systems, the value will range from a high of 0 down to minus 100 (-100). The closer the number is to zero, the stronger the signal while the closer the number is to negative 100, the weaker the signal strength.

Since I only wanted to check the signal strength initially, I looked just for that value. The signal strength seemed to be ok for the waiting room I was in, though not terrific.

$ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep agrCtlRSSI
     agrCtlRSSI: -74
$ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep agrCtlRSSI
     agrCtlRSSI: -68

[ More Info ]

[/os/os-x/wireless] permanent link

Mon, Apr 27, 2015 11:30 pm

Mailman moderation bit

If you go to the membership management page for a Mailman mailing list, you will see a checkbox next to every member's address in a "mod" column and an option to "Set everyone's moderation bit, including those members not currently visible" near the bottom of the web page. If you check the mod checkbox next to the member's address, the list member will not be able to send messages to the list without the message being approved by the list owner or a moderator for the list.

When the box is checked for a member, postings from the member are held and administrators are notified of their existence. They may then approve or reject postings via the web interface. If unchecked postings to the list are immediately delivered to list membership.

If a list is to be used only for announcements from the list owner and designated moderators, then everyone else should have the box checked.

Note: Applies to Mailman 2.1.14 as well as other versions.

References:

  1. GNU Mailman List Management Guide v 2.0
    GNU Mailman Documentation

[/network/email/mailing_list/mailman] permanent link

Sun, Apr 26, 2015 9:47 pm

Changing the colors for a Terminal tab on OS X

The Terminal application in Applications/Utilities allows one to obtain a shell prompt on a Mac OS X system. You can specify the color scheme to use when opening a new tab. The default color scheme is "Basic", i.e., black text on a white background, but you can also choose from the following:

Grass
Homebrew
Man Page
Novel
Ocean
Pro
Red Sands
Silver Aerogel
Solid Colors

If after making a selection while working in that tab, you wish to change the colors, you can do so. E.g., if I had selected the "grass" color scheme, but wanted to change from yellow text on a green background to black text on a white background, I could so so by taking the following steps while working in that Terminal tab.
  1. From the Terminal menu, select Show Inspector or hit Command-I to bring up the Inspector window.

    Inspector Info

  2. Click on Settings. You will see the current color scheme highlighted, e.g., "Grass" in this instance.

    Inspector Settings

  3. Click on the new color scheme you wish to use, e.g., "Basic" for black text on a white background. As soon as you click on a new color scheme, the foreground and background colors will change.

[/os/os-x] permanent link

Sat, Apr 25, 2015 10:41 pm

Using netcat to simulate a web server

If you have a Mac OS X system or a Linux system, you can listen for connections from web browsers on the system by utilizing the netcat utility, which you can run by issuing the nc command from a Terminal window, i.e., a shell prompt. The Terminal application is found in Applications/Utilities on a Mac OS X system.

You won't get the functionality provided by installing web server software, such as the Apache HTTP Server, but you can use the command for testing or to provide one page that is visible to thers from their browsers. As an example, the command below instructs netcat to listen on port 8080 for connections and display the file index.html when the system is accessed on that port. If you pick a port above 1024, such as 8080 rather than 80, you don't need root (admin) privileges in order to have the system listen on the port, but, if you don't use the default port of 80, you need to specify the port used in the URL, e.g., http://www.example.com:80, when you try to connect with a browser.

nc -kl 8080 < index.html

In the above example, two options for netcat, -l and -k are combined into -kl. Their meaning and other options can be displayed by issuing the command nc -h.

     -k      Forces nc to stay listening for another connection after its cur-
             rent connection is completed.  It is an error to use this option
             without the -l option.

     -l      Used to specify that nc should listen for an incoming connection
             rather than initiate a connection to a remote host.  It is an
             error to use this option in conjunction with the -p, -s, or -z
             options.  Additionally, any timeouts specified with the -w option
             are ignored.

If you are running the command on an OS X system, you may see a window appear asking whether you wish to allow netcat to receive incoming connections.

To access the web page from a browser on the system on which you run the command, or from another system, you will need to specify an appropriate IP address for the system, which you can get using the ifconfig -a command, or a fully qualified domain name for it. If the system is accessible from the Internet, you can determine what IP address others need to use by visiting WhatIsMyIP.

E.g., suppose the IP address for the system is 192.168.1.5. That IP address is private IP address space, so wouldn't be accessible from the Internet, but you would substitute whatever IP address others would see for the system, if you had a system that was accessible from the Internet, e.g., whatever address WhatIsMyIP would show if you visited that website using a browser on the system. If you put in http://192.168.1.5:8080, or substituting whatever port number you picked instead of 8080, in a web browser, then you should see the contents of index.html displayed.

If you only need access from a browser on the system itself, then you can just put in the system's localhost, aka, local loopback, address, which is 127.0.0.1. E.g., if you had netcat listen for connections on ort 8080, you could use http://127.0.0.1:8080.

You can use whatever file name you like, e.g., test123.html will work equally as well. If you specified that file name, using http://192.168.1.5:8080 would display the contents of that file without it being specified in the address bar of the browser.

Some browsers may expect the normal status returned by a web server when a page is accessed, so you may want to include the following line at the top of index.html or whatever file you specify. Follow the line with a blank line.

HTTP/1.1 200 OK

E.g., below is a sample index.html file that could be used.

HTTP/1.1 200 OK

<HTML>
<HEAD>
<TITLE>Testing</TITLE>
</HEAD>

<BODY>
<H1 align="Center">Test</H1>
<a href="http://support.moonpoint.com">Moonpoint Support</a><br>
</BODY>

</HTML>

If you don't include the "HTTP/1.1 200 OK" line followed by a blank line, you may see a message such as "The connection was reset" or some other error message, so I would recommend including it.

Until you hit Control-C at the command prompt window, netcat will continue to listen for connections and you will see the HTTP commands issued by browsers. E.g., I might see the following when http://192.168.1.5:8080 is placed in the address bar of Firefox.

GET / HTTP/1.1
Host: 192.168.1.5:8080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Firefox/31.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

GET /favicon.ico HTTP/1.1
Host: 192.168.1.5:8080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Firefox/31.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

Note: if the system on which you are running the netcat command is running host-based firewall software, you may need to configure that software to allow incoming connections on the port you specified in the netcat command in order for connectivity to work. E.g., see Opening a firewall port for Firewalld from the command line for the command to use on a CentOS Linux system running FirewallD.

References:

  1. One command line web server on port 80 using nc (netcat)
    Date: August 31, 2011
    commandlinefu.com

[/network/tools/netcat] permanent link

Fri, Apr 24, 2015 5:07 pm

Opening a firewall port for Firewalld from the command line

You can see what services and ports already have firewall rules permitting access to the ports on a CentOS system using FirewallD for the firewall service from a shell prompt with firewall-cmd --list-services and firewall-cmd --list-ports.
# firewall-cmd --list-services
dhcpv6-client http pop3s smtp ssh
[root@localhost ~]# firewall-cmd --list-ports
110/tcp 4343/tcp 143/tcp

If you wish to permit access on an additional port you can use the --add-port option. Specify the zone to which the rule should apply with --zone and specify UDP or TCP with /protocol after the port number, where protocol is either udp or tcp.

[root@localhost ~]# firewall-cmd --zone=public --add-port=8080/tcp
success
[root@localhost ~]# firewall-cmd --list-ports
110/tcp 4343/tcp 8080/tcp 143/tcp

Note: in the above example the firewall rule is only added temporarily; it won't persist after a reboot of the system. To make the rule permanent requires the use of the --permanent option and a restart of the firewall service with systemctl restart firewalld.service or firewall-cmd --reload. E.g.:

firewall-cmd --permanent --zone=public --add-port=8080/tcp
systemctl restart firewalld.service

If you wish to see a list of the configured zones on the system, use the --get-zones option.

[root@localhost ~]# firewall-cmd --get-zones
block dmz drop external home internal public trusted work

If you wish to see the open ports for a particular zone, you can specify the zone with --zone=. E.g.:

[root@localhost ~]# firewall-cmd --zone=public --list-ports
110/tcp 4343/tcp 8080/tcp 143/tcp

If you wish to remove access to a port for which you have permitted connectivity, you can use the --remove-port option. If you specify a port for which there is no rule permitting access, you will see a "Warning: NOT_ENABLED" message. E.g.:

# firewall-cmd --remove-port=443/tcp
Warning: NOT_ENABLED
[root@localhost ~]# firewall-cmd --list-ports
110/tcp 4343/tcp 8080/tcp 143/tcp
[root@localhost ~]# firewall-cmd --remove-port=8080/tcp
success
[root@localhost ~]# firewall-cmd --list-ports
110/tcp 4343/tcp 143/tcp

If you are removing a permanent entry, specify the --permanent option and reload the firewall softward afterwards. E.g.:

[root@localhost ~]# firewall-cmd --remove-port=8080/tcp --permanent
success
[root@localhost ~]# firewall-cmd --reload
success

References:

  1. Monitoring Failed SSH Logins to a CentOS System
    Date: November 9, 2014
    MoonPoint Support
  2. RHEL7: How to get started with Firewalld.
    Last updated on April 14, 2015
    CertDepot

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

Thu, Apr 23, 2015 9:30 pm

Enabling audio on a Windows Server 2012 system

By default, Windows Server 2012 doesn't have the audio service enabled, likely because it won't be needed on many servers, which may not even have speakers attached to them. You can enable the service by several different methods. You can run services.msc and start the Windows Audio service. You can also change the startup type from manual to automatic to have the service start automatically when the system boots. Another method for enabling the audio service is to right-click on the speaker icon in the notification area at the lower, right-hand corner of the screen and choose Playback devices. You will then see a message asking whether you wish to enable the audio service. If you choose "Yes", the service will be enabled and the startup type will be changed to automatic so the service will start whenever Windows loads.

[ More Info ]

[/os/windows/server2012] permanent link

Wed, Apr 22, 2015 9:47 pm

Opening the Device Manager from a command prompt on Windows 8

To open the Device Manager window on Windows 8 from a command prompt, take the following steps:
  1. Right-click on the Start button in the lower-left corner of the screen.
  2. If you are logged in under a standard user account and only want to view device settings, you can choose Command Prompt. If you may need to change settings and aren't logged in under an account in the administrators group, choose Command Prompt (Admin). If you choose the latter, you will be prompted for administrator credentials; provide a user name and password for an administrator account. When you choose Command Prompt (Admin), the title of the window that opens is "Administrator Command Prompt" versus "Command Prompt" if you open the command prompt window using a standard account.
  3. When the Command Prompt window opens type devmgmt.msc at the command line and hit Enter. If you are logged on with an account that does not have administrator privileges and haven't opened an Administrator Command Prompt window, you will see the message below:

    You are logged on as a standard user. You can view device settings in Device Manager, but you must be logged on as an administrator to make changes.

    You can then click on the OK button to view information for devices listed in the Device Manager. If you've run devmgmt.msc from an Administrator Command Prompt window you will have view and modification capabilities.

[/os/windows/win8] permanent link

Tue, Apr 21, 2015 11:25 pm

Checking the battery temperature for a MacBook Pro laptop

I wanted to check the temperature of components in a MacBook Pro laptop running OS X 10.8.5, aka Mountain Lion, from the command line. A Bash script by jondthompson, which is a fork of a script posted by earlonrails, to check the battery temperature that can be run from a Terminal window can be found at GitHub Gist at battery_temperature.sh. I've also included the code below.
#!/bin/bash
# battery_temperature for mac osx 10.9.2
if [ `uname` == "Darwin" ]; then

if [ "$1" == "-h" ]; then
echo "Usage: $(basename $0 ".sh") [option]"
echo " -l also show Model Name and Processor Name"
echo " -h display this help message"
exit
fi

# -l display Model Name and Processor Name
if [ "$1" == "-l" ]; then
system_profiler SPHardwareDataType | awk '/Model Name/ || /Processor Name/' | sed 's/[^:]*: //' | awk '{ printf $0 " " }'
echo
fi

# sensor data
temperature=`ioreg -r -n AppleSmartBattery | grep Temperature | cut -c23-`
temperature_celsius=`echo "scale = 2; $temperature / 100.0" | bc`
echo "AppleSmartBattery Temperature: "
echo $temperature_celsius °C
temperature_fahrenheit=`echo "scale = 2; ($temperature_celsius * (9 / 5)) + 32.0" | bc`
echo $temperature_fahrenheit °F

# error message if unsupported machine
else
echo -e "\nThis appears not to be an OS X machine\n"
fi

After making the script executable, when I ran it on a 15-inch, Mid 2009 MacBook Pro laptop, I saw the following:

$ chmod +x battery_temperature.sh
$ ./battery_temperature.sh 
AppleSmartBattery Temperature: 
30.46 °C
86.82 °F

[/os/os-x] permanent link

Mon, Apr 20, 2015 10:53 pm

Disabling Automatic Restart for Windows Server 2012 Essentials

As with other verions of Microsoft Windows, such as Windows XP, Vista, 7, 8, you may find Microsoft Windows Server 2012 and the Windows Server 2012 Essentials edition rebooting the system at inopportune times for updates. You can temporarily delay the shutdown by issuing the command net stop "windows update" at a command prompt. Note: you need to open an admin command prompt to do so, which you can do by moving the mouse pointer to the lower, left-hand corner of the screen, then right-clicking on the Start button when it appears and choosing Command Prompt (Admin). But that wil only postpone the reboot, because Windows will later restart the service on its own, even if you don't reboot. You can determine if it has restarted by reissuing the command. You will see a message "The Windows Update service is not started", if it isn't running.

You can pemanently disable the automatic restart by changing the group policy for the system by running gpedit.msc, which you can run by issuing the command gpedit at a command prompt or by right-clicking on the Start button, choosing Run and then typing gpedit.msc and hitting Enter. When the Local Group Policy Editor window opens, navigate to Computer Configuration > Administrative Templates > Windows Components > Windows Update. In the right pane of the window, you will see "No auto-restart with logged on users for scheduled automatic updates installations". Change the setting from "Not Configured" to "Enabled".

[ More Info ]

[/os/windows/server2012] permanent link

Thu, Apr 16, 2015 11:16 pm

Adding a Konica Minolta BizHub 363 printer from the command line on OS X

I needed to add a Konica Minolta BizHub 363 multifunction device as a printer on my MacBook Pro laptop, since the default printer was inaccessible today. So I checked if there was a printer driver for it already on the laptop in /Library/Printers/PPDs/Contents/Resources. I saw one there, so added it from a Terminal window, i.e., a shell prompt.
$ ls -l /Library/Printers/PPDs/Contents/Resources | grep -i Konica | grep 363
-rw-r--r--  1 root  wheel   42781 Sep  3  2012 KONICAMINOLTA363.gz
$ lpadmin -p "192.168.233.8" -v "lpd://192.168.233.8" -D "Konica Minolta BizHub 363 MFD" -L "Building 14 Room E171" -P "/Library/Printers/PPDs/Contents/Resources/KONICAMINOLTA363.gz" -E 

When adding a printer from the command line on an OS X system, you can specify the IP address of the printer with the -p (lowercase "p") argument to the lpadmin command. Other arguments for the command include the following:

       -v "device-uri"
            Sets  the  device-uri  attribute  of the printer queue. Use the -v
            option with the lpinfo(8) command  to  get  a  list  of  supported
            device URIs and schemes.

       -D "info"
            Provides a textual description of the destination.

       -L "location"
            Provides a textual location of the destination.

       -P ppd-file
            Specifies  a  PostScript  Printer Description file to use with the
            printer. If specified, this option overrides the -i option 
            (interface script).

The text enclosed in quotes after the -D can be any description you want to give to the printer and the -L is any text you wish to use to indicate the location of the printer.

For the -P (uppercase "P") option, I referenced the Konica Minolta BizHub 363 PostScript Printer Description file I saw on the system.

The -v option is followed by a uniform resource identifier (URI). In this case that was lpd:// followed by the IP address of the printer because the printer supports the Line Printer Daemon protocol.

After you've added a printer, you can verify that it has been added using the lpstat command. E.g., lptstat -p -d shows all of the printers added to the system and the default printer for the system.

       -d
            Shows the current default destination.

       -h server[:port]
            Specifies an alternate server.

       -l
            Shows a long listing of printers, classes, or jobs.

       -o [destination(s)]
            Shows the jobs queue on the specified destinations. If no destina-
            tions are specified all jobs are shown.

       -p [printer(s)]
            Shows the printers and whether or not they are enabled for  print-
            ing. If no printers are specified then all printers are listed.

E.g., I can see that the printer I added is enabled. I can also see that the default printer is at 192.168.234.59, which was inaccessible to me today because the room it is in was locked.

$ lpstat -p -d
printer 192.168.233.8 is idle.  enabled since Thu Apr 16 14:12:21 2015
printer 192.168.234.59 is idle.  enabled since Thu Apr 16 13:59:17 2015
	Data file sent successfully.
printer _192_168_232_14 disabled since Wed Aug 17 14:52:55 2011 -
	/usr/libexec/cups/backend/lpd failed
printer _192_168_235_214 disabled since Tue Dec 27 09:55:45 2011 -
	Printer not responding!
printer _192_168_75_20 is idle.  enabled since Sat Jun 29 10:21:21 2013
system default destination: 192.168.234.59

References:

  1. Adding a printer from the command line on an OS X system
    Date: August 7, 2014
    MoonPoint Support

[/os/os-x] permanent link

Tue, Apr 14, 2015 10:22 pm

Locating EIN in QuickBooks 2011

To locate the U.S. Federal Employer Identification Number (EIN) issued by the Internal Revenue Service (IRS) in QuickBooks 2011, open the company file using a QuickBooks admin account then take the following steps:
  1. Select Company from the menu bar.
  2. Select Company Information. The EIN is in the Company Identification section.

The information can only be viewed or modified from a QuickBooks admin account.

[/financial] permanent link

Mon, Apr 13, 2015 11:25 pm

Finding files and/or directories with no owners

On a Unix/Linux system, you can locate files or directories that don't belong to a valid user account or group on the system with the command find and the -nouser or -nogroup option.
       -nogroup
              No group corresponds to file's numeric group ID.

       -nouser
              No user corresponds to file's numeric user ID.
E.g., to find any such files in the current directory and below it, I can use find . -nouser
# find . -nouser
./temp
./temp/bounced.txt
./temp/._Oct14(10-2).pdf
./temp/._Oct14.doc

The above example shows that the directory temp and three files within it don't have a valid owner. Checking them with the ls command, I see a long sequence of digits listed for the ower and group instead of an account listed in /etc/passwd or /etc/group.

# ls -ld temp
drwxr-xr-x. 2 723184451 1286109195 74 Feb 13 17:09 temp
# ls -al temp
total 60
drwxr-xr-x. 2 723184451 1286109195    74 Feb 13 17:09 .
drwx------. 8 jasmith1  jasmith1    4096 Apr 10 22:26 ..
-rw-r--r--. 1 723184451 1286109195 45333 Oct  6  2014 bounced.txt
-rw-r--r--. 1 723184451 1286109195   192 Oct  6  2014 ._Oct14(10-2).pdf
-rw-r--r--. 1 723184451 1286109195   192 Oct  6  2014 ._Oct14.doc

Files or directories with no group listed in /etc/group corresponding to the numeric group id for the file or directory can be found with find . -nogroup to search in and beneath the current directory or find / -nogroup to search starting at the root directory.

# find . -nogroup
./temp
./temp/bounced.txt
./temp/._Oct14(10-2).pdf
./temp/._Oct14.doc
./mail
./mail/.imap
./mail/.imap/INBOX
./mail/.imap/INBOX/dovecot.index.cache
./mail/.imap/INBOX/dovecot.index
./mail/.imap/INBOX/dovecot.index.log
# ls -ld mail
drwx------. 3 jasmith1 508 18 Sep 29  2014 mail
# ls -al mail/.imap/INBOX
total 20
drwx------. 2 jasmith1 508    76 Sep 29  2014 .
drwx------. 3 jasmith1 508    18 Sep 29  2014 ..
-rw-------. 1 jasmith1 508   144 Sep 29  2014 dovecot.index
-rw-------. 1 jasmith1 508 10272 Sep 29  2014 dovecot.index.cache
-rw-------. 1 jasmith1 508    96 Sep 29  2014 dovecot.index.log 

You can use the -o option for "or" to find files and directories that either don't have a user account associated with the numeric user id or don't have a group associated with the numeric group id. E.g., find . -nogroup -o -nouser.

If you delete an account or group from the system, files or directories that remain that had that owner or group will then be displayed with the user id and group id associated with the account or group that was deleted when you use the ls command.

[/os/unix/commands] permanent link

Sun, Apr 12, 2015 3:46 pm

Using offset in Apache OpenOffice Calc

As does Microsoft Excel, Apache OpenOffice calc provides an offset function that allows you to calculate a value based on the contents of a cell that is a specified distance in rows and columns from a particular cell. The syntax for calc is as follows:

OFFSET

Returns the value of a cell offset by a certain number of rows and columns from a given reference point.

Syntax

OFFSET(Reference; Rows; Columns; Height; Width)

Reference is the reference from which the function searches for the new reference.

Rows is the number of rows by which the reference was corrected up (negative value) or down.

Columns (optional) is the number of columns by which the reference was corrected to the left (negative value) or to the right.

Height (optional) is the vertical height for an area that starts at the new reference position.

Width (optional) is the horizontal width for an area that starts at the new reference position.
Arguments Rows and Columns must not lead to zero or negative start row or column.
Arguments Height and Width must not lead to zero or negative count of rows or columns.
In the OpenOffice Calc functions, parameters marked as "optional" can be left out only when no parameter follows. For example, in a function with four parameters, where the last two parameters are marked as "optional", you can leave out parameter 4 or parameters 3 and 4, but you cannot leave out parameter 3 alone.

Example

=OFFSET(A1;2;2) returns the value in cell C3 (A1 moved by two rows and two columns down). If C3 contains the value 100 this function returns the value 100.

=OFFSET(B2:C3;1;1) returns a reference to B2:C3 moved down by 1 row and one column to the right (C3:D4).

=OFFSET(B2:C3;-1;-1) returns a reference to B2:C3 moved up by 1 row and one column to the left (A1:B2).

=OFFSET(B2:C3;0;0;3;4) returns a reference to B2:C3 resized to 3 rows and 4 columns (B2:E4).

=OFFSET(B2:C3;1;0;3;4) returns a reference to B2:C3 moved down by one row resized to 3 rows and 4 columns (B2:E4).

=SUM(OFFSET(A1;2;2;5;6)) determines the total of the area that starts in cell C3 and has a height of 5 rows and a width of 6 columns (area=C3:H7).

[ More Info ]

[/software/openoffice] permanent link

Fri, Apr 10, 2015 10:37 pm

Sending messages and files with mailx

On a Linux/Unix system or OS X system, a very quick way to send email messages and files by email from a shell prompt, aka command line, is to use the mailx utility.

If you wish to send the contents of a file as the body of a message, you can use a command like the following one:

$ mailx someone@example.com <report.txt

The above command would send the contents of the file report.txt to someone@example.com. The contents would be inserted within the body of the message. In the above case, the message would have no subject. You can use the -s option to the command to provide a subject for the message. E.g.:

$ mailx -s "Just a test" someone@example.com <report.txt

The above command would send the same message as the previous one, but this time with a subject line of "Just a test". If the subject line contains a space, you must enclose the subject within quotes.

If, instead of sending a file's contents in the body of the message, you wish to send it as an attchment, you can use the -a option on Linux/Unix systems, but not on OS X, since the -a option isn't supported for mailx for that operating system.

$ mailx -s "another test" -a report.txt -b someoneelse@example2.com,jdoe@anothersite.com someone@example.com
A test message with an attachment.
Also sending to two BCC email addresses
EOT

In the above example, the file report.txt is sent as an attachment to the message with someone@example.com used as the "to" address. I also sent the message to two additional addresses as blind carbon copy (BCC) addreses using the -b option. When using the -b option to send to multiple email addresses, separate the addresses with a comma. Instead of putting the contents of the file report.txt in the body, the body in the above example consists of the two lines starting with "A test message". You can provide the body of the message by simply typing the mailx command line then hitting return and then starting typing whatever you want to appear in the body of the message. When you are finished, hit Ctrl-D, i.e., the Ctrl and D keys simultaneously. You will then see EOT appear for the end of text and the message will be transmitted.

If you wish to put email addresses in the carbon copy (CC) field, use -c, instead of -b. As with the -b option, separate multiple email addresses with a comma.

If you wish to see if the message has been transmitted from the sending system, you can use the mailq command. If it hasn't been transmitted you will see the message still in the queue as in the example below from a Mac OS X system.

$ mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
AEADBD2536AA*     370 Fri Apr 10 22:10:44  jsmith@GSOD000962737L.local
                                         someone@example.com
                                         someoneelse@example2.com

On a Linux/Unix system, you will need to run the mailq command as root or you can run the command with sudo, if the account you are using is in the sudoers file.

Though, if the message isn't shown in the queue, there still could have been a failed delivery attempt. E.g., a short time after issuing the mailq command above on a OS X system, when I reissued the command I saw the following indicating the system could not send the email via mailx.

$ mailq
postqueue: fatal: Queue report unavailable - mail system is down

[/network/email/mailx] permanent link

Thu, Apr 09, 2015 11:11 pm

Check for available updates from the command line under OS X

If you wish to know what updates are available for a Mac OS X system, you can use the system software update tool, softwareupdate, to do so by issuing the command sudo softwareupdate -l, if the account you are logged in under has administrative privileges; if so, enter the password for that account when prompted. A command line prompt is available on OS X by running the terminal application found in the Applications/Utilities folder.
$ sudo softwareupdate -l
Password:
Software Update Tool
Copyright 2002-2010 Apple

2015-04-09 22:51:06.156 softwareupdate[30930:3903] No alternate URLs found for packageId MobileDevice
Software Update found the following new or updated software:
   * RemoteDesktopClient-3.8.2 v1.1
	Remote Desktop Client Update (3.8.2 v1.1), 7123K [recommended]
   * SecUpd2015-004MtLion-1.0
	Security Update 2015-004 (1.0), 179583K [recommended] [restart]
   * Safari6.2.5MountainLion-6.2.5
	Safari (6.2.5), 59025K [recommended]
   * AirPortUtility-6.3.1
	AirPort Utility (6.3.1), 21104K [recommended]
   * iTunesXPatch-12.1.2
	iTunes (12.1.2), 101172K [recommended]
   * Mac App Store Update-1.0
	Mac App Store Update (1.0), 3697K [recommended] [restart]

In the example output above, you can see that installing some of the updates will require a restart afterwards to have the updates take effect.

If you don't precede the command with sudo, you will see a message informing you that the command must be run as root.

$ softwareupdate
softwareupdate: Must be run as root

For a list of available options for the command, you can use sudo softwareupdate -h.

$ sudo softwareupdate -h
Password:
usage: softwareupdate <mode> [<args> ...]

	-l | --list		List all appropriate updates
	-d | --download		Download Only
	-i | --install		Install
		<label> ...	specific updates
		-a | --all		all appropriate updates
		-r | --recommended	only recommended updates

	--ignore <label> ...	Ignore specific updates
	--reset-ignored		Clear all ignored updates
	--schedule (on | off)	Set automatic checking

	-v | --verbose	Enable verbose output
	-h | --help	Print this help

[/os/os-x] permanent link

Wed, Apr 08, 2015 8:46 pm

Hibernating a Windows 7 computer

You may be able to hibernate a Microsoft Windows 7 computer even if you don't see the hibernate option listed when you hit Ctrl-Alt-Del and click on the power button but see only the Shut down and Sleep options or if you click on the Windows Start button and then click on the arrow head next to the shut down button and see only the Sleep option. Try getting a command prompt, instead, which you can obtain by clicking on the Start button and typing cmd and hitting enter and then type shutdown /h or shutdown /h /f if you also want running applications to be forced to close. Not all PCs may support hibernate mode. You can issue the command powercfg -availablesleepstates at a command prompt to see if hibernation mode is available on the system.
C:\>powercfg -availablesleepstates
The following sleep states are available on this system: Standby ( S3 ) Hibernat
e Hybrid Sleep
The following sleep states are not available on this system:
Standby (S1)
        The system firmware does not support this standby state.
Standby (S2)
        The system firmware does not support this standby state.

Another option for the powercfg command, - hibernate or -h, enables or disables hibernation. You can see all available options with powercfg /?.

  -HIBERNATE, -H
              Enables-Disables the hibernate feature.  Hibernate timeout is not
              supported on all systems.

              Usage: POWERCFG -H <ON|OFF>
                     POWERCFG -H -Size <PercentSize>
              -Size  Specifies the desired hiberfile size in percentage of the
                     total memory. The default size cannot be smaller than 50.
                     This switch will also enable the hiberfile automatically.

  -AVAILABLESLEEPSTATES, -A
              Reports the sleep states available on the system
              Attempts to report reasons why sleep states are unavailable.

[/os/windows/win7] permanent link

Mon, Apr 06, 2015 10:04 pm

Determining the version of the OS and applications under OS X

You can determine the version of applications installed on an OS X system by clicking on the Apple icon in the upper, left-hand corner of the screen then selecting About This Mac, then More Info, then System Report, then Software, and then clicking on Applications beneath Software. You will see a display similar to the following one:

OS X Applications 
Installed

If you wish to determine the version number of an app from the command line, if the application supports command line options, you may be able to use one such as -v or -version to determine the version. Or you can use the system_profiler SPApplicationsDataType command to obtain a similar comprehensive list.

E.g., here are a few commands to determine the operating system version and the version of a few common applications under OS X from a command prompt, which can be obtained using the Terminal application.

Determine the OS version with sw_vers.

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.8.5
BuildVersion:	12F45

The Wikipedia OS X article provides the names given by Apple to each version. E.g., OS X 10.8.5 is called "Mountain Lion".

Determine the version of Java with java -version

$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Determine the version of Firefox with /Applications/Firefox.app/Contents/MacOS/firefox -v or -version.

$ /Applications/Firefox.app/Contents/MacOS/firefox -v
Mozilla Firefox 31.5.0
$ /Applications/Firefox.app/Contents/MacOS/firefox -version
Mozilla Firefox 31.5.0

Determine the version of GNU Image Manipulation Program (GIMP) with /Applications/Gimp.app/Contents/MacOS/gimp --version or /Applications/Gimp.app/Contents/MacOS/gimp -v with the -v option providing more details.

$ /Applications/Gimp.app/Contents/MacOS/gimp --version
Setting up environment...
Enabling internal python...
Locale black magic...
Launching GIMP...
GNU Image Manipulation Program version 2.8.10
$ /Applications/Gimp.app/Contents/MacOS/gimp -v
Setting up environment...
Enabling internal python...
Locale black magic...
Launching GIMP...
GNU Image Manipulation Program version 2.8.10
git-describe: GIMP_2_8_8-55-g9bb7eb0

using GEGL version 0.2.1 (compiled against version 0.2.1)
using GLib version 2.38.2 (compiled against version 2.38.2)
using GdkPixbuf version 2.30.1 (compiled against version 2.30.1)
using GTK+ version 2.24.22 (compiled against version 2.24.22)
using Pango version 1.36.0 (compiled against version 1.36.0)
using Fontconfig version 2.11.0 (compiled against version 2.11.0)
using Cairo version 1.12.16 (compiled against version 1.12.16)

If you would like to see all of the available command line options for GIMP, you can use /Applications/Gimp.app/Contents/MacOS/gimp -?, or -h, or --help, instead of the -?.

You can get the version for many applications at once using the command system_profiler SPApplicationsDataType.

[ More Info ]

[/os/os-x] permanent link

Sat, Apr 04, 2015 11:20 pm

Testing email delivery with SMTP commands

Telnet can be used from a command line interface, aka shell prompt, to manually send commands to an Simple Mail Transfer Protocol (SMTP) server to test email deliveries. An SMTP server typically listens on port 25 for incoming connections from mail clients or other email servers. So you could enter telnet mail.example.com 25 to connect to that port on a server, e.g., mail.example.com in this example, from a command line.

Telnet is available on Linux systems, or can be installed if it is not, and is also available on Mac OS X systems where you can run the application by using the Terminal application to obtain a shell prompt. Telnet was available by default with early versions of Microsoft Windows, but that is no longer the case. The free and open source PuTTY program is an excellent telnet client for Windows, however. To use it to connect to port 25 on an email server, you simply select Telnet as the connection type and put 25 in the port field.

Once you've connected to port 25 on a mail server, the first command to enter is either helo or ehlo. Issuing that command is akin to saying "hello" when you meet someone. The command is usually followed by the name of the system from which you are connecting, e.g., helo me.example.com if you ran the telnet command on a system with a fully qualified domain name (FQDN) of me.example.com. But you can follow the helo or ehlo command with anything, just as you could say "hello, I'm Paul" when you met someone even if your name was Peter.

Ehlo is a command that is part of Extended SMTP (ESMTP), aka "Enhanced SMTP", which defines protocol extensions for the SMTP protocol. Ehlo is shorthand for "Extended Hello" and in the protocol extensions of ESMTP provides a similar role of an introduction. If the email server to which you are connecting supports the protocol extensions of ESMTP, it will reply with a list of the keywords it supports with each preceded by the code 250 as shown below:

$ telnet smtp.mandrillapp.com 25
Trying 54.158.189.65...
Connected to smtp.mandrillapp.com.
Escape character is '^]'.
220 smtp.mandrillapp.com ESMTP
ehlo moonpoint.com
250-ip-10-81-192-73
250-PIPELINING
250-SIZE 26214400
250-STARTTLS
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250 8BITMIME

If the server doesn't support ESMTP, it will return error code 500, instead. ESMTP client software can then try either HELO, instead, or issue the QUIT command to terminate the connection to the server.

If the email server doesn't require authentication, you can then issue commands specifying the "from" and "to" addresses for the email message as shown below:

$ telnet mail.example.com 25
Trying 192.168.101.222...
Connected to mail.example.com.
Escape character is '^]'.
220 mail.example.com ESMTP Sendmail 8.14.7/8.14.7; Sat, 4 Apr 2015 22:02:39 -0400
mail from: testing@example.com
250 2.1.0 testing@example.com... Sender ok
rcpt to: moonpoint@example.com
250 2.1.5 moonpoint@example.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
This is a test.
.
250 2.0.0 t3520758032350 Message accepted for delivery
quit
221 2.0.0 mail.example.com closing connection
Connection closed by foreign host.

First you issue the command mail from: followed by the email address that is the "from" address. You then issue the command rcpt to: followed by the destination email address. The content of the message is specified by typing data then hitting Enter and then typing the contents of the email you wish to send. To terminate the content, type a period by itself as the first character on a line and then hit Enter. That's all you need to send an email message and you can then terminate the connetion to the server with the Quit command.

In the example above, the message you send won't have a subject, because none was specified. You can specify the subject by entering Subject: after the Data command. You can also include From: and To: in the data that follows the data command. Those don't even have to be the same as what you speficied with the mail from: and rcpt to commands. If you enter a From: and To: address after the data command, those will be what the recipient sees when he or she views the message. E.g., you could use rcpt to: mary@example.com to send an email to mary@example.com, but put a bogus address after the data command, such as From: bogusemail@nonexistent.com and the email would still be delivered successfully to Mary's mary@example.com email address, but when she viewed the message it would appear to her it was sent to bogusemail@nonexistent.com.

$ telnet mail.example.com 25
Trying 192.168.101.222...
Connected to mail.example.com.
Escape character is '^]'.
220 mail.example.com ESMTP Sendmail 8.14.7/8.14.7; Sat, 4 Apr 2015 22:17:16 -0400
mail from: testing@example.com
250 2.1.0 testing@example.com... Sender ok
rcpt to: someone@example.com
250 2.1.5 someone@example.com... Recipient ok
rcpt to: someoneelse@somesite.com
250 2.1.5 someoneelse@somesite.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
From: someone@example.com
To: bogusemail@example.com
Subject: A Test
Just a test.
.
250 2.0.0 t352HGPe003192 Message accepted for delivery
QUIT
221 2.0.0 mail.example.com closing connection
Connection closed by foreign host.
$

In the example above, I skipped the introduction using helo or ehlo and went straight to rcpt to. I then entered rcpt to: someone@example.com. When I entered the rcpt to: someoneelse@somesite.com command I wasn't adding a second delivery destination for the email but replacing the prior email recipient; you can just re-enter commands if you've made typos. I then changed the "from" address that the recipient would see with From: someone@example.com and also inserted To: bogusemail@example.com. There's no validation of the from address at any part of this process, which shows just how easy it is to spoof the "from" address in an email message, which is why you should never assume that the "from" address in an email message reflects the actual sender. Spammers and malware distributors often insert fake "from" addresses in their email. The email server will check that the rcpt to: address is a valid email address on the server or the sender is allowed to "relay" email based on the sender's IP address, email address, or authentication, but the "to" address seen in a message when viewed in an email client also doesn't necessarily reflect the one used in the rcpt to address.

If the rcpt to address isn't a valid email account on the server and if the server isn't configured to "relay" email to addresses that exist on other servers, or at least not for the sender of a particular message, it will respond with a "relaying denied" message.

s telnet example.com 25
Trying 192.168.101.222...
Connected to example.com.
Escape character is '^]'.
220 localhost.localdomain ESMTP Sendmail 8.14.7/8.14.7; Sat, 4 Apr 2015 22:15:24 -0400
ehlo example.com
250-example.com Hello me.somewhere.com [10.0.1.12], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
mail from: testing@example.com
250 2.1.0 testing@example.com... Sender ok
rcpt to: someone@someothersite.com
550 5.7.1 someone@someothersite.com... Relaying denied

The above commands can be used by one email server communicating with another, e.g., a sender's email server communicating with a recipient's email server. They can also be used by a client email application, e.g., Thunderbird or Microsoft Outlook. If you are sending email from an email client to an email server, you may be required to authenticate with that server first with a userid and password before the server will allow the client to transmit email through it,though. This is a mechanism to block spammers from sending email via the server. You can use the AUTH PLAIN command to transmit those credentials if the email server supports that command. E.g., in the example below the server supports that command, since it returns the code 250 followed by "AUTH PLAIN" after an ehlo command is issued, so I can authenticate with it by issuing the command AUTH PLAIN followed by the appropriate credentials.

$ telnet smtp.mandrillapp.com 25
Trying 54.204.65.134...
Connected to smtp.mandrillapp.com.
Escape character is '^]'.
220 smtp.mandrillapp.com ESMTP
ehlo test
250-ip-10-187-29-39
250-PIPELINING
250-SIZE 26214400
250-STARTTLS
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250 8BITMIME
AUTH PLAIN AG1vb25wb22udEBob3RtYW2sLmNvbQBDaTMtY2RfOT0McklOd23OMFEsNGFB
235 2.7.0 Authentication successful
Mail From: testing@example.com
250 2.1.0 Ok
RCPT To: moonpoint@somesite.com
250 2.1.5 Ok
Data
354 End data with <CR><LF>.<CR><LF>
This is a test message.
.
250 2.0.0 Ok: queued as 85761C042C
quit
221 2.0.0 Bye
Connection closed by foreign host.

So what is that long string of characters after the AUTH PLAIN command. That's actually the userid and password that the server requires for authentication. It looks like just random letters and numbers because the userid and password are base64-encoded. You can generate the encoded credentials using a Perl command similar to the one below:

$ perl -MMIME::Base64 -e 'print encode_base64("\000moonpoint\@example.com\000SomePassword");'
AG1vb25wb2ludEBleGFtcGxlLmNvbQBTb21lUGFzc3dvcmQ=

The command is in the format perl -MMIME::Base64 -e 'print encode_base64("\000user_name\@domain_name\000Password");'. The user name is preceded by \000, i.e., a backslash followed by a null character represented by three zeros. If authentication requires that you enter a userid in the form of userid@domainname, instead of just username, then you need to precede the "@" with the backslash escape character. If you don't do so, Perl will think the "@" represents a reference to an array and the result you get won't work. You then add another backslash followed by three zeros and the password. The encoded data will then be returned. In this case it was AG1vb25wb2ludEBleGFtcGxlLmNvbQBTb21lUGFzc3dvcmQ= which is what I would copy and paste after the AUTH PLAIN command when providing credentials to the server. Note: you can also use online services to do the base64 encoding, but you would be providing the login credentials to get the results, so someone else could possibly learn the userid and password.

References:

  1. SMTP, testing via Telnet
    Last modified: June 11, 2013
    FreeBSDwiki

[/network/email] permanent link

Thu, Apr 02, 2015 10:50 pm

Checking network errors with netstat -bI or -dI on OS X

You can determine the number of input packets and bytes and output packets and byes on a network interface and check for errors on a Mac OS X system using the command netstat -bI interface where interface is a particular network interface on the system, e.g., en0 or en1 or, alternatively, check all interfaces using netstat -bi.

     -b    With the interface display (option -i, as described below), show the number of bytes
           in and out.

     -d    With either interface display (option -i or an interval, as described below), show
           the number of dropped packets.

     -I interface
           Show information about the specified interface; used with a wait interval as
           described below.  If the -s option is present, show per-interface protocol statis-
           tics on the interface for the specified address_family or protocol, or for all pro-
           tocol families.

     -i    Show the state of interfaces which have been auto-configured (interfaces statically
           configured into a system, but not located at boot time are not shown).  If the -a
           options is also present, multicast addresses currently in use are shown for each
           Ethernet interface and for each IP interface address.  Multicast addresses are shown
           on separate lines following the interface address with which they are associated.
           If the -s option is present, show per-interface statistics on all interfaces for the
           specified address_family or protocol, or for all protocol families.  

E.g., using -bI to see information for particular interfaces:

$ netstat -bI en0
Name  Mtu   Network       Address            Ipkts Ierrs     Ibytes    Opkts Oerrs     Obytes  Coll
en0   1500  <Link#4>    d4:9a:20:0d:e6:ec        0     0          0        0     0        836     0
$ netstat -bI en1
Name  Mtu   Network       Address            Ipkts Ierrs     Ibytes    Opkts Oerrs     Obytes  Coll
en1   1500  <Link#5>    f8:1e:df:d9:2b:64 22184840     0 13047081883 29605843     0 6652036717     0
en1   1500  gsod0009627 fe80:5::fa1e:dfff 22184840     - 13047081883 29605843     - 6652036717     -
en1   1500  192.168.3     192.168.3.4     22184840     - 13047081883 29605843     - 6652036717     -

Or -bi for all interfaces:

$ netstat -bi
Name  Mtu   Network       Address            Ipkts Ierrs     Ibytes    Opkts Oerrs     Obytes  Coll
lo0   16384 <Link#1>                        684926     0   46641907   684926     0   46641907     0
lo0   16384 localhost   fe80:1::1           684926     -   46641907   684926     -   46641907     -
lo0   16384 127           localhost         684926     -   46641907   684926     -   46641907     -
lo0   16384 localhost   ::1                 684926     -   46641907   684926     -   46641907     -
gif0* 1280  <Link#2>                             0     0          0        0     0          0     0
stf0* 1280  <Link#3>                             0     0          0        0     0          0     0
en0   1500  <Link#4>    d4:9a:20:0d:e6:ec        0     0          0        0     0        836     0
en1   1500  <Link#5>    f8:1e:df:d9:2b:64 22186588     0 13047529007 29606897     0 6652193662     0
en1   1500  gsod0009627 fe80:5::fa1e:dfff 22186588     - 13047529007 29606897     - 6652193662     -
en1   1500  192.168.3     192.168.3.4     22186588     - 13047529007 29606897     - 6652193662     -
fw0   4078  <Link#6>    d4:9a:20:ff:fe:0d:e6:ec        0     0          0        0     0        346     0
p2p0  2304  <Link#7>    0a:1e:df:d9:2b:64        0     0          0        0     0          0     0
vmnet 1500  <Link#9>    00:50:56:c0:00:01        0     0          0        0     0          0     0
vmnet 1500  192.168.49    192.168.49.1           0     -          0        0     -          0     -
vmnet 1500  <Link#10>   00:50:56:c0:00:08        0     0          0        0     0          0     0
vmnet 1500  172.16.79/24  172.16.79.1            0     -          0        0     -          0     -
utun0 1400  <Link#8>                          4355     0    2689781     5506    10    2466553     0
utun0 1400  192.168.225.1 vpn-192-168-225     4355     -    2689781     5506     -    2466553     -

You can also use netstat -dI or netstat -di to check for errors and dropped packets.

$ netstat -dI en1
Name  Mtu   Network       Address            Ipkts Ierrs    Opkts Oerrs  Coll Drop
en1   1500  <Link#5>    f8:1e:df:d9:2b:64 22188430     0 29608300     0     0 
en1   1500  gsod0009627 fe80:5::fa1e:dfff 22188430     - 29608300     -     -   -
en1   1500  192.168.3     192.168.3.4     22188430     - 29608300     -     -   -
$ netstat -di
Name  Mtu   Network       Address            Ipkts Ierrs    Opkts Oerrs  Coll Drop
lo0   16384 <Link#1>                        685020     0   685020     0     0 
lo0   16384 localhost   fe80:1::1           685020     -   685020     -     -   -
lo0   16384 127           localhost         685020     -   685020     -     -   -
lo0   16384 localhost   ::1                 685020     -   685020     -     -   -
gif0* 1280  <Link#2>                             0     0        0     0     0 
stf0* 1280  <Link#3>                             0     0        0     0     0 
en0   1500  <Link#4>    d4:9a:20:0d:e6:ec        0     0        0     0     0 
en1   1500  <Link#5>    f8:1e:df:d9:2b:64 22188931     0 29608571     0     0 
en1   1500  gsod0009627 fe80:5::fa1e:dfff 22188931     - 29608571     -     -   -
en1   1500  192.168.3     192.168.3.4     22188931     - 29608571     -     -   -
fw0   4078  <Link#6>    d4:9a:20:ff:fe:0d:e6:ec        0     0        0     0     0 
p2p0  2304  <Link#7>    0a:1e:df:d9:2b:64        0     0        0     0     0 
vmnet 1500  <Link#9>    00:50:56:c0:00:01        0     0        0     0     0 
vmnet 1500  192.168.49    192.168.49.1           0     -        0     -     -   -
vmnet 1500  <Link#10>   00:50:56:c0:00:08        0     0        0     0     0 
vmnet 1500  172.16.79/24  172.16.79.1            0     -        0     -     -   -
utun0 1400  <Link#8>                          5088     0     6597    10     0 
utun0 1400  192.168.225.1 vpn-192-168-225     5088     -     6597     -     -   -

If you would like comprehensive per-protocol statisitics for TCP, UDP, and ICMP, you can use netstat -s.


    -s    Show per-protocol statistics.  If this option is repeated, counters with a value of
           zero are suppressed.

E.g.:

$ netstat -s
tcp:
	29261464 packets sent
		17057982 data packets (1342507929 bytes)
		25181 data packets (11210523 bytes) retransmitted
		0 resends initiated by MTU discovery
		10449225 ack-only packets (7938 delayed)
		0 URG only packets
		508 window probe packets
		767946 window update packets
		961091 control packets
		0 data packets sent after flow control
	21404953 packets received
		8137595 acks (for 1341998962 bytes)
		377994 duplicate acks
		0 acks for unsent data
		13805067 packets (1284085790 bytes) received in-sequence
		14783 completely duplicate packets (8462565 bytes)
		69 old duplicate packets
		83 packets with some dup. data (50503 bytes duped)
		126989 out-of-order packets (165558655 bytes)
		108 packets (126046 bytes) of data after window
		18 window probes
		3196 window update packets
		10932 packets received after close
		13 bad resets
		0 discarded for bad checksums
		0 discarded for bad header offset fields
		0 discarded because packet too short
	697585 connection requests
	825 connection accepts
	9 bad connection attempts
	0 listen queue overflows
	265086 connections established (including accepts)
	700724 connections closed (including 167300 drops)
		4971 connections updated cached RTT on close
		4971 connections updated cached RTT variance on close
		2672 connections updated cached ssthresh on close
	64419 embryonic connections dropped
	4638680 segments updated rtt (of 4788660 attempts)
	3759189 retransmit timeouts
		3379 connections dropped by rexmit timeout
		0 connections dropped after retransmitting FIN
	1219 persist timeouts
		6 connections dropped by persist timeout
	261605 keepalive timeouts
		200056 keepalive probes sent
		55755 connections dropped by keepalive
	4620911 correct ACK header predictions
	12309843 correct data packet header predictions
	15932 SACK recovery episodes
	3124 segment rexmits in SACK recovery episodes
	3960674 byte rexmits in SACK recovery episodes
	31573 SACK options (SACK blocks) received
	124018 SACK options (SACK blocks) sent
	0 SACK scoreboard overflow
udp:
	2731040 datagrams received
	0 with incomplete header
	0 with bad data length field
	0 with bad checksum
	127081 dropped due to no socket
	692901 broadcast/multicast datagrams dropped due to no socket
	1 dropped due to full socket buffers
	0 not for hashed pcb
	1911057 delivered
	18196924 datagrams output
ip:
	27677449 total packets received
	0 bad header checksums
	0 with size smaller than minimum
	0 with data size < data length
	0 with ip length > max ip packet size
	0 with header length < data size
	0 with data length < header length
	0 with bad options
	0 with incorrect version number
	443 fragments received
	0 fragments dropped (dup or out of space)
	0 fragments dropped after timeout
	141 packets reassembled ok
	24114721 packets for this host
	11749 packets for unknown/unsupported protocol
	0 packets forwarded (0 packets fast forwarded)
	805 packets not forwardable
	3549872 packets received for unknown multicast group
	0 redirects sent
	47854947 packets sent from this host
	101 packets sent with fabricated ip header
	0 output packets dropped due to no bufs, etc.
	11620 output packets discarded due to no route
	51 output datagrams fragmented
	102 fragments created
	0 datagrams that can't be fragmented
	0 tunneling packets that can't find gif
	130 datagrams with bad address in header
	0 packets dropped due to no bufs for control data
icmp:
	127081 calls to icmp_error
	0 errors not generated 'cuz old message was icmp
	Output histogram:
		echo reply: 340
		destination unreachable: 127081
	0 messages with bad code fields
	0 messages < minimum length
	0 bad checksums
	0 messages with bad length
	0 multicast echo requests ignored
	0 multicast timestamp requests ignored
	Input histogram:
		echo reply: 639
		destination unreachable: 7646
		routing redirect: 2468
		echo: 340
		time exceeded: 136
		time stamp: 17
		information request: 2
		address mask request: 17
		UDP: 5
	340 message responses generated
	ICMP address mask responses are disabled
igmp:
	11768 messages received
	0 messages received with too few bytes
	30 messages received with wrong TTL
	0 messages received with bad checksum
	11676 V1/V2 membership queries received
	29 V3 membership queries received
	0 membership queries received with invalid field(s)
	11705 general queries received
	0 group queries received
	0 group-source queries received
	0 group-source queries dropped
	32 membership reports received
	0 membership reports received with invalid field(s)
	32 membership reports received for groups to which we belong
	0 V3 reports received without Router Alert
	11118 membership reports sent
ipsec:
	0 inbound packets processed successfully
	0 inbound packets violated process security policy
	0 inbound packets with no SA available
	0 invalid inbound packets
	0 inbound packets failed due to insufficient memory
	0 inbound packets failed getting SPI
	0 inbound packets failed on AH replay check
	0 inbound packets failed on ESP replay check
	0 inbound packets considered authentic
	0 inbound packets failed on authentication
	0 outbound packets processed successfully
	0 outbound packets violated process security policy
	0 outbound packets with no SA available
	0 invalid outbound packets
	0 outbound packets failed due to insufficient memory
	0 outbound packets with no route
ip6:
	467000 total packets received
	0 with size smaller than minimum
	0 with data size < data length
	0 with bad options
	0 with incorrect version number
	94 fragments received
	0 fragments dropped (dup or out of space)
	1 fragment dropped after timeout
	0 fragments that exceeded limit
	35 packets reassembled ok
	32768 packets for this host
	0 packets forwarded
	415268 packets not forwardable
	0 redirects sent
	10803 packets sent from this host
	0 packets sent with fabricated ip header
	0 output packets dropped due to no bufs, etc.
	48739 output packets discarded due to no route
	1025 output datagrams fragmented
	2050 fragments created
	0 datagrams that can't be fragmented
	0 packets that violated scope rules
	415268 multicast packets which we don't join
	Input histogram:
		hop by hop: 30801
		TCP: 10
		UDP: 422348
		fragment: 94
		ICMP6: 13747
	Mbuf statistics:
		10 one mbuf
		two or more mbuf:
			lo0= 9624
		457366 one ext mbuf
		0 two or more ext mbuf
	0 packets whose headers are not continuous
	0 tunneling packets that can't find gif
	0 packets discarded due to too may headers
	0 failures of source address selection
	0 forward cache hit
	0 forward cache miss
	0 packets dropped due to no bufs for control data
icmp6:
	0 calls to icmp_error
	0 errors not generated because old message was icmp error or so
	0 errors not generated because rate limitation
	Output histogram:
		router solicitation: 443
		neighbor solicitation: 171
		neighbor advertisement: 133
		MLDv2 listener report: 377
	0 messages with bad code fields
	0 messages < minimum length
	0 bad checksums
	0 messages with bad length
	Input histogram:
		multicast listener query: 11644
		MLDv1 listener report: 23
		neighbor solicitation: 7
		neighbor advertisement: 7290
	Histogram of error messages to be generated:
		0 no route
		0 administratively prohibited
		0 beyond scope
		0 address unreachable
		0 port unreachable
		0 packet too big
		0 time exceed transit
		0 time exceed reassembly
		0 erroneous header field
		0 unrecognized next header
		0 unrecognized option
		0 redirect
		0 unknown
	0 message responses generated
	0 messages with too many ND options
	0 messages with bad ND options
	0 bad neighbor solicitation messages
	0 bad neighbor advertisement messages
	0 bad router solicitation messages
	0 bad router advertisement messages
	0 bad redirect messages
	0 path MTU changes
ipsec6:
	0 inbound packets processed successfully
	0 inbound packets violated process security policy
	0 inbound packets with no SA available
	0 invalid inbound packets
	0 inbound packets failed due to insufficient memory
	0 inbound packets failed getting SPI
	0 inbound packets failed on AH replay check
	0 inbound packets failed on ESP replay check
	0 inbound packets considered authentic
	0 inbound packets failed on authentication
	0 outbound packets processed successfully
	0 outbound packets violated process security policy
	0 outbound packets with no SA available
	0 invalid outbound packets
	0 outbound packets failed due to insufficient memory
	0 outbound packets with no route
rip6:
	0 messages received
	0 checksum calcurations on inbound
	0 messages with bad checksum
	0 messages dropped due to no socket
	0 multicast messages dropped due to no socket
	0 messages dropped due to full socket buffers
	0 delivered
	0 datagrams output
pfkey:
	242 requests sent to userland
	3872 bytes sent to userland
	histogram by message type:
		register: 122
		flush: 60
		x_spdflush: 60
	0 messages with invalid length field
	0 messages with invalid version field
	0 messages with invalid message type field
	0 messages too short
	0 messages with memory allocation failure
	0 messages with duplicate extension
	0 messages with invalid extension type
	0 messages with invalid sa type
	0 messages with invalid address extension
	242 requests sent from userland
	14064 bytes sent from userland
	histogram by message type:
		register: 122
		flush: 60
		x_spdflush: 60
	0 messages toward single socket
	120 messages toward all sockets
	60 messages toward registered sockets
	0 messages with memory allocation failure

You can have the display of counters with a value of zero omitted using the options -ss, instead of -s. E.g.:

$ netstat -ss
tcp:
	29262147 packets sent
		17058355 data packets (1342573989 bytes)
		25181 data packets (11210523 bytes) retransmitted
		10449497 ack-only packets (7938 delayed)
		508 window probe packets
		767946 window update packets
		961129 control packets
	21405439 packets received
		8137921 acks (for 1342065132 bytes)
		378012 duplicate acks
		13805277 packets (1284149452 bytes) received in-sequence
		14785 completely duplicate packets (8462978 bytes)
		69 old duplicate packets
		83 packets with some dup. data (50503 bytes duped)
		126989 out-of-order packets (165558655 bytes)
		108 packets (126046 bytes) of data after window
		18 window probes
		3196 window update packets
		10932 packets received after close
		13 bad resets
	697607 connection requests
	825 connection accepts
	9 bad connection attempts
	265103 connections established (including accepts)
	700745 connections closed (including 167300 drops)
		4971 connections updated cached RTT on close
		4971 connections updated cached RTT variance on close
		2672 connections updated cached ssthresh on close
	64422 embryonic connections dropped
	4638941 segments updated rtt (of 4788924 attempts)
	3759239 retransmit timeouts
		3379 connections dropped by rexmit timeout
	1219 persist timeouts
		6 connections dropped by persist timeout
	261618 keepalive timeouts
		200066 keepalive probes sent
		55758 connections dropped by keepalive
	4621122 correct ACK header predictions
	12309982 correct data packet header predictions
	15932 SACK recovery episodes
	3124 segment rexmits in SACK recovery episodes
	3960674 byte rexmits in SACK recovery episodes
	31573 SACK options (SACK blocks) received
	124018 SACK options (SACK blocks) sent
udp:
	2731110 datagrams received
	127082 dropped due to no socket
	692942 broadcast/multicast datagrams dropped due to no socket
	1 dropped due to full socket buffers
	1911085 delivered
	18197031 datagrams output
ip:
	27678514 total packets received
	443 fragments received
	141 packets reassembled ok
	24115277 packets for this host
	11749 packets for unknown/unsupported protocol
	805 packets not forwardable
	3550381 packets received for unknown multicast group
	47855748 packets sent from this host
	101 packets sent with fabricated ip header
	11620 output packets discarded due to no route
	51 output datagrams fragmented
	102 fragments created
	130 datagrams with bad address in header
icmp:
	127082 calls to icmp_error
	Output histogram:
		echo reply: 340
		destination unreachable: 127082
	Input histogram:
		echo reply: 639
		destination unreachable: 7646
		routing redirect: 2468
		echo: 340
		time exceeded: 136
		time stamp: 17
		information request: 2
		address mask request: 17
		UDP: 5
	340 message responses generated
	ICMP address mask responses are disabled
igmp:
	11768 messages received
	30 messages received with wrong TTL
	11676 V1/V2 membership queries received
	29 V3 membership queries received
	11705 general queries received
	32 membership reports received
	32 membership reports received for groups to which we belong
	11118 membership reports sent
ipsec:
ip6:
	467000 total packets received
	94 fragments received
	1 fragment dropped after timeout
	35 packets reassembled ok
	32768 packets for this host
	415268 packets not forwardable
	10803 packets sent from this host
	48739 output packets discarded due to no route
	1025 output datagrams fragmented
	2050 fragments created
	415268 multicast packets which we don't join
	Input histogram:
		hop by hop: 30801
		TCP: 10
		UDP: 422348
		fragment: 94
		ICMP6: 13747
	Mbuf statistics:
		10 one mbuf
		two or more mbuf:
			lo0= 9624
		457366 one ext mbuf
		0 two or more ext mbuf
icmp6:
	Output histogram:
		router solicitation: 443
		neighbor solicitation: 171
		neighbor advertisement: 133
		MLDv2 listener report: 377
	Input histogram:
		multicast listener query: 11644
		MLDv1 listener report: 23
		neighbor solicitation: 7
		neighbor advertisement: 7290
	Histogram of error messages to be generated:
		0 no route
		0 administratively prohibited
		0 beyond scope
		0 address unreachable
		0 port unreachable
		0 packet too big
		0 time exceed transit
		0 time exceed reassembly
		0 erroneous header field
		0 unrecognized next header
		0 unrecognized option
		0 redirect
		0 unknown
ipsec6:
rip6:
pfkey:
	242 requests sent to userland
	3872 bytes sent to userland
	histogram by message type:
		register: 122
		flush: 60
		x_spdflush: 60
	242 requests sent from userland
	14064 bytes sent from userland
	histogram by message type:
		register: 122
		flush: 60
		x_spdflush: 60
	120 messages toward all sockets
	60 messages toward registered sockets

[/os/os-x] permanent link

Mon, Mar 23, 2015 10:53 pm

Capturing output from Terminal on OS X

If you wish to capture the contents of the Terminal window on OS X, e.g., if you are running the top command and would like to capture a snapshot of what is in the terminal window, but would like to have that information in text format, rather than as an image file, which is what you would get if you used Preview and chose "File" and then "Take Screen Shot", you can use Command-S from the Terminal window. You will be prompted as to where you wish to save the file; the default file name is Terminal Saved Output in the Documents folder for the account you are logged in under. When you choose "Save", if the file exists, you will see the message below:

"Terminal Saved Output" already exists.

A file or folder with the same name already exists in the folder Documents. Replacing it will overwrite its current contents.

Cancel   Replace

If you choose "Replace" the contents of the current Terminal tab will be written to the file, including the scrollback buffer, i.e., all of the information displayed in the window for the current Terminal tab, even what is not shown on the screen unless you scroll upwards, is recorded to the file.

So, if I wanted to capture the current output of top -o cpu, I could hit the Command and S keys to save the displayed information and then edit out anything from the scrollback buffer to have something like what is shown below.

$ top -o cpu

Processes: 147 total, 7 running, 3 stuck, 137 sleeping, 831 threads   22:35:37
Load Avg: 3.28, 3.22, 3.24  CPU usage: 84.86% user, 15.13% sys, 0.0% idle
SharedLibs: 484K resident, 0B data, 0B linkedit.
MemRegions: 147433 total, 1663M resident, 37M private, 558M shared.
PhysMem: 849M wired, 1613M active, 1597M inactive, 4059M used, 36M free.
VM: 318G vsize, 1026M framework vsize, 33663121(1) pageins, 8539859(0) pageouts
Networks: packets: 19460598/11G in, 27466428/5435M out.
Disks: 19736694/473G read, 9899513/434G written.

PID    COMMAND      %CPU TIME     #TH  #WQ  #PORT #MREGS RPRVT  RSHRD  RSIZE
215    firefox      83.9 308 hrs  71/1 3    428+  90860- 967M-  82M    1143M-
27     opendirector 66.7 61:34:17 12/1 12/1 709   229    3780K  1936K  7116K
33110  top          21.3 00:02.19 1/1  0    24    33     1904K  216K   2652K
124    WindowServer 12.6 15:23:27 4/1  1    738+  23303+ 15M-   172M+  141M+
213    Terminal     6.0  09:50.46 10   5    214   933+   16M+   12M+   35M+
13601  Preview      5.4  01:11.19 3    1    661   2642+  45M-   69M+   86M+
0      kernel_task  2.5  06:57:45 87/2 0    2     851    30M    0B     461M+
29265- Microsoft En 1.4  12:06:51 14   3    440   2139   100M   65M    163M
55     hidd         0.6  27:51.88 5/1  3/1  92    67     620K   312K   1788K
15258- Microsoft Po 0.3  73:07.63 5    3    188   986    12M    36M    33M
221-   Microsoft Wo 0.3  01:54:36 5    3    155   963    31M    45M    57M
229-   My Day       0.2  01:46:08 6    1    167   447-   13M-   33M    36M-
210-   Microsoft Ex 0.1  77:31.36 5    3    206   2356   58M    93M    101M
68-    dsAccessServ 0.1  51:10.38 14   3    152   204    1456K  1764K  6032K
71-    LANrev Agent 0.0  27:48.38 13   2    242+  90+    2540K+ 1932K  2912K+
69     SymDaemon    0.0  05:33:54 16   1    1187  434    18M    2568K  26M
651    java         0.0  26:11.37 20   1    274   331    17M    4196K  20M
10267  VMware Fusio 0.0  03:59.72 9    1    265   529    3900K  17M    13M
613-   Microsoft Da 0.0  64:23.94 3    1    106   239    76M    22M    93M

[/os/os-x] permanent link

Fri, Mar 20, 2015 5:59 pm

AMPAgent using excessive percentage of CPU

A MacBook Pro laptop I was using was responding horribly slowly even for simple tasks. When I ran top to observe the percentage of CPU usage by process, I found AMPAgent was using a high percentage of the CPU cycles, going up to 75% at times.
$ top

Processes: 146 total, 4 running, 15 stuck, 127 sleeping, 840 threads  16:28:35
Load Avg: 2.66, 2.70, 2.77  CPU usage: 79.61% user, 20.38% sys, 0.0% idle
SharedLibs: 484K resident, 0B data, 0B linkedit.
MemRegions: 149522 total, 1684M resident, 36M private, 591M shared.
PhysMem: 889M wired, 1605M active, 1506M inactive, 4000M used, 95M free.
VM: 316G vsize, 1026M framework vsize, 29238312(0) pageins, 7714467(0) pageouts
Networks: packets: 18571867/10G in, 26865711/5268M out.
Disks: 17358834/424G read, 8677032/391G written.

PID    COMMAND      %CPU TIME     #TH  #WQ  #POR #MREGS RPRVT  RSHRD  RSIZE
95944  imklaunchage 0.0  00:04.62 2    1    68   50     184K   1556K  1204K
94149  plugin-conta 0.0  00:04.63 4    1    114  185    576K   30M    9320K
72763  cookied      0.0  00:01.68 2    1    50   42     356K   228K   892K
66565  geod         0.0  00:00.07 2    1    34   47     116K   216K   2512K
65412  vim          0.0  00:00.01 1    0    21   28     0B     216K   132K
65345  bash         0.0  00:00.12 1    0    21   27     4096B  732K   132K
65343  login        0.0  00:00.75 2    1    33   62     0B     256K   2268K
59625- AMPAgent     62.1 135 hrs  5/1  0    25   67     32K    216K   300K
47946  CIJScannerRe 0.0  03:43.18 5    1    108- 80     484K   4684K  3876K
47943  Image Captur 0.0  00:15.50 3    1    110  97     1640K  5000K  5620K
45203  diskimages-h 0.0  00:09.08 3    1    94   69     2964K  3512K  4488K
45160  hdiejectd    0.0  00:05.25 2    1    32   42     252K   248K   1296K
29384- Alerts Daemo 0.0  00:42.48 4    2    99   483    1128K  5528K  2164K
29265- Microsoft En 1.3  10:05:43 14   3    444  2061   92M    97M    163M
28815  ssh-agent    0.0  00:53.46 3    1    52   50     396K   360K   1488K
28702  bash         0.0  00:02.50 1    0    21   27     1176K  732K   1744K
28701  login        0.0  00:00.83 2    1    33   62     0B     256K   2228K
27960- Microsoft Au 1.5  01:50:06 7    2    157  232    1708K  14M    5524K
27514  iTunesHelper 0.0  00:07.47 3    1    63   73     336K   2324K  2128K

Searching the disk drive for it I found that it was associated with the Dell KACE software on the system, which is used for software management on the system.

$ find / -name AMPAgent 2>/dev/null
/Library/Application Support/Dell/KACE/bin/AMPAgent

I killed the AMPAgent process and found that it restarted, but was no longer using so much of the CPU's cycles.

$ sudo kill -HUP 59625
Password:
$ ps -A | grep AMP | grep -v grep
14018 ??         0:00.34 /Library/Application Support/Dell/KACE/bin/AMPAgent

At AMPAgent can utilize too much CPU on MAC and Windows on agent (126339) on the Dell Software Support site, I found Dell noting that the 5.5 version of the agent may experience issues with high CPU usage. The suggested fix was to upgrade to version 6.0 of the agent, which wasn't an option for me on the laptop, since control of the KACE servers and the KACE software deployed to client systems was under the purview of others. But I did verify that the version of the software was an older version, 5.4.10622; you can get the version number by using AMPAgent --help.

$ "/Library/Application Support/Dell/KACE/bin/AMPAgent" --help
Usage: /Library/Application Support/Dell/KACE/bin/AMPAgent -h <hostname> [-p <port>] [-d]

    -h|-host   : hostname of server
    -p|-port   : port of server

    -d|-debug  : include debug output in logs
    -w|-write  : write a default amp.conf file

  Example:
    /Library/Application Support/Dell/KACE/bin/AMPAgent -h kbox
? 2009-2012 Dell Inc.
KACE Agent AMP client version 5.4.10622

[/os/os-x] permanent link

Wed, Mar 11, 2015 10:21 pm

Freezing the top row in Microsoft Excel 2008 for Mac

If you wish to "freeze" a top header row in Microsoft® Excel® 2008 for Mac so that the row remains visible even when you need to scroll down through many rows, click in cell A2 then click on Window on the menu bar at the top of the Excel window and select Freeze Panes. If you later want to revert back to the original behavior where the top row does not always remain visible when you scroll down through the spreadsheet, you don't need to click on any particular cell beforehand, but can select Window and then Unfreeze Panes.

If you wish to have multiple rows remain visible when you scroll through the spreadsheet, you can click on a row below those you wish to remain visible and then click on Window and Freeze Panes. E.g., if you wished the top 5 rows to always be shown even when you've scrolled far below them, you could click on row 6 and then Window and Freeze Panes.

If you wished the top row and left-most column to always be visible, you could click on cell B2 and then Window and Freze Panes. Then if you scroll down through the spreadsheet, row number 1 will always be visible and if you scroll right, column A will also remain visible.

[/software/office] permanent link

Thu, Mar 05, 2015 8:04 pm

Calc and datedif

The Apache OpenOffice spreadsheet program Calc as of the current 4.1.1 version does not provide the DATEDIF function found in Microsoft Office Excel and Google Sheets. The datedif function can be used to calculate the number of days between two dates in Excel.

Calc does provide a NETWORKDAYS function, but that gives you the number of work days between two dates. I.e., weekends are excluded.

NETWORKDAYS

Returns the number of workdays between a start date and an end date. Holidays can be deducted.

Syntax

NETWORKDAYS(StartDate; EndDate; Holidays)

StartDate is the date from when the calculation is carried out. If the start date is a workday, the day is included in the calculation.

EndDate is the date up until when the calculation is carried out. If the end date is a workday, the day is included in the calculation.

Holidays is an optional list of holidays. These are non-working days. Enter a cell range in which the holidays are listed individually.

Example

How many workdays fall between 2001-12-15 and 2002-01-15? The start date is located in C3 and the end date in D3. Cells F3 to J3 contain the following Christmas and New Year holidays: "2001-12-24", "2001-12-25", "2001-12-26", "2001-12-31", "2002-01-01".
=NETWORKDAYS(C3;D3;F3:J3) returns 17 workdays.

However, the DATEDIF function isn't needed to calculate the number of days between two dates in Calc. Instead, you can simply subtract the two dates. E.g., if cell B18 contains the date January 1, 2014 and cell B19 contains the date March 4, 2015, you could place the formula =B19 - B18 in the cell where you want to store the number of days between the two dates. Unless you change the formatting of the cell to be something other than a number, you will see 427 as the value in the cell with that formula given the stated dates. That forumula will produce a result equivalent to DATEDIF(Start_Date,End_Date,"d") in Excel.

[/software/openoffice] permanent link

Thu, Mar 05, 2015 2:09 pm

Referencing a Google sheet with a space in the name

If you are using Google Sheets, which is Google's free, web-based spreadsheet program, for a spreadsheet and need to reference a sheet in a workboook that has a space in the name from another sheet, you need to enclose the name of the sheet in single quotes. E.g., if I have a sheet named 2014 MoonPoint and need to reference a cell, e.g., D292, in that sheet from another sheet, I could use '2014 Moonpoint'!D292 to reference the cell from which I need to obtain information. You will also need to use single quotes to enclose the name if you have other non-alphanumeric characters in the name, i.e., if you use other characters besides letters and numbers in the name.

[/network/web/services/google] permanent link

Tue, Mar 03, 2015 10:54 pm

Displaying Google Chrome browser information with chrome://

You can reveal a lot of internal Google Chrome browser information by putting chrome:// in the Chrome address bar.

E.g., Google Chrome maintains its own internal DNS cache. You can display the entries in that cache by putting chrome://dns in the address bar for Chrome. When you do so, you will see information similar to that displayed below:

Future startups will prefetch DNS records for 10 hostnames
Host nameHow long ago
(HH:MM:SS)
Motivation
http://support.moonpoint.com/244:53:05n/a
https://accounts.google.com/244:52:59n/a
https://chrome.google.com/244:53:45n/a
https://clients2.google.com/244:53:41n/a
https://clients2.googleusercontent.com/244:53:37n/a
https://fonts.googleapis.com/244:53:03n/a
https://ssl.gstatic.com/244:53:03n/a
https://www.google.com/244:53:16n/a
https://www.googleapis.com/244:53:46n/a
https://www.gstatic.com/244:53:03n/a

You will also see a page load count for web pages.

If you put chrome://downloads/ in the address bar you will see a list of the recently downloaded files and the URLs that were used to download them as well as the dates on which the files were downloaded..

You can view Chrome's history information showing a list of recently visited pages with the days and times they were visited with chrome://history/.

You can see information on Chrome's memory utilization, including the amount of memory used by each Chrome tab using chrome://memory. That will also reveal the amount of memory used by other browsers, such as Internet Explorer and Firefox, that are open on the system. E.g., this is an example from a Windows 7 system where 3 tabs are open within Chrome, one for Wikipedia, one for Google, i.e., google.com, and one for chrome://memory itself, which is labeled "About Memory". The tabs are identified by Tab at the beginning of the name. IE 11 and Firefox 35.0.1 are also open on the system and so information about their memory utitlization is also displayed.

References:

  1. 12 Most Useful Google Chrome Browser chrome:// Command
    By Ramesh Natarajan
    Date: October 12, 2011
    The Geek Stuff

[/network/web/browser/chrome] permanent link

Mon, Mar 02, 2015 11:06 pm

Setting Chrome as the default browser

To set Chrome as the default browser, take the following steps:
  1. Click on the menu bar, which is 3 horizontal bars one beneath the other at the top right of the Chrome window. Chrome menu bar
  2. Select Settings.
  3. Click on the Make Google the default browser.
  4. On a Windows system, you may see a window asking "How do you want to open this type of link (http)?" which shows the other browsers on the system that can be used to access websites. Click on Google Chrome

    Browser list for
opening http links

When you do that, the HKEY_CLASSES_ROOT\http\shell\open\command is updated as shown below when the query was run before and after the default browser was changed from Internet Explorer to Google Chrome on a Windows Server 2012 Essentials system.

C:\>reg query HKEY_CLASSES_ROOT\http\shell\open\command /ve

HKEY_CLASSES_ROOT\http\shell\open\command
    (Default)    REG_SZ    "C:\Program Files\Internet Explorer\iexplore.exe" %1


C:\>reg query HKEY_CLASSES_ROOT\http\shell\open\command /ve

HKEY_CLASSES_ROOT\http\shell\open\command
    (Default)    REG_SZ    "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -- "%1"

If Firefox is the default browser, the value will be similar to the following, depending on where you installed Firefox:

"C:\Program Files\Mozilla Firefox\firefox.exe" -osint -url "%1"

References:

  1. Determining the default browser from the command line
    Date: July 18, 2014
    MoonPoint Support

[/network/web/browser/chrome] permanent link

Sun, Mar 01, 2015 9:56 pm

Adobe Acrobat - Import trusted certificates from prior version

When I upgraded Adobe Reader on a user's Microsoft Windows 7 system from version X (10.1.12) to XI (11.0.10), I saw an Adobe Reader Security window open with the following prompt when I started Adobe Reader 11 from the administrator account after upgrading the software:

Trusted certificates from your previous version of Adobe Reader were found. Would you like to import them?

Any certificates that are not imported in this step will not be available in this version of Adobe Reader.

Adobe Reader - Import previous trusted certificates?

At Security (Digital Signatures), I found the following explanation in the Addressbook Import section:

The address book stores data for certificates used in digital signature and certificate encryption workflows. During a major upgrade (e.g. 10.x to 11.x), the product looks for existing address books on each user machine. Prior to install, you should decide whether to deploy a generic, enterprise address book or let the existing address book on each machine be imported into the new product. By default, when end users first launch the product, the application prompts them to import any discovered address book. The application looks for existing addressbooks from previous product versions by searching directories in this order.

I checked to see if any of the files existed from prior versions for the administrator account, but didn't see any.

C:\>echo %APPDATA%
C:\Users\Administrator\AppData\Roaming

C:\>dir %APPDATA%\Adobe\Acrobat\11.0\addressbook.acrodata
 Volume in drive C is OS
 Volume Serial Number is 4445-F6ED

 Directory of C:\Users\Administrator\AppData\Roaming\Adobe\Acrobat\11.0

File Not Found

C:\>dir %APPDATA%\Adobe\Acrobat\10.0\addressbook.acrodata
 Volume in drive C is OS
 Volume Serial Number is 4445-F6ED

 Directory of C:\Users\Administrator\AppData\Roaming\Adobe\Acrobat\10.0

File Not Found

C:\>dir %APPDATA%\Adobe\Acrobat\9.0\addressbook.acrodata
The system cannot find the file specified.

C:\>

I didn't see any for the administrator's account, so then checked the user's account, but did not see any there, either.

C:\>dir \Users\Pamela\AppData\Roaming\Adobe\Acrobat\9.0\addressbook.acrodata
 Volume in drive C is OS
 Volume Serial Number is 4445-F6ED

 Directory of C:\Users\Pamela\AppData\Roaming\Adobe\Acrobat\9.0

File Not Found

C:\>dir \Users\Pamela\AppData\Roaming\Adobe\Acrobat\10.0\addressbook.acrodata
 Volume in drive C is OS
 Volume Serial Number is 4445-F6ED

 Directory of C:\Users\Pamela\AppData\Roaming\Adobe\Acrobat\10.0

File Not Found

C:\>dir \Users\Pamela\AppData\Roaming\Adobe\Acrobat\11.0\addressbook.acrodata
The system cannot find the file specified.

C:\>

Since the system had Adobe Acrobat 9.0 on it for creating PDF files as well as now having Adobe Reader 11.0, I checked the last directory in the list of possible locations as well, but didn't see anything there, either.

C:\>dir "c:\program files (x86)\Adobe\Acrobat 9.0\Acrobat\Replicate"
 Volume in drive C is OS
 Volume Serial Number is 4445-F6ED

 Directory of c:\program files (x86)\Adobe\Acrobat 9.0\Acrobat

File Not Found

C:\>

So it seems the prompt may appear even if there are no prior certificates to import. I clicked on the Import button anyway, though.

[/os/windows/software/pdf/acrobat] permanent link

Sun, Mar 01, 2015 7:54 pm

Checking the status for Time Machine backups with bash

I connected an external USB drive to an iMac running OS X 10.6.8 for Time Machine backups. Two of the three USB ports were occupied by a keyboard and mouse and I plugged the drive into the only remaining USB port. The user has another USB drive she sometimes connects to the system temporarily. I wanted a way to be able to confirm from a terminal window or a shell prompt via a remote SSH connection that the external drive I set up for Time Machine backups had been reconnected and contained a recent Time Machine Backup. I found several scripts for checking the status of Time Machine backups at "Script check Time Machine Backups and report how long since last good backup on Client Daily Report". I chose a Bash script posted there by Devin. I've copied the script here.

From a Terminal window on the iMac I downloaded the Bash script, check-time-machine-currency, to the user's application directory, /Users/pam/Applications, with curl and made it executble with chmod +x. When the script is run, you need to provide a parameter to it specifying the number of minutes you wish to use for the recency check; the script reports if a backup has completed within a number of minutes of the current time using the value you provide for the number of minutes on the command line. If you run the scipt without providing that number, an error message will be displayed. Below I specified two days, i.e., 2,880 minutes (there are 1,440 minutes per day).

Pams-Computer:Applications pam$ curl http://support.moonpoint.com/downloads/comp
uter_languages/bash/check-time-machine-currency -o check-time-machine-currency
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3828  100  3828    0     0   3151      0  0:00:01  0:00:01 --:--:--  5871
Pams-Computer:Applications pam$ chmod +x check-time-machine-currency
Pams-Computer:Applications pam$ ./check-time-machine-currency
ERROR - You must provide a critical threshold in minutes!
Pams-Computer:Applications pam$ ./check-time-machine-currency 2880
Running on pre-Mavericks.
OK - A Time Machine backup has been taken within the last 2880 minutes. (Sun Mar
  1 17:14:33 EST 2015)
Pams-Computer:Applications pam$ date
Sun Mar  1 17:33:15 EST 2015
Pams-Computer:Applications pam$

The script informed me that a backup had been taken within the last 2,880 minutes; the last backup had been made at 17:14:33, i.e., 5:14 PM, which was less than 20 minutes before I ran the command at 5:33 PM.

[/os/os-x] permanent link

Sat, Feb 28, 2015 8:32 pm

Including one HTML file within another with iframe

With PHP, if you wish to pull code into a PHP file from another file, you can use include(path/filename);. If you wish to include an HTML file within another HTML file, one way to do it is by using the inline frame element IFRAME . E.g., if I wished to include HTML code from two HTML files and have the contents of those files appear on the right side of the web page in which I am including them, I could use the following:

<div style="float: right;">
<iframe src="/dir1/file1.html" height="2000" scrolling="no" style="border: none;"></iframe><br>
<iframe src="/dir2/file2.html" height="1225" scrolling="no" style="border: none;"></iframe>
</div>

You can control both the height and the width of the iframe. E.g., above the first iframe element is 2,000 pixels long and the second one is 1,225 pixels long. The width was not specified above, but also could be specified with width=n where n is the width in pixels. If the frame height isn't long enough and I wanted a scroll bar to appear, I wouldn't include scrolling="no". A border will appear around the iframe by default, but can be removed with style="border: none;". I put a <br> between the two iframes to have them both appear on the right one beneath the other.

[/network/web/html] permanent link

Sat, Feb 28, 2015 5:49 pm

Setting span to be the width of a div

I wanted to display the output of a program I ran at a shell prompt on a Linux system with HTML code rather than a screen shot. I wanted the output to look like the following with the black background on the header line for the columns to extend across the width of the div I used to enclose the HTML code for the display of the output:

Linux Network Bandwidth Monitor $Revision: 1.3 $ on localhost.localdomain

   Interface    Received(Kbps) Transmit(Kbps)     Total(Kbps)
      enp1s4           26.621         960.960         987.581
          lo            0.000           0.000           0.000

         All           26.621         960.960         987.581

System uptime: 5 days 5 hours 41 minutes and 2 seconds

I started the display with <div><pre> and ended it with </pre></div>. When I tried enclosing it within a div tag, the W3C Markup Validation Service complained that the div wasn't allowed where I had placed it within the surrounding pre tags, so I tried the following to stretch the span to the length of the div:

<span style="background-color: black; color: white; width: 100%">

But it produced the following:

Linux Network Bandwidth Monitor $Revision: 1.3 $ on localhost.localdomain

   Interface    Received(Kbps) Transmit(Kbps)     Total(Kbps)
      enp1s4           26.621         960.960         987.581
          lo            0.000           0.000           0.000

         All           26.621         960.960         987.581

System uptime: 5 days 5 hours 41 minutes and 2 seconds

The reason it didn't work was because by default <span> is an inline element, which means, it does not have a width or height. So setting the CSS attributes width and height on <span> will not work. I was able to get it to work by following the tip at How to Create a Fixed Width Span in HTML/CSS?:

In order to give a height and width to a span, you have to convert it to a block level element. Setting the style as “display: inline-block” will make it a block element with width and height, still displaying as inline element.

When I used the following CSS, I got the result I wanted:

<span style="background-color: black; color: white; display: inline-block; width: 100%"> Interface Received(Kbps) Transmit(Kbps) Total(Kbps)</span>

[/network/web/html/css] permanent link

Fri, Feb 27, 2015 11:58 pm

Viewing installed Windows updates from a command prompt

If you wish to get a list of the installed updates on a Microsoft Windows system from the command line, you can use the command wmic qfe list. You will see something like the following as output:

C:\Users\JDoe>wmic qfe list | more
Caption                                        CSName      Description      FixC
omments  HotFixID   InstallDate  InstalledBy             InstalledOn  Name  Serv
icePackInEffect  Status
http://go.microsoft.com/fwlink/?LinkId=133041  THELMA-LOU  Update
         KB2849697               NT AUTHORITY\SYSTEM     12/11/2013

http://go.microsoft.com/fwlink/?LinkId=133041  THELMA-LOU  Update
         KB2849696               NT AUTHORITY\SYSTEM     12/11/2013

http://go.microsoft.com/fwlink/?LinkId=133041  THELMA-LOU  Update
         KB2841134               NT AUTHORITY\SYSTEM     12/11/2013

http://support.microsoft.com/                  THELMA-LOU  Update
         KB2670838               NT AUTHORITY\SYSTEM     2/27/2013

http://go.microsoft.com/fwlink/?LinkId=161784  THELMA-LOU  Update
         KB971033                NT AUTHORITY\SYSTEM     11/3/2010

http://support.microsoft.com/?kbid=2305420     THELMA-LOU  Security Update
         KB2305420               NT AUTHORITY\SYSTEM     12/16/2010

http://support.microsoft.com/?kbid=2393802     THELMA-LOU  Security Update
         KB2393802               NT AUTHORITY\SYSTEM     2/10/2011

-- More  --

Since the list may be fairly long, you may want to redirect the output to a file. E.g.:

C:\Users\JDoe>wmic qfe list >installed_updates.txt

C:\Users\JDoe>

Another alternative that will provide just the "KB" identifier for each update is to use systeminfo | find ": KB". The list below is the output from a Windows 7 Professional system [Version 6.1 (Build 7601: Service Pack 1) on February 27, 2015. As you can see the list is fairly lengthy.


C:\Users\JDoe>systeminfo | find ": KB"
                           [01]: KB2849697
                           [02]: KB2849696
                           [03]: KB2841134
                           [04]: KB2670838
                           [05]: KB971033
                           [06]: KB2305420
                           [07]: KB2393802
                           [08]: KB2425227
                           [09]: KB2475792
                           [10]: KB2476490
                           [11]: KB2479628
                           [12]: KB2479943
                           [13]: KB2484033
                           [14]: KB2485376
                           [15]: KB2487426
                           [16]: KB2488113
                           [17]: KB2491683
                           [18]: KB2492386
                           [19]: KB2497640
                           [20]: KB2503658
                           [21]: KB2503665
                           [22]: KB2505438
                           [23]: KB2506014
                           [24]: KB2506212
                           [25]: KB2506223
                           [26]: KB2506928
                           [27]: KB2507618
                           [28]: KB2507938
                           [29]: KB2508272
                           [30]: KB2508429
                           [31]: KB2509553
                           [32]: KB2510531
                           [33]: KB2511250
                           [34]: KB2511455
                           [35]: KB2515325
                           [36]: KB2518869
                           [37]: KB2522422
                           [38]: KB2524375
                           [39]: KB2525694
                           [40]: KB2529073
                           [41]: KB2530548
                           [42]: KB2532531
                           [43]: KB2533552
                           [44]: KB2533623
                           [45]: KB2534366
                           [46]: KB2536275
                           [47]: KB2536276
                           [48]: KB2539635
                           [49]: KB2541014
                           [50]: KB2544893
                           [51]: KB2545698
                           [52]: KB2547666
                           [53]: KB2552343
                           [54]: KB2555917
                           [55]: KB2556532
                           [56]: KB2559049
                           [57]: KB2560656
                           [58]: KB2562937
                           [59]: KB2563227
                           [60]: KB2563894
                           [61]: KB2564958
                           [62]: KB2567053
                           [63]: KB2567680
                           [64]: KB2570791
                           [65]: KB2570947
                           [66]: KB2572077
                           [67]: KB2579686
                           [68]: KB2584146
                           [69]: KB2585542
                           [70]: KB2586448
                           [71]: KB2588516
                           [72]: KB2603229
                           [73]: KB2604115
                           [74]: KB2607576
                           [75]: KB2607712
                           [76]: KB2616676
                           [77]: KB2617657
                           [78]: KB2618444
                           [79]: KB2618451
                           [80]: KB2619339
                           [81]: KB2620704
                           [82]: KB2620712
                           [83]: KB2621440
                           [84]: KB2631813
                           [85]: KB2633873
                           [86]: KB2633952
                           [87]: KB2639308
                           [88]: KB2639417
                           [89]: KB2640148
                           [90]: KB2641653
                           [91]: KB2641690
                           [92]: KB2644615
                           [93]: KB2645640
                           [94]: KB2647518
                           [95]: KB2647753
                           [96]: KB2653956
                           [97]: KB2654428
                           [98]: KB2655992
                           [99]: KB2656356
                           [100]: KB2656373
                           [101]: KB2656411
                           [102]: KB2658846
                           [103]: KB2659262
                           [104]: KB2660075
                           [105]: KB2660465
                           [106]: KB2660649
                           [107]: KB2661254
                           [108]: KB2665364
                           [109]: KB2667402
                           [110]: KB2676562
                           [111]: KB2677070
                           [112]: KB2679255
                           [113]: KB2685811
                           [114]: KB2685813
                           [115]: KB2685939
                           [116]: KB2686831
                           [117]: KB2688338
                           [118]: KB2690533
                           [119]: KB2691442
                           [120]: KB2695962
                           [121]: KB2698365
                           [122]: KB2699779
                           [123]: KB2705219
                           [124]: KB2709162
                           [125]: KB2709630
                           [126]: KB2709715
                           [127]: KB2712808
                           [128]: KB2718523
                           [129]: KB2718704
                           [130]: KB2719857
                           [131]: KB2719985
                           [132]: KB2724197
                           [133]: KB2726535
                           [134]: KB2727528
                           [135]: KB2729094
                           [136]: KB2729452
                           [137]: KB2731771
                           [138]: KB2731847
                           [139]: KB2732059
                           [140]: KB2732487
                           [141]: KB2732500
                           [142]: KB2735855
                           [143]: KB2736233
                           [144]: KB2736422
                           [145]: KB2739159
                           [146]: KB2741355
                           [147]: KB2742599
                           [148]: KB2743555
                           [149]: KB2749655
                           [150]: KB2750841
                           [151]: KB2753842
                           [152]: KB2756822
                           [153]: KB2756921
                           [154]: KB2757638
                           [155]: KB2758857
                           [156]: KB2761217
                           [157]: KB2761226
                           [158]: KB2762895
                           [159]: KB2763523
                           [160]: KB2769369
                           [161]: KB2770660
                           [162]: KB2773072
                           [163]: KB2778344
                           [164]: KB2778930
                           [165]: KB2779030
                           [166]: KB2779562
                           [167]: KB2785220
                           [168]: KB2786081
                           [169]: KB2786400
                           [170]: KB2789645
                           [171]: KB2790113
                           [172]: KB2790655
                           [173]: KB2791765
                           [174]: KB2798162
                           [175]: KB2799494
                           [176]: KB2799926
                           [177]: KB2800095
                           [178]: KB2803821
                           [179]: KB2804579
                           [180]: KB2807986
                           [181]: KB2808679
                           [182]: KB2808735
                           [183]: KB2813170
                           [184]: KB2813347
                           [185]: KB2813430
                           [186]: KB2813956
                           [187]: KB2820197
                           [188]: KB2820331
                           [189]: KB2829361
                           [190]: KB2830290
                           [191]: KB2832414
                           [192]: KB2833946
                           [193]: KB2834140
                           [194]: KB2834886
                           [195]: KB2835361
                           [196]: KB2835364
                           [197]: KB2836502
                           [198]: KB2836942
                           [199]: KB2836943
                           [200]: KB2839894
                           [201]: KB2840149
                           [202]: KB2840631
                           [203]: KB2843630
                           [204]: KB2844286
                           [205]: KB2845187
                           [206]: KB2845690
                           [207]: KB2846960
                           [208]: KB2847077
                           [209]: KB2847311
                           [210]: KB2847927
                           [211]: KB2849470
                           [212]: KB2850851
                           [213]: KB2852386
                           [214]: KB2853952
                           [215]: KB2859537
                           [216]: KB2861191
                           [217]: KB2861698
                           [218]: KB2861855
                           [219]: KB2862152
                           [220]: KB2862330
                           [221]: KB2862335
                           [222]: KB2862966
                           [223]: KB2862973
                           [224]: KB2863058
                           [225]: KB2863240
                           [226]: KB2864058
                           [227]: KB2864202
                           [228]: KB2868038
                           [229]: KB2868116
                           [230]: KB2868623
                           [231]: KB2868626
                           [232]: KB2868725
                           [233]: KB2871997
                           [234]: KB2872339
                           [235]: KB2875783
                           [236]: KB2876284
                           [237]: KB2876315
                           [238]: KB2876331
                           [239]: KB2882822
                           [240]: KB2883150
                           [241]: KB2884256
                           [242]: KB2887069
                           [243]: KB2888049
                           [244]: KB2891804
                           [245]: KB2892074

C:\Users\JDoe>

Though 245 are shown above, when I looked at the output of systeminfo without filtering the output with the find command I saw the following line immediately before the list of 245 KB numbers.

Hotfix(s):                 366 Hotfix(s) Installed.

Another option is to use the free WinUpdatesList (WUL) from NirSoft - see Checking Installed Updates with WinUpdatesList (WUL).

[/os/windows/commands] permanent link

Thu, Feb 26, 2015 10:04 pm

Adding a new DNS zone to a Windows Server 2012 DNS server

A Windows Server 2012 Essentials system can function as a Domain Name System (DNS) server. If the system is functioning as a DNS server you can add additional zones that are integrated with Active Directory (AD) or you can add them as file-based zones as you would on a Unix/Linux DNS server. The Windows DNS server can be configured to support forward or reverse lookup zones. A primary, secondary, or stub zone can be added.

[ More Info ]

[/network/dns/windows] permanent link

Thu, Feb 26, 2015 5:37 pm

Conditional formatting with "and" and "or"

I have a spreadsheet I maintain with Microsoft® Excel® 2008 for Mac that I use to track work requests. I color code cells in the spreadsheet so that I can easily identify requests requiring attention or that I need to keep a closer eye on. I use Excel's conditional formatting capability to implement the color coding. Excel only provides a maximum of 3 conditions for conditional formatting, but you can employ formulas using the logical "and" and "or" connectives to use multiple criteria for an individual condition to provide additional flexibility with conditional formatting.

E.g., I have an "Expedite" column, column "O", in the spreadsheet where I place a "Y", if the work request requires an expedited implementation. The normal implementation time should be within 5 business days, but sometimes requests require a more immediate implementation. I also have a status column, column "B", that shows whether a request has been completed or is in some other state, such as "approved", "pending", "clarification required", etc. In any case where there is a "Y" in the Expedite column and the value in the status column doesn't equal "Completed", I want to make the background of the cell where the "Y" appears in the Expedite column red, so I can easily spot ones that I need to track closely to ensure they are completed by the given deadline for the request. I can easily do that with conditional formatting.

To apply that formatting, I can click on one of the cells in column "O", which is the "Expedite" column and then click on Format and select Conditional Formatting and set a formula for the cell. E.g., if I've selected the first row in the spreadsheet, I can use the formula below:

=AND(B1<>"Completed",O1="Y")

The formula specifies that if cell B1 doesn't contain the text "Completed" and cell O1 contains "Y", then the condition is met. I can click on the Format button and then pick the color I want to apply to the cell background, in this case I want it colored red. Conditions that form the logical conjunction are separated by commas.

Conditional Formatting - And

You can also apply conditional formatting with an "or" condition and copy the conditional formatting to other cells as explained there.

[/os/windows/office/excel] permanent link

Wed, Feb 25, 2015 11:22 pm

Where PuTTY Stores SSH port forwarding information

You can configure PuTTY, a free telnet/SSH client program, to port forward connections over an SSH connection by going to "SSH" then "Tunnels" when configuring a session.

PuTTY Configuration - Port Forwarding

Once you've added instances of port forwarding you can't edit those instances through the PuTTY configuration window though you can remove them and add new ones. The information for port forwarding is stored in the registry under the following key where Session_Name is the name for a stored session:

HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Session_Name

Updates are stored when you save a session.

E.g., if I saved a session with the name Omega using the tunneling configuration shown above, the registry entry at HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Omega for a dynamic SOCKS proxy at port 1080 and forwarding for RDP using local port 30,089 forwarded to port 3389 on a system with IP address 192.168.0.5 would be as follows:

Value name:PortForwardings
Value data:D1080=,L30089=192.168.0.5:3389

Regedit - PuTTY Port Forwardings

I could change the details for the port forwardings by editing the registry entry. I would see the changed values when I loaded the session. I could check the information from a command prompt with the following command:

C:\>reg query "HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Omega" /v PortForwardings

HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Omega
    PortForwardings    REG_SZ    D1080=,L30089=192.168.0.5:3389

[/os/windows/network/ssh/putty] permanent link

Mon, Feb 23, 2015 11:48 pm

Disabling notifications for incoming email in Outlook 2013

To disable notifications when email arrives in Outlook 2013, take the following steps:
  1. Select File.
  2. Select Options.
  3. Select Mail.
  4. Uncheck the box next to "Play a sound" if you don't want to hear a sound. If you don't want alerts to pop up, uncheck "Display a Desktop Alert"
  5. Click on OK

[/os/windows/office/outlook] permanent link

Sun, Feb 22, 2015 5:27 pm

Checking on whether a Windows system can be hibernated

On a Microsoft Windows system, you can enable the hibernation feature using the command powercfg /hibernate on or pwercfg /h on.

When you hibernate a Microsoft Windows system, the contents of memory are written to a file, hiberfil.sys, in c:\. If a system has been hibernated, when you power it back on, the contents of hiberfil.sys are read from disk into memory, so bringing a system up from hibernate mode will take longer than bringing it back from sleep mode, which is a power saving mode where the system state is saved to memory.

To check if hibernate mode is available, you can issue the command powercfg /availablesleepstates at a command prompt. E.g., the following example shows the output of the command on a Microsoft Windows 8 system on which hibernate mode has been enabled.

C:\>powercfg /availablesleepstates
The following sleep states are available on this system:
    Standby (S3)
    Hibernate
    Hybrid Sleep
    Fast Startup

The following sleep states are not available on this system:
    Standby (S1)
        The system firmware does not support this standby state.

    Standby (S2)
        The system firmware does not support this standby state.

    Standby (Connected)
        The system firmware does not support this standby state.

Since hibernate mode is enabled on the system, I can use shutdown /h at a command prompt on the system to hibernate he system, even though "hibernate" doesn't appear as one of the options when shutting down the system through the Windows GUI

The example below shows the output from the powercfg /availablesleepstates command issued on a Windows Server 2012 Essentials system after hibernate mode was enabled.

C:\>powercfg /availablesleepstates
The following sleep states are available on this system:
    Hibernate
    Fast Startup

The following sleep states are not available on this system:
    Standby (S1)
        The system firmware does not support this standby state.
        An internal system component has disabled this standby state.
                Graphics

    Standby (S2)
        The system firmware does not support this standby state.
        An internal system component has disabled this standby state.
                Graphics

    Standby (S3)
        An internal system component has disabled this standby state.
                Graphics

    Standby (Connected)
        The system firmware does not support this standby state.

    Hybrid Sleep
        Standby (S3) is not available.

References:

  1. Enabling hibernation on a Windows Server 2012 Essentials system
    Date: February 8, 2015
    MoonPoint Support

[/os/windows/commands] permanent link

Sun, Feb 22, 2015 1:06 pm

Installing Evernote Web Clipper for Chrome

To be able to use Evernote Web Clipper with Chrome, you can take the following steps.
  1. Inside the Chrome browser, click on the menu bar button, which is represented by 3 horizontal lines, one beneath the other, in the top, right-hand corner of the Chrome browser window.
  2. Click on More Tools.
  3. Select Extensions.
  4. Scroll down to you see "Get more extensions" then click on the link for it.
  5. In the "Search the store" field, type Evernote and hit Enter .
  6. Click on "Evernote Web Clipper"
  7. At the "Evernote Web Clipper" page, click on the "+ ADD TO CHROME" button to install the extension.
  8. At the "Confirm New Extension" popup message, click on "Add". You should see a message stating Evernote has been added to Chrome when the installation has completed. You can then sign into your Evernote account.

The icon for Evernote, which is an elephant's head, should then appear next to the Chrome menu bar without having to restart Chrome. You should also see "Evernote Web Clipper" listed as enabled in the Chrome extensions list. You can click on "options" for Evernote Web Clipper in the extensions list to set option values.

Once the extension has been installed You will be able to see the web pages you have saved in Evernote and add additional pages to your Evernote archive.

Note: instructions tested with Chrome 40.0 on a Microsoft Windows system, but should apply to other versions and operating systems as well.

[/network/web/browser/chrome] permanent link

Sat, Feb 21, 2015 9:54 pm

Monitoring an UPS with Windows Server 2012

After connecting a new APC 1300 VA model number BX1300G UPS to a Windows Server 2012 Essentials system, I found that I didn't need to install the UPS manufacturer's software for monitoring the battery state in the UPS. Windows automatically detected the UPS and provided information on the battery charge for the UPS. I had previously enabled hibernation mode on the server, so I configured the system to hibernate when the battery charge for the UPS becomes critically low.

[ More Info ]

[/os/windows/server2012] permanent link

Thu, Feb 19, 2015 11:01 pm

Enabling DNS Logging for Windows Server 2012

I wanted to log DNS queries and responses from all systems using a Windows Server 2012 DNS server, so that I would have DNS logs available for reference in the event of issues related to malware, etc. I also wanted to rotate the log files every night, so that the file size wouldn't grow continually until it reached the maximum 500 MB size I specified for the log file. Instructions for doing so for a Windows Server 2012 system are here. Instructions for doing so on a Microsoft Windows Small Business Server (SBS) are at Enabling DNS Logging on a Windows SBS 2003 Server.

[/network/dns/windows/logging] permanent link

Tue, Feb 17, 2015 8:20 pm

Kaspersky Small Office Security 3 Proxy server is not found

On a system running Small Office Security 3 from Kaspersky Lab International Ltd.1x1 px, I was notified that the antivirus database was not up-to-date. When I had the software attempt to update the virus definitions, I saw the message "Update Center: Task failed. Proxy server is not found."

Kaspersky - proxy server not found

When I viewed the details, the "Detailed report" showed " Update Center: failure (65)"

I then realized I had recently configured Internet Explorer on the system to use a SOCKS proxy server - see Configuring IE 10 to use an SSH SOCKS Proxy Server - so Kaspersky Small Office Security 3 must automatically use the system proxy settings, since I had not altered the configuration of the Kaspersky software, but be unable to communicate with sites if the system proxy setting is configured to use a SOCKS proxy rather than an HTTP proxy. I encountered the same issue with Firefox when it was configured to use the system proxy settings.

I configured Internet Explorer not to use a proxy server and then clicked on the update button within Kaspersky Small Office Security 3. It was then able to update its databases.

[/security/antivirus/Kaspersky] permanent link

Tue, Feb 17, 2015 5:43 pm

Changing the Forwarders in the DNS Manager for Windows Server 2012

If a Windows Server 2012 system is functioning as a DNS server and you need to change the DNS servers it is using as forwarders, i.e., the ones to which it is forwarding DNS requests for external DNS names it can't resolve locally, take the following steps:
  1. Use Ctrl-Esc to get to the Start window where you can click on Administrative Tools.
  2. Double-click on DNS.
  3. In the right pane of the DNS Manager window, double-click on Forwarders.
  4. Click on the Edit button to edit the list of forwarders. You can then add, delete, or modify IP adresses for forwarders.
  5. Click on OK once you have made the needed changes, then click on OK again. You can then close the DNS Manager window.

A DNS server that is configured to use a forwarder functions as follows:

  1. When the DNS server receives a query, it will attempt to resolve the query by using the zones that it hosts and by using its cache.
  2. If it can't resolve the query using local data, the DNS server forwards the query to a DNS server that is designated as a forwarder.
  3. If no forwarders are available, the DNS server will attempt to use its root hints to resolve the query.

When a DNS server forwards a query to a forwarder, it sends a recursive query to a DNS server designated as a forwarder rather than an iterative query that a DNS server sends to another DNS server during standard name resolution (name resolution that does not involve a forwarder).

If you would like further information on forwarders and conditional forwarders, see Understanding Forwarders.

[/os/windows/server2012] permanent link

Tue, Feb 17, 2015 11:46 am

Reverting to a prior revision in Google Sheets

I sorted a spreadsheet created in Google Sheets on a column containing a date in order to revert to my original ordering of the data after sorting on a column containing numbers. The spreadsheet had a header row and another row at the bottom of the column where I summed values in the column I had first sorted on. I was hoping merely to undo the result of the numerical sort and get back to the sorting by date, but I found that the sort on the date column put the header row at the bottom of the worksheet along with the monthly sort by numeric value, i.e., it sorted on those rows as well. I could have avoided including those in the sort by selecting just the rows I wanted sorted by clicking on the first row I wanted sorted and then the last one while holding down the shift key, but I hadn't done that.

I couldn't find any way to unsort the data, i.e., to turn off the sorting to revert to my original ordering, but Google Sheets does provide the capability to revert to a prior version of a document. To do so, click on "File" at the top of the workbook then select "See revision history", which you can also get to by Ctrl+Alt+Shift+G. You will then see a "Revision history" list with the times of prior revisions. You can select one of those to restore a prior version of the workbook. When you click on the entry for a prior revision, a link will appear beneath it to "Restore this revision". You will also be shown the workbook as it looked for the prior revision, so you can decide whether that is the revision you wish to restore before actually restoring it.

[/network/web/services/google] permanent link

Mon, Feb 16, 2015 9:26 pm

phpMyAdmin 4.3.6 on CentOS 7

When I tried accessing phpmyadmin on a CentOS 7 server running the Apache webserver software using http://example.com/phpmyadmin, I received the message below:

Forbidden

You don't have permission to access /phpmyadmin on this server.

I got the same error if I tried using the IP address of the system instead of example.com.

I could see the phpMyAdmin files on the system in /usr/share/phpMyAdmin and the rpm command showed the package for it was installed on the system.

# rpm -qa | grep Admin
phpMyAdmin-4.3.6-1.el7.noarch

And when I logged into the web server, opened a browser, and pointed it to http://localhost/phpmyadmin, I was able to get the phpMyAdmin login prompt. I could also get to the setup page at http://localhost/phpmyadmin/setup. I still received the "forbidden" error message if I tried the IP address of the system in the address bar of the browser while logged into the system, though.

I encountered the same error message about 4 years ago as noted in Installing phpMyAdmin on a CentOS System Running Apache. In that case my notes indicated I edited the phpmyadmin.conf file to add access from an additional IP address. But when I looked for a phpadmin.conf file on the current system, there was none to be found. After a little further investigation, though, I found I should have been looking for phpMyAdmin.conf rather than phpmyadmin.conf. I.e., I needed to look for a file with a capital "M" and "A" in the file name.

# locate phpMyAdmin.conf
/etc/httpd/conf.d/phpMyAdmin.conf

I then added 192.168 after the instances of the localhost address, 127.0.0.1, in the Directory /usr/share/phpMyAdmin/ section of /etc/httpd/conf.d/phpMyAdmin.conf as shown below, since the other systems on the LAN had addresses in the 192.168.xxx.xxx range, so I could access phpMyAdmin from any other system on the LAN.

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1 192.168
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1 192.168
     Allow from ::1
   </IfModule>
</Directory>

I then restarted the Apache web server software by running apachectl restart from the root account. I was then able to access phpMyAdmin using the internal IP address of the system, e.g., http://192.168.0.5/phpmyadmin, though http://example.com/phpmyadmin didn't work because even though I was trying to access the server from a system on the same LAN by using the fully qualified domain name (FQDN), I was then accessing the system by the external address on the outside of the firewall/router it sits behind. But, in this case, accessing it by IP address was sufficient.

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

Mon, Feb 16, 2015 3:59 pm

Scheduling a task to run periodically with schtasks

On newer versions of the Microsoft Windows operating system, such as Windows 2008 and Server 2012, the at command that could be used on earlier versions of Windows to schedule the execution of batch jobs at a specified interval has been deprecated. The command has been replaced with schtasks. You can use schtasks to specify how frequently a batch job should be run, the account it should be run from, the time the task should run, an end time, end date, etc.

C:\Users\JDoe>schtasks /?

SCHTASKS /parameter [arguments]

Description:
    Enables an administrator to create, delete, query, change, run and
    end scheduled tasks on a local or remote system.

Parameter List:
    /Create         Creates a new scheduled task.

    /Delete         Deletes the scheduled task(s).

    /Query          Displays all scheduled tasks.

    /Change         Changes the properties of scheduled task.

    /Run            Runs the scheduled task on demand.

    /End            Stops the currently running scheduled task.

    /ShowSid        Shows the security identifier corresponding to a scheduled t
ask name.

    /?              Displays this help message.

Examples:
    SCHTASKS
    SCHTASKS /?
    SCHTASKS /Run /?
    SCHTASKS /End /?
    SCHTASKS /Create /?
    SCHTASKS /Delete /?
    SCHTASKS /Query  /?
    SCHTASKS /Change /?
    SCHTASKS /ShowSid /?

[ More Info ]

[/os/windows/commands] permanent link

Sun, Feb 15, 2015 10:42 pm

Using PuTTY to set up a SOCKS Proxy Connection

A SOCKS proxy can be set up from a system using an encrypted tunnel established via an SSH connection to an SSH server, e.g., see Creating a Socks Proxy Server with SSH. On a Microsoft Windows system, the free PuTTY telnet and SSH client software can be used to set up such a connection. After configuring PuTTY to establish a SOCKS proxy via its connection to the SSH server, any browser that supports SOCKS proxies, such as Internet Explorer, Chrome, Firefox, etc., can be configured to route its traffic to web servers via the SOCKS proxy.

[ More Info ]

[/network/proxy] permanent link

Sat, Feb 14, 2015 11:19 pm

Determining image information from the command line on OS X using file

For a file that is an image, you can determine the type of image from a shell prompt, e.g., from a Terminal window, on an OS X system using the file command:

$ file menu_button
menu_button: PNG image data, 18 x 18, 8-bit/color RGB, non-interlaced

For PNG images, the command will also reveal the size of the image, e.g., for the example above the image is 18 pixels wide by 18 pixels high. The first number is the width and the second number is the height, though in this case the height equals the width.

The command can be useful if a file has a missing extension or if you need to verify that the file extension matches the actual image type.

The command determines the type of image stored in a file from a "magic number" stored near the beginning of the file. For PNG images, the PNG file header, which is the first 8 bytes of the file, will contain ASCII 89 P N G cr nl sub nl. CR represents a carriage return (octal 15, decimal 13, hexadecimal 0D) and NL represents a newline, aka line feed, character (decimal 10, octal 12, hexadecimal 0A). ASCII SUB is octal 032, decimal 26 and hexadecimal 1A. The first character before "PNG" is octal 211, which is decimal 137 and hexadecimal 89.

You can see the characters at the beginning of the file using the od utility, which is a filter which displays the specified files, or standard input if no files are specified, in a specified format. Supported formats include octal, decimal, hexadecimal, or ASCII. E.g, to display the first 8 bytes of a file in ASCII format, you can use the -a option to display the data in ASCII format and the -N option to display only the first 8 bytes.

$ od -a -N 8 menu_button 
0000000   89   P   N   G  cr  nl sub  nl                                
0000010

The 89 is the hexadecimal number for the first byte; that is 137 in decimal and 211 in octal. The first 8 bytes in octal format are shown below:

$ od -b -N 8 menu_button 
0000000   211 120 116 107 015 012 032 012                                
0000010

The hexdump command with the -C ("C" stands for "canonical") option can be used to display both hexadecimal and ASCII output at the same time.

$ hexdump -C -n 8 menu_button
00000000  89 50 4e 47 0d 0a 1a 0a                           |.PNG....|
00000008

For GIF files, file displays the size of the image with the first number, 165 in the example below, being the width and the second number, 57, being the height.

$ file home.gif
home.gif: GIF image data, version 89a, 165 x 57

File can determine that a file is a GIF file because for a GIF file the first 6 characters of the file will be ASCII GIF87a.

$ od -a -N 6 home.gif
0000000    G   I   F   8   9   a                                        
0000006

You can display both the hexadecimal and ASCII characters with the hexdump command using the -C option.

$ hexdump -C -n 6 home.gif
00000000  47 49 46 38 39 61                                 |GIF89a|
00000006

For JPG files, the file command won't display the image dimensions, but will display any comments stored within the image.

$ file A12.jpg
A12.jpg: JPEG image data, JFIF standard 1.01, comment: "Processed By eBay with ImageMag"

The first two bytes of a JPG file are hexadecimal FF D8 and the last two bytes in the file are hexadecimal FF D9

$ hexdump -n 2 A12.jpg
0000000 ff d8                                          
0000002
$ hexdump A12.jpg
<text snipped>
00047c0 17 b2 96 08 0b 42 70 10 38 01 33 45 d0 7f ff d9
00047d0

[/os/os-x] permanent link

Sat, Feb 14, 2015 4:43 pm

Correcting "Windows Installer Service could not be accessed" Problem

When I tried to install Norton Ghost 7.5 on a Windows Small Business Server (SBS) 2003 server, I received the message below:
Windows Installer
The Windows Installer Service could not be accessed.
This can occur if you are running Windows in safe
mode, or if the Windows Installer is not correctly
installed. Contact your support personnel for assistance.

[ OK ]

I downloaded Windows Installer 3.1 Redistributable (v2) From Microsoft's Download Center and installed it, but I got the same results when I tried to reinstall Symantec Ghost 7.5.

Microsoft's article, "Error 1719: The Windows Installer service could not be accessed" error message when you try to add or remove a program states the behavior may occur if the following conditions are true:

I was starting the Symantec Gost 7.5 installation process from a CD with an autorun file, but I noticed there was a file, Symantec Ghost.msi in an Install directory on the CD. The installation process likely uses the .msi file for the installation.

Microsoft's article recommends steps to resolve the problem. You should first determine the location of the file msiexec.exe on your system. The file will be in the Windows system32 directory, which is usually either C:\Windows\system32 or C:\WINNT\system32 for versions of Windows after Windows 98. For Windows 98 the file is usually in C:\Windows\System. You can search for the file or you can determine the Windows directory by obtaining a command prompt and checking the value of the %WINDIR% environment variable with echo %WINDIR%, which will tell you which directory is the Windows directory on a system. You can then verify that msiexec.exe is in that directory.

C:\>dir %WINDIR%\system32\msiexec.exe
 Volume in drive C has no label.
 Volume Serial Number is E88C-7773

 Directory of C:\Windows\system32

03/21/2005  02:00 PM            78,848 msiexec.exe
               1 File(s)         78,848 bytes

You then need to check the registry to make sure that HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer\ImagePath has a value that corresponds to the actual location of the msiexec.exe file on the system. You can do so using the regedit command or using a reg query command from a command prompt.

C:\>reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer
    Description    REG_SZ    Adds, modifies, and removes applications provided a
s a Windows Installer (*.msi) package. If this service is disabled, any services
 that explicitly depend on it will fail to start.
    Type    REG_DWORD    0x20
    Start    REG_DWORD    0x3
    ErrorControl    REG_DWORD    0x1
    ImagePath    REG_EXPAND_SZ    C:\Windows\system32\msiexec.exe /V
    DisplayName    REG_SZ    Windows Installer
    DependOnService    REG_MULTI_SZ    RpcSs
    DependOnGroup    REG_MULTI_SZ
    ObjectName    REG_SZ    LocalSystem

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer\Security
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer\Enum

If the msiexec.exe file is in C:\Windows\System32, you should see C:\Windows\System32\Msiexec.exe /V as the value in the key. In the case of the system I was working on, the file location matched the registry value.

If the values don't match, you will need to enter the correct path in the registry or put the file in the directory listed in the registry. Once the values match, you will need to reregister the msiexec.exe file. To do so, restart the computer in Safe Mode (hit F8 to get the menu of boot options before Windows starts when you reboot).

Once you've logged into an administrator account on the system in Safe Mode, you will need to use the following procedure:

Click Start, click Run, type the following line, and then click OK:

msiexec /regserver

Note: For 64-bit operating systems, you also need to reregister the 64-bit MSI installer. To do this, click Start, click Run, type the following line, and then click OK:

Drive:\Windows\Syswow64\Msiexec /regserver

On 64-bit editions of a Windows operating system, 32-bit binaries are located in %systemroot%\SysWow64 folder. 64-bit binaries are located in the %systemroot%\System32 folder.

Once you have reregistered the msiexec.exe file, you will need to reboot into standard mode. Then try the installation process again that failed previously. If that fails, Microsoft does offer another alternative for dealing with the problem. See "Method 2" at "Error 1719: The Windows Installer service could not be accessed" error message when you try to add or remove a program.

In my case, I was then able to successfully reinstall Symantec Ghost 7.5 on the system, though I did receive another error at the end of the process that was not associated with the previous installer problem. The error I received at the end is shown below.

Symantec Ghost Configuration Server
08001 [Sybase[[ODBC driver][Adaptive Server Anywhere]Unable to connect to
database server: Database server not running

[ OK ]

References:

  1. Windows Installer 3.1 Redistributable (v2)
    Date Published: September 2, 2005
    Microsoft Download Center
  2. "Error 1719: The Windows Installer service could not be accessed" error message when you try to add or remove a program
    Article ID : 315346
    Last Review : March 1, 2007
    Microsoft Help and Support
  3. File Extension Details for .MSI
    FileExt

[/os/windows/utilities/backup/ghost] permanent link

Fri, Feb 13, 2015 10:45 pm

Hiding an Account from the Windows 7 Welcome Screen

To hide an account from the Microsoft Windows 7 welcome screen, take the following steps:
  1. Click on the Start button.
  2. Type regedit in the "Search programs and files" field and hit Enter.
  3. When prompted if you want to allow the program to make change to the system, choose "yes".
  4. Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\
  5. Right-click on Winlogon and choose "New" then "Key" and put SpecialAccounts for the key name.
  6. Right-click on SpecialAccounts and choose "New" then "Key" and put Userlist for the key name.
  7. Right-click on UserList on the left side of the window and select New and then DWORD (32-bit) Value.
  8. You'll see the new entry in the right pane of the window, rename this value, which by default will be labelled "New Value #1", to the name of the user account you want hidden. It should be exactly how it is listed on the welcome screen you see when the system starts. Leave the value at 0.
  9. You can then close the registry editor by clicking on File then Exit.

Now when you logoff, you shouldn't see the hidden account on the welcome screen. If you still see it, reboot.

Note: unlike with hidden accounts under Windows XP, you can't log into a hidden account by hitting the Ctrl, Alt, and Del keys.

[/os/windows/win7] permanent link

Fri, Feb 13, 2015 4:50 pm

Countif greater than or equal to a date

If you want to determine the number of entries in a spreadsheet that have a date value that is greater than or equal to a particular date, you can use the COUNTIF function in Excel. E.g., if you had dates in column G rows 4 through 959 and wished to know the number of rows with a date that was greater than or equal to October 15, 2014, you could use the formula below, assuming you are using the common U.S. style of date in the form mm/dd/yyyy.

=COUNTIF(G4:G959,">=10/15/2014")

Suppose, instead, that you had a date in F970 and you wished to use whatever date you had in that cell for the date comparision operation. You could then use the following formula:

=COUNTIF(G4:G959,">="&F970)

The ampersand before the F970 concatenates the value in that cell to the string >=, so that if cell F970 contains the date value 10/15/2014, COUNTIF will only count cells containing a date greater than or equal to that date.

[/os/windows/office/excel] permanent link

Fri, Feb 13, 2015 4:38 pm

Paste stopped working on OS X 10.8.5 laptop

On a MacBook Pro running OS X 10.8.5, the paste operation stopped working. I didn't receive any error messages whenever I tried to copy text in an application, but if I then tried to paste anything into that application or any other, nothing would be pasted. Copying and pasting didn't work with Command-C and Command-V nor by selecting the copy and paste functions from applications' menus. Nor did cutting with Command-X and then pasting with Command-V work.

When I went to Edit and selected Show Clipboard within the Finder, I saw "Clipboard contents: none".

The solution I found after some online searching was to kill the PasteBoard, aka clipboard, process and restart it. That allowed me to use copy and paste without rebooting the computer.

$ ps -A | grep pboard | grep -v grep
  464 ??         0:00.03 /usr/sbin/pboard
$ kill -s HUP 464
$ ps -A | grep pboard | grep -v grep
$ 
$ launchctl start com.apple.pboard
$ ps -A | grep pboard | grep -v grep
49810 ??         0:00.00 /usr/sbin/pboard

To be able to use copy and paste after restarting the pboard process, you will need to close and reopen any application in which you need to copy and paste data after you restart the process. You won't see data that is copied appear in the clipboard shown by the Finder until you restart the Finder, which you can do by clicking on the Apple icon at the top left of your screen and then selecting Force Quit, then clicking on Finder within the Force Quit Applications window to select it, and then clicking on the Relaunch button. After you do that, you can click on Edit and Show Clipboard within the Finder and see what was previously copied into the clipboard before restarting the Finder.

If you have an application open that was open before you restarted the PasteBoard, if you try copying something from it, it won't appear in the clipboard. You will have to restart that application to copy anything from it.

[/os/os-x] permanent link

Mon, Feb 09, 2015 10:24 pm

Managing Chrome Cookies

To manage cookies in Google Chrome, take the following steps:
  1. Click on the Chrome menu bar, which is 3 short, horizontal lines, one below the other at the top of the Chrome browser window.
  2. Click on Settings.

    Note: you can also get to the settings window by putting chrome://settings/ in the Chrome address bar.

  3. Scroll down until you see "Show advanced settings", then click on "Show advanced settings".
  4. In the Privacy section, click on the Content settings button.
  5. At the Content settings window, click on the All cookies and site data button.

    Chrome Content settings

    Note: you can also get to this window by putting chrome://settings/content in the browser address bar.

You will now see a Cookies and site data window showing you a list of all the cookies Chrome has stored.

Chrome cookies and site data

If you only want to check on cookies for a particular site, you can put the site name in the "Search cookies" field next to the Remove all button to display just the cookies associated with that domain name as shown below where only the cookies pertaining to arin.net are displayed.

Chrome cookies for arin.net

You dont' need to type in a complete domain name. E.g., if you wanted to search for any cookies associated with a website with a domain name beginning with "mysite", you could simply enter mysite for the search criteria. If you wanted to delete the cookies for that site, with only the relevant cookies for that site displayed by the search criteria, you could click on Remove all to get rid of just the cookies for that site.

Note: a shortcut to get to this list is to put chrome://settings/cookies in the Chrome address bat.

[/network/web/browser/chrome] permanent link

Sun, Feb 08, 2015 11:10 pm

Enabling hibernation on a Windows Server 2012 Essentials system

The command shutdown /h can be used to hibernate a Microsoft Windows system. If you run the command on a Windows Server 2012 Essentials system which hasn't had hibernation mode enabled, you will see the following message:

PS C:\Users\User> shutdown /h
Hibernation is not enabled on this system. You must enable hibernation in order to use the -h option.

To enable hibernation, you can issue the command powercfg /hibernate on from a PowerShell prompt. However, you may see the message below when you enter the command:

PS C:\Users\User> powercfg /hibernate on
An unexpected error condition has occurred.  Unable to perform operation.  You may not have permission to perform this o
peration.

To enable hibernation, right-click on the PowerShell icon, which looks like a button with a ">_" in it, then choose "Run as Administrator" and then issue the powercfg command.

Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> powercfg /hibernate on
PS C:\Windows\system32>

Once you've done that, you can hibernate the system with shutdown /h.

[/os/windows/server2012] permanent link

Sat, Feb 07, 2015 10:24 pm

Obtaining a command prompt with administrator access under Windows 7

To open a command prompt with administrator access under Windows 7 you can take the following steps:
  1. Click on the Windows Start button.
  2. In the "Search programs and files" field type cmd.

    Programs cmd.exe

  3. Right-click on cmd.exe and choose "Run as administrator". Provide a userid and password for an account in the administrators group when prompted.

Alternatively, you can open a command prompt with administrator access from a command prompt you've opened from a standard user account by typing runas /user:administrator cmd.exe. Or you can substitute the name of some other account with administrator access instead of "administrator". Enter the password for the account when prompted to provide it.

[/os/windows/win7] permanent link

Thu, Feb 05, 2015 10:50 pm

Chrome menu bar color changes

The Google Chrome menu bar, which consists of three horizontal bars, one beneath the other, in the upper, right-hand corner of a Chrome window will change color if Chrome is not up-to-date. Normally the 3 lines are black, but they will change to green, orange, or red if the version of the Chrome browser that you are using is no longer current. E.g., in the screen shot below taken on a Mac OS X system running Chrome 35.0, the bars have turned red. The menubar color changes apply to Chrome on other operating sytems as well. Clicking on the menubar shows a list of menu options, but also a "Chrome is Out of Date" message.

Chrome out of date

The menu bar color shows how long an update has been available:

ColorHow long an update has been available
Green Chrome menu bar2 days
Orange Chrome menu bar4 days
Red Chrome menu bar7 or more days

To configure Chrome to update automatically on a Mac OS X system, you can select "About Google Chrome" from the menu that is accessible from the menu bar then click on the "Set Up Automatic Updates for All Users" button.

References:

  1. Update Google Chrome
    Google Help

[/network/web/browser/chrome] permanent link

Sat, Jan 31, 2015 11:13 pm

Searching Windows event logs with get-eventlog

If you want to search a Windows event log for occurrences of a particular eventid, you can use the Windows PowerShell cmdlet get-eventlog. E.g., to search the system event log, you would include that as a parameter after get-eventlog. If I wanted to search that log for all instances of the event id 5, I could use the command below:
c:\>powershell
Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS c:\> get-eventlog "system" | where-object {$_.EventID -eq 5}

   Index Time          EntryType   Source                 InstanceID Message
   ----- ----          ---------   ------                 ---------- -------
     798 Nov 29 20:27  Error       Microsoft-Windows...            5 The des...


PS C:\>

Sometimes there may be many occurences of a particular eventid in a log file. You can limit the display to those before or after a particular date using -before or -after as shown below for a search of the application event log:

PS C:\> get-eventlog -LogName "application" | where-object {$_.EventID -eq 753}

   Index Time          EntryType   Source                 InstanceID Message
   ----- ----          ---------   ------                 ---------- -------
    6239 Jan 25 22:29  Information Microsoft-Windows...          753 The Blo...
    2108 Dec 27 21:17  Information Microsoft-Windows...          753 The Blo...
    2099 Dec 27 21:00  Information Microsoft-Windows...          753 The Blo...
    1380 Nov 29 22:18  Information Microsoft-Windows...          753 The Blo...
    1359 Nov 29 22:05  Information Microsoft-Windows...          753 The Blo...
    1278 Nov 29 20:37  Information Microsoft-Windows...          753 The Blo...


PS C:\> get-eventlog -LogName "application" -before 2015-01-01 | where-object {$
_.EventID -eq 753}

   Index Time          EntryType   Source                 InstanceID Message
   ----- ----          ---------   ------                 ---------- -------
    2108 Dec 27 21:17  Information Microsoft-Windows...          753 The Blo...
    2099 Dec 27 21:00  Information Microsoft-Windows...          753 The Blo...
    1380 Nov 29 22:18  Information Microsoft-Windows...          753 The Blo...
    1359 Nov 29 22:05  Information Microsoft-Windows...          753 The Blo...
    1278 Nov 29 20:37  Information Microsoft-Windows...          753 The Blo...


PS C:\> get-eventlog -LogName "application" -after 2015-01-01 | where-object {$_
.EventID -eq 753}

   Index Time          EntryType   Source                 InstanceID Message
   ----- ----          ---------   ------                 ---------- -------
    6239 Jan 25 22:29  Information Microsoft-Windows...          753 The Blo...


PS C:\>

If you only want to see error events in a log, e.g. errors in the application log, you could use a command such as the one shown below:

PS C:\> get-eventlog -LogName "application" -entrytype error

   Index Time          EntryType   Source                 InstanceID Message
   ----- ----          ---------   ------                 ---------- -------
    6599 Jan 31 20:19  Error       Microsoft-Windows...         2005 There w...
    6596 Jan 31 20:19  Error       Microsoft-Windows...         2005 There w...
    6455 Jan 28 22:38  Error       Microsoft-Windows...         2006 There w...
    6427 Jan 28 02:13  Error       Microsoft-Windows...          513 Cryptog...
    6383 Jan 27 21:55  Error       VSS                          8194 Volume ...
    6340 Jan 26 19:31  Error       VSS                          8194 Volume ...
    6240 Jan 25 22:29  Error       Microsoft-Windows...          513 Cryptog...

You can get help on using the get-eventlog cmdlet by typing help get-eventlog at a PowerShell prompt.

PS C:\> help get-eventlog

NAME
    Get-EventLog

SYNTAX
    Get-EventLog [-LogName] <string> [[-InstanceId] <long[]>] [-ComputerName
    <string[]>] [-Newest <int>] [-After <datetime>] [-Before <datetime>]
    [-UserName <string[]>] [-Index <int[]>] [-EntryType <string[]> {Error |
    Information | FailureAudit | SuccessAudit | Warning}] [-Source <string[]>]
    [-Message <string>] [-AsBaseObject]  [<CommonParameters>]

    Get-EventLog [-ComputerName <string[]>] [-List] [-AsString]
    [<CommonParameters>]


ALIASES
    None


REMARKS
    Get-Help cannot find the Help files for this cmdlet on this computer. It
    is displaying only partial help.
        -- To download and install Help files for the module that includes
    this cmdlet, use Update-Help.
        -- To view the Help topic for this cmdlet online, type: "Get-Help
    Get-EventLog -Online" or
           go to http://go.microsoft.com/fwlink/?LinkID=113314.




PS C:\>

[/os/windows/PowerShell] permanent link

Fri, Jan 30, 2015 11:14 pm

Windows color command

By default, when you open a command prompt window on a Microsoft Windows system, you get a window with a black background and white text. If those color choices are not the ones you would prefer, you can change them with the color command.
C:\Windows\system32>color /?
Sets the default console foreground and background colors.

COLOR [attr]

  attr        Specifies color attribute of console output

Color attributes are specified by TWO hex digits -- the first
corresponds to the background; the second the foreground.  Each digit
can be any of the following values:

    0 = Black       8 = Gray
    1 = Blue        9 = Light Blue
    2 = Green       A = Light Green
    3 = Aqua        B = Light Aqua
    4 = Red         C = Light Red
    5 = Purple      D = Light Purple
    6 = Yellow      E = Light Yellow
    7 = White       F = Bright White

If no argument is given, this command restores the color to what it was
when CMD.EXE started.  This value either comes from the current console
window, the /T command line switch or from the DefaultColor registry
value.

The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute
the COLOR command with a foreground and background color that are the
same.

Example: "COLOR fc" produces light red on bright white

C:\Windows\system32>

If you would prefer black text on a white background, you can use color 70, though the background color looks like a light gray on the systems on which I've tried that color combination, rather than white.

Black on white command window

The command color f0, which is for black on bright white, does provide a white background with black text, though, on those same systems.

Black on bright white command window

If you don't like a color combination you've obtained from the command, you can set the colors back to the default white text on a black background by entering the color command with no options.

If you want to make the change apply to every command prompt window you open for the currently logged on account, you can use the windows regedit command to edit the registry key HKEY_CURRENT_USER\Software\Microsoft\Command Processor and change the value for DefaultColor from its default value of 0 to the hexadecimal value f0, which is decimal 240.

Registry default command processor color f0

Once you've changed the registry value, every new command prompt window you open from that time onwards will use the new settings.

You can check on the registry value from a command prompt with the command reg query "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DefaultColor.

C:\Users\User>reg query "HKEY_CURRENT_USER\Software\Microsoft\Command Processor"
 /v DefaultColor

HKEY_CURRENT_USER\Software\Microsoft\Command Processor
    DefaultColor    REG_DWORD    0x0

You can set the value from the command prompt with a command similar to the following one:

C:\Users\User>reg add "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /
v DefaultColor /t REG_DWORD /d 240 /f
The operation completed successfully.

C:\Users\User>

The data to be used is specified with the /d option. In the above case, I am using the decimal equivalent, 240, to the hexadecimal number F0 and adding the /f option, so that I won't be prompted as to whether I wish to overwrite the existing value.

[/os/windows/commands] permanent link

Thu, Jan 29, 2015 11:18 pm

Word to Clean HTML

I maintain a website for an association with a little over 2,500 members that sends a monthly newsletter to members. The newsletter is sent by the U.S. Postal Service and email and I also convert the Microsoft Word document the newsletter editor sends me to HTML and post it to the association's website, which I've been maintaining for years now. The newsletter editor uses Microsoft Word to produce the newsletter. I tried Microsoft Word's "Save as Web Page" feature initially, but parts of the HTML code it produced didn't display properly on non-Microsoft Windows systems, sometimes because they didn't have the same fonts as those present on Microsoft Windows systems. And the code looked messy when I would edit the HTML version of the newsletter produced by Microsoft Word. Eventually, I decided it was actually quicker to just copy the text from Word, paste it into the Vi text editor and add the appropriate HTML formatting tags manually to get the newsletter to look close to the original Word version, but in a format that would display similarly across browsers and operating systems.

The copying, pasting, and editing process can take an hour or more, so when I came across the Word to Clean HTML site, which provides a free tool to convert documents produced by Microsoft Word and similar office software to HTML, I pasted the newsletter into its online form for conversion. The tool "strips out invalid or proprietary tags leaving clean HTML behind for use in web pages and ebooks", I hoped it might save me a fair portion of the time I normally spend each month on the manual conversion process and allow me to get the newsletter posted more promptly after I receive it. So, I copied the contents of the newsletter with command-C (I'm normally handling it on a Mac) and then pasted it into the form on the site's webpage. I checked a couple of the options that weren't checked by default: replace non-ascii with HTML entities and replace smart quotes with ascci equivalents. I then clicked on the convert to clean html button.

The HTML code produced by the tool was much cleaner than that produced by Word and gave me code that looked the same when viewed from browsers on different operating systems. I wouldn't have needed to do any editing to have the newsletter display appropriately, but I noticed that for an unordered list that at the end of each <li> entry there were extraneous <strong><u></u></strong> tags, i.e. there wasn't any text enclosed by the tags, which weren't needed. But that wouldn't have affected members' view of the newsletter. I removed it though, and made the source code a little more readable by putting in some blank lines between some of the items. But that wasn't really needed and by using the free online tool I should, hopefully, be able to reduce the process of posting the newsletter to about 15 minutes and get the newsletter posted shortly after I receive it now, so I'm thankful to Olly Cope, a freelance python web developer, for making it freely available to others. The tool was written in Python using the lxml library.

[/os/windows/office/word] permanent link

Wed, Jan 28, 2015 11:54 pm

Reducing the size of the Calendar folder in Entourage 2008

If you have a maximum storage limit on a Microsoft Exchange server and need to reduce the amount of storage you are using and have Entourage 2008 as your email client, you can check the overall space consumed by right-clicking on the icon representing the Exchange server that appears above your Inbox on the server, then select Folder Properties then Storage. You will then see a figure for "Total size (with subfolders)". One way to reduce the amount of storage space consumed is to reduce the size of the Calendar subfolder by removing outdated entries. You can see its size in the list of all subfolders or you can right-click on Calendar in the left pane of the Entourage window and choose Folder Properties then Storage.

Entourage Folder Properties: Calendar

From the left pane of the Entourage window, you can select old entries by clicking on Calendar then selecting Edit from the menu bar at the top of the window and then selecting Advanced Search. For "Item Contains", select "End Date" and, instead of "Any Date", select "Greater Than". Then put in a number of days in the field to the right of "Greater Than". E.g., I could put in 730 to find any calendar entry that was more than two years old. You can then delete all of those old entries, though you may receive many prompts for "You have chosen to cancel this event. Do you want to notify the Organizer?" After you've finished, you can then right-click on Calendar again and select Properties and Storage to see how much space you freed be removing the old entries.

[/network/email/clients/entourage] permanent link

Tue, Jan 27, 2015 10:52 pm

Using xlrd to extract a column from an Excel spreadsheet

The xlrd module provides the capability to work with Microsoft Excel spreadsheets in Python. I wanted to be able to use a Python script to extract the data from one column of an Excel worksheet and write the data to a text file which I could further process with another script. Xlrd, which is a package for reading data and formatting information form Excel files, allowed me to easily extract just the data I needed, which was a list of email addresses, from the spreadsheet. A tutorial is provided for installing and using the module.

[ More Info ]

[/languages/python] permanent link

Mon, Jan 26, 2015 11:12 pm

Shrink div width to fit contents

I sometimes want to have the width of a div element on a webpage stretch only as far as the width of the text contained within it. E.g., if I want to show the text I see displayed in a command prompt window on a Microsoft Windows system or a shell prompt on a Linux or OS X system in an area on the web page with a black background and white text within it, I will enlose the text in a div such as the following:
<div style="background-color: black; color: white;"><pre>
C:\Windows\system32>wbadmin get items -version:01/25/2015-18:00
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2012 Microsoft Corporation. All rights reserved.

Volume ID = {46a6263c-8cbc-11e4-93ed-806e6f6e6963}
Volume 'RECOVERY', mounted at <not mounted> ('RECOVERY', mounted at <not mounted
> at the time</pre></div>

Which would display as shown below:

C:\Windows\system32>wbadmin get items -version:01/25/2015-18:00
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2012 Microsoft Corporation. All rights reserved.

Volume ID = {46a6263c-8cbc-11e4-93ed-806e6f6e6963}
Volume 'RECOVERY', mounted at <not mounted> ('RECOVERY', mounted at <not mounted
> at the time

But that will make the area with the black background extend across the entire page rather than only as far as the 80th character on the page, i.e., the "d" at the end of "mounted", which is where the line wraps in the command prompt window. I can add width: 80ch; to the style section to specify that I only want it to be 80 characters wide, i.e., I can use the following:

<div style="background-color: black; color: white; width: 80ch;"><pre>

The width of a character is judged to be the width of the zero character in the current font, but I've found that won't always work in all browsers and may give me an area that, though it doesn't now extend across the whole page when I don't want it to do so, may be too wide or too narrow depending upon the browser in which I'm viewing it. The above example is shown again below with the style information changed to include width: 80ch;.

C:\Windows\system32>wbadmin get items -version:01/25/2015-18:00
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2012 Microsoft Corporation. All rights reserved.

Volume ID = {46a6263c-8cbc-11e4-93ed-806e6f6e6963}
Volume 'RECOVERY', mounted at <not mounted> ('RECOVERY', mounted at <not mounted
> at the time

When I view the page in Chrome version 39, the above div is wider than I want, i.e, it extends far beyond the "d" in "mounted", i.e., far beyond the 80th character. Though when I view it in Firefox 35, I see the width of the div extending only as far as the 80th character. If I view it with Internet Explorer, it is not wide enough, so I see the black area terminated after "mounted at <" with the followng "n" only partially visible and the rest of the line invisible.

Another option is to use display: inline-block;, instead, i.e., I can change the div line to be the following:

<div style="background-color: black; color: white; display: inline-block;"><pre>

The div section then displays the following when I've ended the line of text I want wrapped at the 80th character at that character:

C:\Windows\system32>wbadmin get items -version:01/25/2015-18:00
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2012 Microsoft Corporation. All rights reserved.

Volume ID = {46a6263c-8cbc-11e4-93ed-806e6f6e6963}
Volume 'RECOVERY', mounted at <not mounted> ('RECOVERY', mounted at <not mounted
> at the time

The width of the black backround, i.e., the width of the div, extends only as far as the width of the longest element within it, which is the line I ended at the 80th character and works in all three browsers.

So I added the following line to the style.css file for the site:

.commandprompt { background-color: black; color: white; display: inline-block; }

So I can then use <div class="commandprompt"><pre> when I want a div, which will only contain text from a shell or command prompt window, to stretch only as far as to accomodate the longest element within it, which will be an 80 character line. So the div will stretch, or shrink, however you prefer to view it, to fit.

[/network/web/html/css] permanent link

Sun, Jan 25, 2015 11:03 pm

Checking the status of a server backup with wbadmin

If you've set up server backups on a Windows Server 2012 Essentials system, the wbadmin command can be run from a command prompt to check the status of backups and view the available backups and the items they contain. The command is available for Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista and Windows 8, also; i.e., it can be run on workstations as well as servers. The command will allow you to back up and restore a systems's operating system, volumes, files, folders, and applications from the command line.

[ More Info ]

[/os/windows/commands] permanent link

Sat, Jan 24, 2015 11:25 pm

Setting Up Windows Server 2012 Essentials server backup

One of the steps in setting up a Windows Server 2012 Essentials system is to configure the server for automatic backups of the system to another drive. You can configure the system to backup the operating system, server folders, and other items by selecting "Set up Server Backup" from the Dashboard. The drive, or drives, you select to be used for the automatic backups, may be reformatted, so don't select a drive that has files you wish to retain without copying them elsewhere first. You can configure the backups to run at multiple times during the day; Microsoft recommends you backup the server at least twice per day.

[ More Info ]

[/os/windows/server2012] permanent link

Sat, Jan 24, 2015 8:23 pm

Obtaining details for disk drives with diskpart under Windows

The command line program diskpart can be used on Microsoft Windows 2000 and later systems to obtain details on the disk drives connected to a system and the partitions and volumes on the disk drives. To use the utility, at the diskpart prompt, which can be obtained by running the program, you select the disk by number and then the partition or volume for which you wish information by typing detail followed by partition or volume, or you can obtain overall information for the drive with detail disk.

[ More Info ]

[/os/windows/commands] permanent link

Fri, Jan 23, 2015 11:07 pm

Generating a list of all the hotfixes and service packs on a Windows system

If you woul like to see a list of all the Quick Fix Engineering (QFE) updates, aka hotfixes, for a Microsoft Windows system from the command line, you can enter the command wmic qfe list. The command will work from systems from Windows XP Professional onwards. You can control the amount of information displayed for each hotfix by including a list format after the word "list", e.g., wmic qfe list brief. You can see the available formats with wmic qfe list /?. The following LIST formats are available:
FormatIncludes
BRIEFDescription, FixComments, HotFixID, Install Date, InstalledBy, InstalledOn, Name, ServicePackInEffect, Status
FULL 
INSTANCE__PATH
STATUS__PATH, Status
SYSTEM__CLASS, __DERIVATION, __DYNASTY, __GENUS, __NAMESPACE, __PATH, __PROPERTY_COUNT, __RELPATH, __SERVER, __SUPERCLASS

You can direct the output to a file by specifying /output:filename before qfe list. E.g.:

C:\Users\User>wmic /output:hotfixes.txt qfe list brief

The output in the above example would be in hotfixes.txt. If you wanted the output to go to the clipboard, instead, you could use wmic /output:clipboard qfe list brief.

[/os/windows/commands] permanent link

Thu, Jan 22, 2015 10:35 pm

Changing the title of a command prompt window

If you open a command prompt window on a Microsoft Windows system, the title for the window will be "Command Prompt".

Command Prompt window

If you have several command prompt windows open, you might like to have each uniquely identifiable by a distinct title, so that you can easily select the relevant one. You can use the title command to change the title that appears at the top of a command prompt window. The syntax for the command is as follows:

C:\>title /?
Sets the window title for the command prompt window.

TITLE [string]

  string       Specifies the title for the command prompt window.

E.g., you could change the title to Test with title Test.

Command Prompt window

You don't need to include text in quotes after the title command if the text contains spaces. E.g., you can use title Mary had a little lamb to have the title appear as Mary had a little lamb. If you put quotes on the command line after the title, the quotes would appear in the window title.

If you give unique titles to the command prompt windows, you can also tell how much memory each one is using with the tasklist command by filtering on WINDOWSTITLE. E.g., if I had two command prompt windows open with one named "Mary had a little lamb" and another titled "Jack and Jill":

C:\>tasklist /fi "WINDOWTITLE EQ Mary had a little lamb"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
cmd.exe                      14020 Console                    1      2,696 K

C:\>tasklist /fi "WINDOWTITLE EQ Jack and Jill"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
cmd.exe                      11536 Console                    1      2,188 K

If the title you choose is very long, only part of the text may be displayed in the windows title with three dots substituted for the rest of the text that can't be fit into the available space for the title.

[/os/windows/commands] permanent link

Wed, Jan 21, 2015 11:18 pm

Restoring a prior browsing session in Chrome

To restore a prior browsing session in the Google Chrome browser immediately after reopening Chrome, take the following steps:
  1. Click on the Chrome menu Chrome menu on the browser toolbar.
  2. Select Recent Tabs
  3. Under Recently closed, you will see the number of tabs that were open during the last browsing session as "x Tabs" where x is the number of tabs that were open before Chrome was closed, e.g., "8 Tabs", if that was the number previously open. Click on the "x Tabs" line to reopen all of those tabs.

    Chrome - Recently closed tabs

[/network/web/browser/chrome] permanent link

Tue, Jan 20, 2015 11:15 pm

Configuring Google Chrome to prompt for download directory

If you would like Google Chrome to prompt for the directory into which it will save a file that you are about to download rather than putting it in the downloads directory for the account you are using or some other default directory, take the following steps:
  1. Click on the Chrome menu Chrome menu on the browser toolbar.
  2. Select settings.
  3. Click on Show advanced settings.
  4. Scroll down to the Downloads section. You can put a directory path in the "Download location" field to have a set downloads directory; to be prompted as to where a file should be stored each time you download a file, check the check box for "Ask where to save each file before downloading".
  5. Once you've made the change to the setting you can close the Settings tab in Chrome.

The setting for whether a file is downloaded into a default location or for Chrome to prompt the user for the location is controlled, like other Chrome settings, in the Preferences file for the account, which is stored beneath a user's home directory. On a Mac OS X system, you can view the file from a command prompt using the Terminal application by going to the directory shown below:

$ cd ~
$ cd "Library/Application Support/Google/Chrome/Default"
$ more Preferences

On a Microsoft Windows system you can find the Preferences file at %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Preferences. The environment variable %USERPROFILE% is usually C:\Users\username where username is the account name. So you can open the file in Notepad from a command prompt with:

C:\> notepad "%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Preferences"

You can edit the Preferences file with a text editor and add "prompt_for_download": true to the download section of the file to have Chrome prompt for the location in which to place a downloaded file. E.g., the default configuration for the download section when the downloads directory for an account is used is shown below followed by the configuration when Chrome will prompt for the location:

Use default downloads directory

   "download": {
      "directory_upgrade": true,
      "extensions_to_open": ""
   },

Prompt for download location

   "download": {
      "directory_upgrade": true,
      "extensions_to_open": "",
      "prompt_for_download": true
   },

Note: the "extensions_to_open": "" line may or may not be present for default Chrome settings; I saw it on a Mac OS X system, but it wasn't present on a Microsoft Windows system. But you only need add the line to set the "prompt_for_download" to true.

References:

  1. Configuring Other Preferences
    The Chromium Projects

[/network/web/browser/chrome] permanent link

Mon, Jan 19, 2015 7:21 pm

How to have quotes inside a title for a hyperlink in Google Sheets

Google Sheets provide a free online spreadsheet program. If you want to insert a URL into a cell in a Google sheet, the syntax is =HYPERLINK(URL,cell_text). The cell_text is the text displayed for the URL. It is an optional argument; if it isn't provided, the URL will be displayed. The URL and cell_text need to be enclosed in double quotes.

So, how do you specify cell text when that text includes quotation marks. E.g., for a title of Fixing "To" Addresses in a Queued Message, using =hyperlink(http://support.moonpoint.com/blog/blosxom/2005/04/06#fixing-to-address","Fixing "To" Addresses in a Queued Message") won't work, since the first double quote character appearing after the beginning one before Fixing signals the end of the cell_text. Often a backslash character, \ can serve as an escape character indicating that the character that follows isn't to be treated the way it would normally be treated by software, i.e., any special significance for the following character is to be ignored. But in this case that didn't work. I still saw #ERROR! in the cell and a little red triangle in the cell that when clicked on displayed Error: Parse. Nor would using the &ldquote; and &rdquote; that can be used in HTML coding to signify left and right double quotes. That just resulted in that text being displayed with the rest of the cell text. What I found did work was to use the double quote character itself as an escape character, so that if two double quotes are placed one after the other in cell_text, a double quote will appear within the cell_text. E.g., in the above case, =hyperlink("http://support.moonpoint.com/blog/blosxom/2005/04/06#fixing-to-address","Fixing ""To"" Addresses in a Queued Message") worked to display Fixing "To" Addresses in a Queued Message for the cell text. You don't need to escape any single quotes within the cell_text, only the double quotes. You can also escape double quote characters within a URL the same way.

[/network/web/services/google] permanent link

Mon, Jan 19, 2015 5:16 pm

Unidentified Task Manager startup list entry

If a file that would be automatically run at system boot or login time doesn't actually exist, Microsoft Windows may show an entry named "Program", with no publisher listed, in the list you see when you click on the Startup tab in the Windows Task Manager. If you right-click on the entry, you will see the "Open file location" option grayed out. You can use the Microsoft autoruns utility to track down the registry entry that is resulting in the "Program" entry appearing in the startup list for the Task Manager. When you locate it, you can uncheck it in autoruns to stop the entry from appearing in the Task Manager.

[ More Info ]

[/os/windows] permanent link

Sat, Jan 17, 2015 11:39 pm

Proxy server configured to d2e24t2jgcnor2.webhostoid.com

I've used Vuze as a BitTorrent client on a number of systems previously without problems. However, when I installed it on a new system for my wife recently, I found that the bundled software that came with it, which I thought I had indicated I didn't want installed with Vuze, set itself up as a proxy server for HTTP and HTTPS traffic and installed a self-signed security certificate into the root certificates list on the system, effectively nullifying the protection offered by viewing sites with HTTPS rather than HTTP and potentially exposing any userids and passwords, credit card numbers, etc. to the view of the bundled GeniusBox software.

I first noticed that a serious security issue had occurred when I mistyped a site's URL and saw a webpage displayed referencing d2e24t2jgcnor2.webhostoid.com, instead of the expected site.

[ More Info ]

[/network/proxy] permanent link

Sat, Jan 17, 2015 11:04 pm

dos2unix for CentOS 7

Microsoft Windows, Apple OS X and Linux systems use different means of representing the end of a line in text files. E.g., see OS X Line Endings. Microsoft Windows and its predecessor operating system, DOS, use a carriage return (CR), which is a hexadecimal 0D, followed by a line feed (LF), which is a hexadecimal 0A, at the end of each line, whereas only the LF character, i.e., the character represented by a hexadecimal 0A is used on Linux systems.

If you upload a text file, such as a .txt or .html file, from a Windows system to a Linux system and then edit it with vi, you may see ^M appear at various places in the file. To convert a text file from the DOS/Windows format to the one used by Linux, you can use the dos2unix utility.

You can install the dos2unix utility on a CentOS 7 system with the command yum install dos2unix. The program will be installed in /bin.

# which dos2unix
/bin/dos2unix
# rpm -qi dos2unix
Name        : dos2unix
Version     : 6.0.3
Release     : 4.el7
Architecture: x86_64
Install Date: Sat 17 Jan 2015 10:42:01 PM EST
Group       : Applications/Text
Size        : 178697
License     : BSD
Signature   : RSA/SHA256, Thu 03 Jul 2014 09:09:30 PM EDT, Key ID 24c6a8a7f4a80eb5
Source RPM  : dos2unix-6.0.3-4.el7.src.rpm
Build Date  : Mon 09 Jun 2014 06:00:48 PM EDT
Build Host  : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://waterlan.home.xs4all.nl/dos2unix.html
Summary     : Text file format converters
Description :
Convert text files with DOS or Mac line endings to Unix line endings and
vice versa.

The syntax for the command is shown below:

$ dos2unix -h
dos2unix 6.0.3 (2013-01-25)
Usage: dos2unix [options] [file ...] [-n infile outfile ...]
 -ascii                convert only line breaks (default)
 -iso                  conversion between DOS and ISO-8859-1 character set
   -1252               Use Windows code page 1252 (Western European)
   -437                Use DOS code page 437 (US) (default)
   -850                Use DOS code page 850 (Western European)
   -860                Use DOS code page 860 (Portuguese)
   -863                Use DOS code page 863 (French Canadian)
   -865                Use DOS code page 865 (Nordic)
 -7                    Convert 8 bit characters to 7 bit space
 -c, --convmode        conversion mode
   convmode            ascii, 7bit, iso, mac, default to ascii
 -f, --force           force conversion of binary files
 -h, --help            give this help
 -k, --keepdate        keep output file date
 -L, --license         display software license
 -l, --newline         add additional newline
 -m, --add-bom         add UTF-8 Byte Order Mark
 -n, --newfile         write to new file
   infile              original file in new file mode
   outfile             output file in new file mode
 -o, --oldfile         write to old file
   file ...            files to convert in old file mode
 -q, --quiet           quiet mode, suppress all warnings
                       always on in stdio mode
 -s, --safe            skip binary files (default)
 -F, --follow-symlink  follow symbolic links and convert the targets
 -R, --replace-symlink replace symbolic links with converted files
                       (original target files remain unchanged)
 -S, --skip-symlink    keep symbolic links and targets unchanged (default)
 -V, --version         display version number

To convert the format of a file using the same file for both input and output, you only need specify the file name as an argument to dos2unix. E.g.:

$ dos2unix index.php
dos2unix: converting file index.php to Unix format ...

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

Fri, Jan 16, 2015 11:15 pm

Viewing a stored WEP or WPA key

A laptop may be used to connect to many wireless networks with a unique Wi-Fi Protected Access (WPA), Wi-Fi Protected Access II (WPA2), or Wired Equivalent Privacy (WEP) key, which can be regarded as a Wifi password, for each of those networks stored within a wireless profile on the laptop. If you need to configure another device, e.g., a phone, tablet or another laptop, to use the same key and want to view what has been stored on the laptop from a command prompt, under Windows 8 you can use the command netsh wlan show profiles to view all of the stored Wi-Fi profiles.
C:\>netsh wlan show profiles

Profiles on interface Wi-Fi:

Group policy profiles (read only)
---------------------------------
    <None>

User profiles
-------------
    All User Profile     : belkin54g
    All User Profile     : Imp
    All User Profile     : Harbor
    All User Profile     : Guest
    All User Profile     : library
    All User Profile     : T28J7
    All User Profile     : NETGEAR
    All User Profile     : linksys

You can then retrieve the key used for a particular profile by specifying it with name=profile, where profile is one of the stored profiles, followed by key=clear.

C:\>netsh wlan show profiles name=T28J7 key=clear

Profile T28J7 on interface Wi-Fi:
=======================================================================

Applied: All User Profile

Profile information
-------------------
    Version                : 1
    Type                   : Wireless LAN
    Name                   : T28J7
    Control options        :
        Connection mode    : Connect manually
        Network broadcast  : Connect only if this network is broadcasting
        AutoSwitch         : Do not switch to other networks

Connectivity settings
---------------------
    Number of SSIDs        : 1
    SSID name              : "T28J7"
    Network type           : Infrastructure
    Radio type             : [ Any Radio Type ]
    Vendor extension          : Not present

Security settings
-----------------
    Authentication         : Open
    Cipher                 : WEP
    Security key           : Present
    Key Content            : 719DDAB7A9
    Key Index              : 1

Cost settings
-------------
    Cost                   : Unrestricted
    Congested              : No
    Approaching Data Limit : No
    Over Data Limit        : No
    Roaming                : No
    Cost Source            : Default


C:\>netsh wlan show profiles name=Harbor key=clear

Profile Harbor on interface Wi-Fi:
=======================================================================

Applied: All User Profile

Profile information
-------------------
    Version                : 1
    Type                   : Wireless LAN
    Name                   : Harbor
    Control options        :
        Connection mode    : Connect automatically
        Network broadcast  : Connect only if this network is broadcasting
        AutoSwitch         : Do not switch to other networks

Connectivity settings
---------------------
    Number of SSIDs        : 1
    SSID name              : "Harbor"
    Network type           : Infrastructure
    Radio type             : [ Any Radio Type ]
    Vendor extension          : Not present

Security settings
-----------------
    Authentication         : WPA2-Personal
    Cipher                 : CCMP
    Security key           : Present
    Key Content            : ccc777cc

Cost settings
-------------
    Cost                   : Unrestricted
    Congested              : No
    Approaching Data Limit : No
    Over Data Limit        : No
    Roaming                : No
    Cost Source            : Default

In the above two examples, the WEP key for the wireless network with an SSID of "T28J7" is "719DDAB7A9" and the WPA2-Personal key for the wireless network named "Harbor" is "ccc777cc"

[/os/windows/win8] permanent link

Thu, Jan 15, 2015 10:06 pm

HTTPNetworkSniffer v1.45

Nir Sofer provides many free network and system tools for Windows systems from his website, NirSoft. One of those tools, HTTPNetworkSniffer, provides the capability to "sniff", i.e, capture and examine, the HTTP network traffic between the system on which the tool is installed and the web servers contacted from that system. All, or portions, of the data captured can be saved to a file in a variety of formats for later examination. Those formats include the following ones:
  1. Text (*.txt)
  2. Tab Delimited Text File (*.txt)
  3. Tabular Text File (*.txt)
  4. Comma Delimited Text File (*.csv)
  5. HTML File - Horizonal (*.htm; *.html)
  6. HTML File - Vertical (*.htm; *.html)
  7. XML File - (*.xml)

[ More Info ]

[/reviews/software/windows/network/web] permanent link

Mon, Jan 12, 2015 11:52 pm

Checking the digital signature for a file under Microsoft Windows

A program can be digitally signed to verify the developer or publisher of the program. Digital signatures provide a means to authenticate that software actually came from the claimed author and has not been modified since the author published the software. However, they don't guarantee that the software is safe to use, since even adware/spyware may be signed digitally.

On a Microsoft Windows system, information on the digital signature can be viewed with the PowerShell cmdlet Get-AuthenticodeSignature, which is included with Microsoft Windows 7 and later; PowerShell is also available from Microsoft for earlier versions of their operating system. The Sysinternals tool, Sigcheck from Microsoft may also be used to check the digital signature on a file.

[ More Info ]

[/os/windows] permanent link

Sun, Jan 11, 2015 5:55 pm

Checking the proxy server settings with Google Chrome on a Windows system

In Google Chrome on a Microsoft Windows system you can check or change the proxy server setttings by the following steps within the Chrome browser. Note: changing the proxy server settings by this means changes the system-wide proxy server settings, so the configuration changes you make will also apply to Internet Explorer.
  1. Click on the "Customize and Control Google Chrome" button at the top, right-hand side of the Google Chrome window. It is represented as a button with 3 short horizontal lines on it.
  2. Select Settings
  3. Click on the "Show advanced settings" link near the bottom of the window.
  4. Scroll down to the Network Settings section and click on the Change proxy settings button.
  5. That will open an Internet Properties window where you can click on the LAN settings button, which will open a Local Area Network (LAN) Settings window.
  6. Check the checkbox next to "Use a proxy server for your LAN (These settings will not apply to dial-up or VPN connections)."
  7. Click on the Advanced button, which will open a Proxy Settings window.
  8. Put in the IP address and port number for the proxy server in the "Proxy address to use" and "Port" fields. You will see four types of proxies listed: HTTP, Secure, FTP, and Socks. The line where you will place the IP address and port number will depend on which of those you are using.
  9. Click on OK and then OK again at the Local Area Network (LAN) Settings window, and again at the Internet Properties window.

Note: tested on Google Chrome 39.0 on a Microsoft Windows system.

[/network/proxy] permanent link

Sun, Jan 11, 2015 5:13 pm

Finding files modified on or after a date on a Linux system

If you wish to find all of the files modified on or after a particular date on a Unix/Linux system, you can use the find command with the newermt argument. E.g., suppose I want to find all files with a .php extension modified on or after January 10, 2015 in the current directory and any subdirectories. I could use the command below:

find . -name "*.php" -newermt 2015-01-10

The -newermt argument, which is a form of -newerXY is explained below:

-newerXY reference
       Compares  the timestamp of the current file with reference.  The
       reference argument is normally the name of a file  (and  one  of
       its  timestamps is used for the comparison) but it may also be a
       string describing an absolute time.  X and  Y  are  placeholders
       for other letters, and these letters select which time belonging
       to how reference is used for the comparison.

       a   The access time of the file reference
       B   The birth time of the file reference
       c   The inode status change time of reference
       m   The modification time of the file reference
       t   reference is interpreted directly as a time

       Some combinations are invalid; for example, it is invalid for  X
       to  be t.  Some combinations are not implemented on all systems;
       for example B is not supported on all systems.  If an invalid or
       unsupported  combination  of  XY  is  specified,  a  fatal error
       results.  Time specifications are interpreted as for  the  argu‐
       ment  to the -d option of GNU date.  If you try to use the birth
       time of a reference file, and the birth time  cannot  be  deter‐
       mined,  a  fatal  error  message results.  If you specify a test
       which refers to the birth time of  files  being  examined,  this
       test will fail for any files where the birth time is unknown.

References:

  1. Linux / Unix: Find Files Modified On Specific Date
    By: nixCraft
    Date: February 27, 2013
    nixCraft - Insight into Linux Admin Work
  2. Ubuntu Linux: find files between specific times?
    Posted: April 9, 2013
    Super User

[/os/unix/commands] permanent link

Sun, Jan 11, 2015 4:33 pm

Using a Juniper Networks NetScreen Firewall as a DHCP Server

A Juniper Networks NetScreen firewall running the ScreenOS operating system can also serve as a DHCP server. The firewall can be configured through a GUI by accessing the firewall from a browser, but also has a command line interface, which is accessible via a SSH connection. The DHCP configuration provided by the server upon DHCP client requests can be configured via the command line interface where you can set the DNS servers, gateway address, netmask, etc. or enable and disable the DHCP server functionality in the firewall.

[ More Info ]

[/security/firewalls/netscreen] permanent link

Sat, Jan 10, 2015 10:24 pm

Viewing the Trusted Root certificates on a Windows system

Windows maintains a list of trusted root certificates, which are used when you are visiting websites that use the HTTPS protocol for security. A website using HTTPS will have a security certificate that has usually been signed by some more trusted entity. A site can use a self-signed certificate, but when you first visit such a site your browser will warn you that its certificate can't be verified, though your connectivity will still be encrypted if you visit the site. You then usually have the opportunity to accept that certificate either temporarily or permanently or can choose not to visit the site.

For signed certificates, the trustworthiness of the signer is vital. There may be a certificate chain with the certificate of the site you are viewing having a certificate signed by some entity that in turn had its own certificate signed by an even more trustworthy authority. Eventually, the chain ends at a trusted root certificate. To be safe when visiting sites and providing credentials, such as userids and passwords, you need to have a trusted chain of certificates. It is vital that the root certificates you have on your system belong to very trustworthy authorities. Microsoft distributes a list of trusted root certificates with its operating system and browsers, such as Firefox, may have their ownl list, but some malware, such as Genius Box, will install its own certificate in the Windows trusted root certificates list making a system susceptible to a man-in-the-middle attack as the GeniusBox software also sets itself up as an HTTP and HTTPS proxy on a system it infects.

To view the list of trusted root certificates on a Microsoft Windows system, see Viewing the Trusted Root certificates on a Windows system.

[/os/windows/certificates] permanent link

Fri, Jan 09, 2015 11:03 pm

Recovering information for the HKCU branch of the registry from a backup

Microsoft Windows stores information contained in the HKEY_CURRENT_USER branch of the registry, which is often abbreviated as HKCU, in the file NTUSER.DAT. That file is stored in the user's profile directory, which is usually C:\Windows\Username, where Username is the account name. The location can be checked by issuing the command echo %USERPROFILE% from a command prompt while logged into the account.

The file is a hidden and system file, so you would need to turn on the display of hidden and system files in the Windows Explorer to see it, but even then, if you are logged into the account for which you are trying to access NTUSER.DAT it will be locked from access. You can view the contents of the file for another account or the contents of a backup copy of NTUSER.DAT using the RegFileExport utility from NirSoft as explained in Recovering information for the HKCU branch of the registry from a backup.

[/os/windows/registry] permanent link

Thu, Jan 08, 2015 11:24 pm

Windows 7 wallpaper location

The location for the various wallpapers that come with Windows 7 is %SYSTEMROOT%\Web\Wallpaper%. The Windows environment variable %SYSTEMROOT% usually points to C:\Windows, but you can check its value on a particular system from a command prompt with echo %SYSTEMROOT%.
C:\Users\Pamela>dir %SYSTEMROOT%\Web\Wallpaper
 Volume in drive C is OS
 Volume Serial Number is 4445-F6ED

 Directory of C:\Windows\Web\Wallpaper

11/04/2011  01:00 AM    <DIR>          .
11/04/2011  01:00 AM    <DIR>          ..
11/21/2010  02:16 AM    <DIR>          Architecture
11/21/2010  02:16 AM    <DIR>          Characters
11/04/2011  01:00 AM    <DIR>          Dell
11/21/2010  02:16 AM    <DIR>          Landscapes
11/21/2010  02:16 AM    <DIR>          Nature
11/21/2010  02:16 AM    <DIR>          Scenes
11/21/2010  02:16 AM    <DIR>          Windows
               0 File(s)              0 bytes
               9 Dir(s)  863,115,665,408 bytes free

C:\Users\Pamela>echo %SYSTEMROOT%
C:\Windows

The location of the current wallpaper for the currently logged on user can be found by a reg query command.

C:\Users\Pamela>reg query "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallPaper


HKEY_CURRENT_USER\Control Panel\Desktop
    WallPaper    REG_SZ    C:\Users\Pamela\AppData\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper.jpg

If you pick an image you want to use for wallpaper, it will be copied to the location in the above registry key and renamed TranscodedWallpaper.jpg, which allows you to modify the original image without changing the wallpaper, but may seem confusing if you are expecting the file name to be the same as it was for the original image you selected for the wallpaper.

[/os/windows/win7] permanent link

Wed, Jan 07, 2015 11:32 pm

Checking Microsoft Windows proxy server settings

Web browsers can be configured to use a proxy server for network connections, i.e., instead of directly connecting to websites, the connections are routed to a proxy server, which then establishes a connection to the website and routes the return traffic from the site back to the browser. This may be done for security reasons, e.g., the proxy server may be running antivirus software that checks all downloads from websites before passing files on to users' systems or the proxy server may be used to block access to websites deemed malicious, i.e., ones distributing malware, or ones that are deemed inappropriate for the workplace or by children, if the proxy server is located in a home rather than a business environment. A proxy server may also be used to hide the actual IP address of the system on which the browser is running for privacy reasons.

The proxy server settings for the system can be configured within Internet Explorer on a Microsoft Windows system. They can also be queried and set from a command line interface using the reg query or reg add commands.

[ More Info ]

[/network/proxy] permanent link

Tue, Jan 06, 2015 10:13 pm

Configuring Juniper NetScreen firewall rule from command line

I needed to configure an old Juniper Networks 5XP firewall from a command line interface, so that I could block all access to the Internet from that system, but, since it had been a very long time since I set a rule in one of those firewalls from its command line interface, which is accessible via SSH, it took me some time to get the syntax right for the command after realizing I had to associate the IP address with a name that I could use in the policy for the system first.

[ More Info ]

[/security/firewalls/netscreen] permanent link

Mon, Jan 05, 2015 11:53 pm

Restore a computer from a Windows Server 2012 Essentials backup

In a Microsoft Windows domain where the domain controller is a Windows Server 2012 Essentials server, backups are normally done on a daily basis to the server. From the Dashboard, which is accessible from the Launchpad, on a client computer you can restore files and folders from backups on the server by these steps. You will have the option of selecting which of the daily backups you wish to use to restore the client computer.

The Launchpad on the client computer also provides the capability to initiate a backup from the client to the server and to check on the status of the last backup of the client to the server.

[/os/windows/server2012] permanent link

Sun, Jan 04, 2015 5:53 pm

Evernote "Related to what you're working on" popup

While editing a note in the Evernote application on a Microsoft Windows system today I was plagued by an annoying popup appearing every few seconds with a title "Related to what you're working on". It appeared the "content" being suggested to me was an add, since I saw "For $200, a Windows Laptop That's Wor...", but when I clicked on the link, I found it pointed to a Wall Street Journal article HP Stream 11 Review: A $200 Windows Laptop That’s Worth the Price.

Evernote Related context

Though some of the "Related to what you're working on" notices I've seen have been relevant, this one was not and I don't want the distraction of such notices when trying to use the software for note keeping. If I dismiss such a notice, I don't want to see it constantly reappearing every few seconds until I'm forced to click on it to stop it from reappearing.

If you click on Tools from the Evernote window and select Options, then Context, you can manage those notices.

Evernote Context Options

In this case rather than just unchecking "Show Context", I clicked on Manage Context Sources, which opened a web page in a browser on the system. From that page I could select which sources would be used; I unchecked the one for The Wall Street Journal, since this is the first time I've encountered the annoyance of a notice appearing repeatedly every few seconds in Evernote and have not experienced it from any other source.

Evernote Context Sources

[/software/archiving/Evernote] permanent link

Sun, Jan 04, 2015 2:14 pm

SMF Connection Problems

When I tried to access a Simple Machines Forum (SMF) website after rebooting the server on which it resides, I saw the message below:

Connection Problems

Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

When I tried to check access to the database it uses with the mysql command, I saw the following error message:

# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

The system uses MariaDB, a fork of the MySQL relational database management system (RDBMS) for databases. Checking prior notes on the error message, I found it can indicate that the mariahdb database service didn't start when the system rebooted. From the root account I issued the command systemctl start mariadb.service . When I tried accessing the forum again, it was then accessible.

[/network/web/forums/smf] permanent link

Sat, Jan 03, 2015 8:08 pm

Google Drive files not syncing - not connected

If Google Drive files are not synchronizing between systems or files are not appearing when you view the conents of your Google Drive storage area from a browser by going to drive.google.com, it is possible the system that should be synchronizing the files has lost its connection to Google Drive. Clicking on the Google Drive icon in the system tray should reveal if that is the case. It can be easy to remedy the connection problem, but you may have to wait a fair amount of time before all files are synchronized after you reestablish the connection.

[ More Info ]

[/network/web/services/google/drive] permanent link

Fri, Jan 02, 2015 9:54 pm

Creating a button with CSS

Images may be used to provide clickable buttons on a webpage, but one can also create buttons entirely with text using Cascading Style Sheets (CSS). Rectangular buttons can be created or the buttons can be given rounded corners using a border-radius value.

E.g., the following could be used to create a green button with rounded corners with the word "Download" in it in white text:

<style type="text/css">
.downloadbutton {
  width: 67px;
  height: 20px;
  background-color: #31B404;
  border-radius: 15px;
  border: 3px solid #009900;
  padding: 5px;
}
.downloadbutton A:link {color: white; text-decoration:none}
</style>

[ More Info ]

[/network/web/html/css] permanent link

Fri, Jan 02, 2015 3:05 pm

Link Colors

The color used for the anchor text for a link on a web page can be controlled through Cascading Style Sheets (CSS) inserted into the head section of a web page. You can change the color used for a link before it is visited, after it is visited, when someone hovers a mouse over the link, and when someone clicks on the link, but hasn't yet visited the web page.

[ More Info ]

[/network/web/html/css] permanent link

Thu, Jan 01, 2015 9:47 pm

MediaMonkey Codec Pack 2.1.2.105 Installation

MediaMonkey provides the capability to manage a movie/music library, even ones containing over 100,000 files whether they are on a hard drive, CD, DVD, or on other devices on your network. You can organize, browse or search music by genre, artist, year, rating, etc. It supports a variety of audio/video formats such as MP3, AAC (M4A), OGG, WMA, FLAC, MPC, WAV, CDA, AVI, MP4, OGV, MPEG, WMV, M3U, PLS, etc. For codecs your system doesn't already support, you can install a codec pack for it to support additional formats. If you don't have support for the codecs already on the system, it will provide support for the following codecs:

[ More Info ]

[/os/windows/software/audio-video/MM] permanent link

Once You Know, You Newegg AliExpress by Alibaba.com

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo