Posts Tagged ‘Windows’

Testing, troubleshooting POP3 connectivity & authentication

August 3, 2010

Method 1: Python

$python
>>> from poplib import *
>>> mail = POP3("hostname-or-IP")
>>> mail.user("user-name")
>>> mail.pass_("password")

Method 2: Netcat

Linux users already have netcat aka nc. For Windows users I recommend snetcat, which supplies a pre-compiled Windows binary.

$nc <hostname-or-IP> pop3
USER <user-name>
PASS <password>

To retrieve messages

RETR 1

Related Posts

Simple Python-based IMAP4 command-line scripting tool

Searching & replacing non-printable characters in text files (i.e. null characters)

June 20, 2010

How-to display a summary of non-printable characters in a text file

The non_printables Python module will display each unique ASCII decimal value, the number of times it occurred in the file, the character that was found, and the ASCII octal value of the character. The module was written for comfort and not for speed, so it can take a minute or two to process large text files, but I think it is definitely worth the wait…

cat sample.txt|./non_printables.py
  ------------------------------------
 | ASCII  | # Times  | Char  | Octal  |
  ------------------------------------
 | 0      | 9773449  |       | 000    |
  ------------------------------------
 | 164    | 1        | ñ     | 244    |
  ------------------------------------
 | 189    | 10       | ╜     | 275    |
  ------------------------------------
 | 170    | 2        | ¬     | 252    |
  ------------------------------------
 | 221    | 2        | ▌     | 335    |
  ------------------------------------
 | 159    | 255      | ƒ     | 237    |
  ------------------------------------

Replacement of non-printables

The Unix ‘tr’ command replaces characters in large text files with blazing speed.  By the way, just because it is a Unix command doesn’t mean you can’t use the ‘tr’ command  in Windows, see my UnxUtils post for further information.  Here is an example of the ‘tr’ command syntax…

cat sample.txt|tr '\244' '\040'|tr '\000' '\040' > result.txt

(more…)

High-quality, fast, light-weight Windows & Unix text editors

June 14, 2010

When someone recommends text editors I usually yawn — everyone’s got their own flavor, and I’ve already picked mine out. So why am I posting about text editors? Because there is a text editor that’s so well written, and that I have enjoyed using so much that I wanted to share it as a thank you to the author Florian Balmer.

Notepad2 is a lightweight drop-in replacement for Window’s Notepad, if you haven’t tried it please give it a whirl; seriously this is a quality program. Normally the terms feature-packed and lightweight are oxymorons, but not with Notepad2. It’s incredibly intuitive; the menu items and keyboard short-cuts are exactly where your brain tells you they should be.  Packed to hilt with features, but not overwhelming, it just feels like you’re using Notepad on steroids. Enough talk, just try it… Notepad2

Notes: I prefer the Notepad2 version with code-folding, it comes in both 32-bit & 64-bit versions.  I typically toggle code-folding off and just turn it on whenever needed.

And while on the topic of text editors… how about Unix text editors?

Obviously I think Notepad2 shines in the Windows world, however, in the Unix realm I don’t try to push any one editor, use whatever works for you. For example I’m an emacs guy, but if someone is coming from the Windows world and getting their feet wet in Linux, I’d prefer they spend their time learning the OS instead of wrestling with emacs or vi; forcing them to learn alien key-strokes at the same time seems like a form of sadism.  In these cases a Windows-style editor such as pico would be a better choice.  However, in the long-term, it is good to eventually take the time to learn emacs or vi as they are the de-facto Unix editors, and they become amazingly easy to use with practice. You’ll also find a subset of emacs editing key combinations supported in other places, i.e. Cisco IOS, Python Cmd module, etc. For emacs I personally prefer jed over full-blown emacs, jed is not so bloated; very fast, lightweight and portable.   But that’s just my preference, use whatever best fits your style.

And here’s to wishing you a happy editing experience :-)

Fast, light-weight Unix utilities for Windows

May 22, 2010

Here are some ports of common GNU utilities to native Windows;  the package is really fast, lightweight and unobtrusive.  UnxUtils is available at Sourceforge, but I prefer the package at http://bit.ly/aduz5O because it automatically takes care of setting up the environment variables - just launch the wizard, select the defaults and off you go . The site I linked to claims that it is not maintainined anymore, don’t worry the tools are stable,  I’ve used these same UnxUtils  on countless workstations for over 6 years.  I have to warn you though, if you’re anything like me, once you get used to these tools you’ll be spoiled and you’ll feel totally crippled in Windows without them.  Fortunately they are small in size,  so you can easily keep a copy of them on your thumb drive.

(more…)

Opsview Agent Installation for Windows Server & Server Core

May 7, 2010

(more…)

How-To make a Certificate Request in Windows 2008 R2 Server Core

May 6, 2010

Credit for the following answer goes to my sys/network admin John Kauffman and to Experts-Exchange guru Paranormastic:

certreq -new c:\temp\request.inf c:\temp\certrequest.txt
certutil -f -addstore My c:\temp\certname.cer

If you have problems, you may need to reassociate the private key. Try this:
certutil -dump certname.cer | more
(search for “Serial Number” and substitute below)

certutil -repairstore My %SerialNumber%
certutil -store My %SerialNumber%

Reference: How to make a Certificate Request on a Windows Server Core VM 
(link requires an Experts-Exchange account)

Related Links

Installing & Binding 3rd party SSL certificates on Windows 2008 Server Core

How-To Set Default Printers by Computer OU when Deploying Printers via Windows 2008 Group Policies

May 6, 2010

If you’re in an organization running Microsoft Window 2008 servers, there’s a good chance you are deploying printers via group policies.  It’s awesome, life is great expect for one thing – those pesky default printers.  Only if you could set all the default printers based on computer OU’s… fortunately there’s a solution,  check out this great article:
Setting Default Printers with Windows 2008 Server Group Policy Preferences
Setting Default Printers with GPP Using Loopback Processing

Monitoring Memory Usage with Process Explorer

May 5, 2010

Process Explorer provides a lot more information than the built-in Windows Task Manager, and once you start using it you won’t want to go back.  But I have noticed that often times when people first start using it that they have trouble comparing apples-to-apples.  For example how do you get Process Explorer to look like the “Processes” tab?

Hint: Click on “View” in the top menu bar.
Click on “Select Columns
Check “User Name
Click on the “Process Memory” tab.
Check “WS Private Bytes
Click the “OK” button

Does that look more like what your used to?

If you want an enhanced version of the Windows Task Manager “Performance” tab just double-click on any of the graphs at the top.

Process Explorer can be downloaded here http://bit.ly/2QxebL


Follow

Get every new post delivered to your Inbox.