Thursday, July 24, 2014

Installing Python 2.7 / 3.4 on Windows

Start Learning Python!!!


This blog post is for installing Python on Windows. This method doesn't use Eclipse Indigo IDE installation, so you don't have to worry about all the settings, preferences. This installation will hardly take 5-10 minutes and in no time you can start learning Python - a very powerful, easy to learn scripting language which is preferred by both technical & non-technical people who want to learn programming.

So lets start, first we need Python. To install Python, click here. Depending on your Operating System (OS), select either Python 2.7 or Python 3.4.

As on 7/24/2014 - the current versions are Python 2.7.8 and 3.4.1. 

Click on the Windows version (32 / 64 bit).

Screenshot of Python downloads page

Once you have downloaded the version relating to your OS, find the downloaded file. Double click on the executable file.

You may be prompted to proceed with the installation. Click Yes.

Follow the installation instructions. Accept defaults. Keep it Simple! :)

Once you've installed Python, Download notepad++. You can download it here.

Again, locate the file and install the program. We will be using Notepad ++ as an IDE for writing Python Programs.

Finally, we have one more step. Open Windows Powershell

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework.

To open this, Click on the Start button, and start typing Powershell. Click on Windows PowerShell.

Screenshot of Windows PowerShell
Type in Python. You should see as shown below:

Screenshot of python command in Windows PowerShell

If in case, you get an error saying python is not recognized. Copy and paste the following code:

[Environment]::SetEnvironmentVariable("Path","$env:Path;C:\Python27", "User")

Note: If you have Python 3.4 installed then the path will be Python34 instead of Python27.

After this is done, type python again. It should recognize, if not close PowerSehll and Open it again and type Python. (In some cases, restart might be required)

After this press CTRL + z

You may want to create some directory using the mkdir command. For example "mkdir python_programs" and then hit ENTER.

Change to python_programs directory by "cd python_programs"

Open notepad and new file.

Type in the following code:

print ("Hello World, This is Python!");
print("I will master python!!!");

Save the file as hello_world.py

Then go to PowerShell and execute the python program by typing:

 "python hello_world.py"

You should be able to see the output in Windows PowerShell.


Output of Hello world program
That's it :) You are officially a Python Programmer.

Hope your python experience turns out great.




Thursday, July 10, 2014

Get a list of installed programs on your computer


Taking a list of software you have may sometimes be a pain!!
 Re-imaging your computer? Or upgrading your OS? Need to know what software you have on your computer before you upgrade, so that it can be installed again? Windows has a way of doing this. 

Note: This method only lists the software on your computer from the registry. It doesn't recover license keys for the software. To know how to do this, please check the External links given at the end of the post.

Steps:

1. Click on "Start" and type "cmd" or "command" and then right click on the command prompt and select "Run as administrator".

Screenshot of "Run as administrator" command prompt.

2. You may be prompted for a password and a prompt for User Account control asking if "you want the program to make changes". Click YES. Once you do this / enter your password, you should be able to see the command prompt window. 

Screenshot of the User Account control pop up.
Below is the command prompt window.

Screenshot of the command prompt

3. Then enter the command "wmic" and press ENTER. This will enter the Windows Management Intrumentation Command line tool and it will enter into the root. To know about WMIC tool click here.

Screenshot of the wmic command.

4. Then include the line shown below:

/output:C:\SoftwareList.txt product get name,version

Note: There is a space after txt and product; between product and get; between get and name. Make sure the spaces are correct.

IMPORTANT: In this case, we have created the file in the root directory (C:) but you can replace it with any directory path and file name ( in this case - SoftwareList.txt). If you have trouble in saving the file in your own directory path, please check "Troubleshooting and pointers" below.

After you type the command press Enter. There is no status about how long this will take but it shouldn't take a long time. When the process completes, you should be able to see the root prompt again.

Screenshot of the "get product" command.
Screenshot after the command completes.

Screenshot showing the text file "SoftwareList" in the C: Directory.
That's it :) Now you've a complete list of software on your computer. That was easy right?

Here's another screenshot of the list of software.

Screenshot of the SoftwareList.txt

Troubleshooting & Pointers:

"Invalid file name or Alias not found"

In most of the cases, the "Invalid file name" is because of administrative rights. If you're not sure if you have administrative rights, contact your IT support for assistance. If you're sure that you have administrative rights, then check if the directory exists. This command requires the directory to exist before command execution. Please note that it doesn't create the directory.

The "alias not found" occurs because of spaces in your directory path or in your file name. If you want a workaround, store the output file in a path that doesn't have spaces.

(ELSE)

Include the directory path along with file name in between quotes as shown below:

/output:"C:\Log Files\Software List.txt" product get name,version

This will resolve the problem.


External Links:


Credit to the post: Help Desk Geek 

Note: Some changes and workarounds have been added to this post by Srikkanth Govindaraajan.






Monday, March 17, 2014

ICE Cyber Crime Center - Virus Removal Guide

Hello All,

This is turning out to be a common virus attack in my workplace, so thought of creating a post to help people solve this error. If your computer is locked whenever you login and you are seeing a “Your computer has been blocked” by Department of Homeland Security’s ICE Cyber Crime Center, then your computer is infected with a piece of Malware known as Trojan Reveton.


