TELNET to test connection to POP3/IMAP

First, make sure TELNET is installed on your machine else you’ll get error. You can install TELNET through Add or Remove feature on Windows.
You can use TELNET via a command prompt to confirm.

For IMAP check port 143 and if using SSL then check port 993.

For POP3 check port 110 and if using SSL then check port 995.

Test POP3 connection:

  • Start a command prompt
  • Enter TELNET {webserver} port e.g. TELNET exchangesrvr01 995
  • Enter USER {login} e.g. USER testemail@mycomp.com
  • Enter PASS {password} e.g. PASS secret
  • Enter LIST to show the mailbox
  • Enter QUIT to Exit

At each stage you should receive an OK message. If there is an issue at any stage you will receive an error

Test IMAP connection:

  • Start a command prompt
  • Enter TELNET {webserver} port e.g. TELNET exchangesrvr01 143
  • Enter . LOGIN {login} {password} e.g. LOGIN testemail@mycomp.com secret
  • Enter . LIST “” “*” to show the mailbox
  • Press CTRL + ] and then QUIT to Exit

At each stage you should receive an OK message. If there is an issue at any stage you will receive an error.

Register and unregister COM component using regsvr32 command

You’ll need to open Command Prompt in Admin mode to make the changes especially when User Account Control (UAC) is enabled on your Windows 10 machine. CD to system32 for 64-bit registration and SysWoW64 for 32-bit registration.
Place the COM component in the folder from you want to register and also your executable is placed e.g. “C:\TFS\Code\bin\” in the example below.

To register use the below command:

regsvr32 "C:\TFS\Code\bin\MailObj.dll"

To unregister use the below command:

regsvr32 /u "C:\TFS\Code\bin\MailObj.dll"

You should get a prompt that the register/unregister command succeeded.
This command can be used to register/unregister DLL or OCX files.

Setup Github and work with local and remote repositories

In this post, we’ll touch upon the basics of Github so as to get started with connecting to a repository remotely on GitHub and managing it locally. GitHub provides web hosting service to version control your source code using Git and make it available from anywhere.

GitHub is now also integrated with some cloud service providers like Microsoft Azure to directly publish your source code to Cloud services like App Service plans. You can also manage your CI/CD pipelines using Azure DevOps by directly using authorising using your GitHub account.

Create your SSH keys

After creating an account on Github, firstly you need to generate an SSH key on your machine say Mac, and add the private key to the SSH-agent running in the background. The public key requires to be added to your Github account under Settings and SSH and GPG keys.

Follow the below steps to setup your machine to work with Github remotely:

  1. Check for existing SSH keys here.
  2. Generate a new key and private key to SSH-agent here.
  3. Add public key to Github account here.

Once the above steps are completed, let’s get started with understanding the basic commands to kick-start with our first repository to version control our files remotely to GitHub.

Create your first repo
Note:

One very important thing to remember is to use Git Ignore for your configuration files or any files that contain passwords so that they don’t get checked-in to Github and become susceptible to security vulnerabilities.

Git uses it to determine which files and directories to ignore, before you make a commit. A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository. Here is the help link.

Once the repository is created, let’s get started with the cloning of repository locally.  We can either do that through an https or SSH and we’re going to do this through SSH since we’ve already set up a key and it makes it a little bit more secure for us.

Please note: Change the commands accordingly for your Github account.

Copy the above SSH string and write the below command on your Mac or Windows terminal. Navigate to Desktop on your machine and then type:

cd Desktop/
git clone git@github.com:pulkitgulati/test-repo.git

Provide the pass-phrase for your SSH key and you should see a test-repo empty repository created on your Desktop. Now, cd to the repository and create a few files:

cd test-repo/
touch index.html main.js

You can check the created files in the folder or use ls command to verify. Check the git status to check the current status of the untracked files:

git status

Now let’s add and commit the files to the GitHub repository:

git add -A
git commit -m "adding files"

Now, verify the status with git status again. The thumb rule of committing any changes to the repository is to pull the latest files first and then making changes. Then repeat the process of adding them back. This helps when you’re working with a team of developers. Let’s create the master branch we’re currently working on and provide your pass-phrase. You would now see your files in the repository:

git push origin master

Now, let’s create a readme file using the Add Readme button and pull the latest repo files in our local repository.

Now, commit the file and use the below command to get the latest files locally from the master branch:

git pull origin master

Good old dir and copy commands

This is a true troubleshooting story!

Today, one of the users of my application wanted to know if we can find out the original title of a ticket created in the Application. Although, we do not store any such logs for modifications, while on the verge of giving up, I remembered we archive the e-mails received by the Windows Service application that processes the e-mails and archives them at a location on the Server on which it is installed. The e-mail Subject line is stored as the ticket title. These tickets which are created by the Windows Service can be viewed in the Web Application.

Since the folder with the archiving e-mails have a lot of ’em, simply doing a Windows Search is a time killer! So I remembered my way through the good old DOS commands.

Since the .eml file has the ticket number, I used the dir command to search for the e-mail name and copy command to copy it to another location quickly.

Firstly cd to the location where the archived e-mails are stored on the Server:

So e.g. if the ticket number is 123456

dir *123456* /s

The /s searches for the File name inside the two wildcard characters asterisk “*” with the dir command.

Then if the file name is e.g. TICKET123456 – abc.eml then use copy command as follows within the same directory:

copy "TICKET123456 - abc.eml" c:\Temp

So, with the e-mail having the original Subject Line preserved, I could share the original ticket title.