At the very sight of it, it will seem to be very authentic by tracking your location and IP address (though it is quite simple) It has so many details that might give you a shock! This Malware is clever and has access to even your webcam (if you have one though)

What is Malware?
As Wikipedia states "Malware, short for Malicious software, is software used or programmed by attackers to disrupt computer operation, gather sensitive information, or gain access to private computer systems

Why my computer?
Computers are vulnerable to Malware and virus. You can get Malware on your computer just by clicking ads, downloading toolbars, etc. In order to protect yourself from Malware, you can download a free version of Malwarebytes.

Malwarebytes
Malwarebytes is an anti-malware software that detects and destroys malware from your computer. The free version is available for download from the following legit links:
Link1

Link2

Once the download finishes, you have to install the program on your computer (Note you might require administrative privileges!). After installation you may enable a free trail of the PRO version of Malwarebytes too.

[Image: Malwarebytes Anti-Malware final installation screen]

Note: After downloading and if you're using it say after 2 or 3 weeks, it may show a notification like this:



And all you need to do is, Click yes and update! Remember Malwarebytes is a free software and you can work with it as long as the database is updated.

So once the main window opens, you have three options: Quick Scan, Full Scan and Memory Scan as shown below:

[Image: Malwarebytes Anti-Malware Quick Scan]

Quick Scan is good enough to detect Malware on your main folders on the drive. It generally takes 7 - 20 minutes to complete scanning (depending on the RAM and hard disk size). If your scanning for the first time, I would recommend a quick scan before doing a full scan.

Full scan scans all the files and folder in all your drives and this may take a minimum of 20 minutes to a maximum of 1 hour (or even more in some computers). The bottom line is YOU HAVE TO BE PATIENT.

Flash scan is a feature that is available for PRO users and is similar to running memory diagnostics.

Once you select either a Quick/Full scan, and select scan, the scanning will start.

Sometime while your scanning, the computer may become slow and you should expect a performance degradation and it might also go to the "Not Responding" mode. Don't Panic.


[Image: Malwarebytes Anti-Malware scanning for ICE Cyber Crime Center

The number of Malware objects detected will be highlighted in Red. Once the scan completes, a message will be displayed.



Once you click OK and then click Show Results, a window will open with the all the objects. Selected everything and click on Remove Selected.

[Image: Malwarebytes Anti-Malwar removing ICE Cyber Crime Center virus]

Please Note: Once you press remove selected all the objects will be permanently deleted from your computer. After it removes, you will get a notification similar to this.



Please save all your work and click Yes. The computer will restart.

Though Quick scan will detect all Malware it is advised to do a Full Scan too in order to completely get rid of all Malware.

Okay that's great and worked perfectly but how am I supposed to do this when I am not able to go beyond the ICE cyber screen. Now that's a good question!

These are the steps:

METHOD 1

Just download Malwarebytes from a different computer and store it in a flash drive.

Insert the flash drive on the computer that has a ICE Virus.

Do a hard reboot. (Switch off the CPU and switch it On again!)

Press F12 (If it's a DELL computer) and access the boot menu. Sometimes you might have to press F12 key repeatedly. The boot menu should look something similar to this:



Please select the USB Storage Device and press enter. The Malwarebytes program will load from the USB. You can then perform the same steps mentioned above. Then do a reboot again to restore working condition of your computer.

METHOD 2

Another way to get rid of your ICE cyber crime virus is to do a Computer restore. The system generally makes a checkpoint of the last good configuration it had. You can restore the computer to a date before you actually got the virus. But this does not come in handy every time. Sometimes it doesn't work.

Do a hard reboot on you ICE screen. Then you can Press F8 (Dell computers) and it will show a window with Advance boot options similar to this:



Scroll down using the arrow keys and select the Last Known Good Configuration (advanced) and press Enter.

This will open a command prompt. In the command prompt enter type rstrui.exe and then press Enter.
In case you're using XP/Vista then type -  C:\windows\system32\restore\rstrui.exe. 
In case you're using Windows 7/8/8.1 then type -  C:\windows\system32\rstrui.exe. 
This will start the System Restore which will show you good checkpoints where you had good configurations as shown below:

[Image: Restore settings to remove ransomware]

Select a checkpoint which you think was good and that was before the ICE cyber crime virus. You have options to scan for affected programs on that check point. Sometimes the selected checkpoint cannot be restored, in which case you may have to select a different checkpoint. Once you select a checkpoint, Click next and the computer should be restored. Once that's done restart your system and login to windows. Then it is advisable to do a scan with Malwarebytes.

METHOD 3:

The third method would be login in Safe mode. The safe mode options can be accessed in the Advanced Boot Options Menu  as described above. It will look like this:



Be sure to select Safe mode with Networking. This will enable internet. Once all the files load and login is successful, either load Malwarebytes from the Flash drive or download from browser and run it. Once the scan is done, you can restart and login normally.

These are the ways you can handle the ICE virus. There are other programs like Malwarebytes such as Hitman Pro and Kaspersky's TDSS killer but Malwarebytes is my personal recommendation.

References: Google Images, Wikipedia, Malwarebytes.