Showing posts with label command-prompt. Show all posts
Showing posts with label command-prompt. Show all posts

Saturday, December 05, 2015

Install Python on Windows 7 Script(*.bat)

  1. ::download python
  2. wget --no-check-certificate https://www.python.org/ftp/python/2.7.3/python-2.7.3.msi
  3. ::run installer
  4. python-2.7.3.msi
  5. ::download and run pip
  6. wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
  7. C:\Python27\python.exe get-pip.py
  8. ::add python to path environment variables
  9. setx PATH "%PATH%;C:\Python27"
  10. refreshenv
  11. :: check pip version
  12. python -m pip --version
  13. ::should produce this
  14. ::pip 7.1.2 from C:\Python27\lib\site-packages (python 2.7)
  15. ::run pip module with python and install a simple pyodbc package
  16. python -m pip install pyodbc
Download Script : Install Python 2.7.3 on Windows 7.bat

Please see this if you dont find any of this commands above not installed :
http://mohiplanet.blogspot.com/2015/10/convert-windows-command-prompt-to-linux.html

Saturday, July 26, 2014

'pwd' command on windows command prompt(cmd)

On windows command prompt, the command to print current directory  is :cd

Mapping 'pwd' command to 'cd':
Create a pwd.bat file on C:\Windows\System32 directory that have cd inside:

Contents of pwd.bat file :

  1. @echo off
  2. echo %cd%

This should create a pwd.bat at system32 directory. Now running pwd command should print current directory.

Friday, July 11, 2014

'clear' command on windows command prompt(cmd)

Create a batch file at C:\Windows\System32\clear.bat.
Place cls command inside it. You can do this by running the following command on an elevated Command Prompt:
  1. echo cls > %WINDIR%\system32\clear.bat
This should create a clear.bat on system32 directory.


Sunday, May 04, 2014

First hello world app with Laravel 4 in WindowsXP

In windows XP at first download xampp 1.8.2 from here.
http://downloads.sourceforge.net/project/xampp/XAMPP%20Windows/1.8.2/xampp-win32-1.8.2-5-VC9-installer.exe
And install it.
And then download Composer from  https://getcomposer.org/
https://getcomposer.org/Composer-Setup.exe
(Composer is a dependency manager for PHP.Something like Maven in Java.)
While installing composer select php.exe from xampp installation directory(XAMPP_INSTALL_DIR\php\php.exe) when prompted.
Now navigate to a directory where you want to create your first laravel project(D:\l4)
with Command Prompt.Run the following command to create your first laravel project:

composer create-project laravel/laravel your-first-laravel-project --prefer-dist

This command will download and install a fresh copy of Laravel in a new your-first-laravel-project folder within your current directory.
Next run thecomposer install command in the root of your manually created project directory. This command will download and install the framework's dependencies.

Make sure your current directory contains a file named artisan.
Now run the following command to run your first helloworld app:
php artisan serve

Now browse to http://localhost:8000/
to see the output.You should see a screen saying "You have arrived."

Saturday, January 11, 2014

Making Windows Command Prompt more linux like

Here I'm trying to keep a list of mostly used command line tools available under windows .
Below is a list of tools that can be put to use via command prompt and most of unix tools for writing automated scripts on Windows.

Install chocoletey:

chocoletey is a yum and apt-get like CLI tool for install new software on your machine but  for windows. With chocoletey(https://chocolatey.org/) you just type 'choco install jdk' and you will have java installed.
On windows 7 just run this on your command prompt:
  1. @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

Make sure you have run cmd as administrator (elevated):


Now you have the ultimate command line installer installed. :)
With chocoletey any tool you install just run :

  1. refreshenv

to instantly use in your current command prompt window.

Install git :

While installing git from http://git-scm.com/download/win just select "Use Git and optional Unix tools from the windows command prompt":




This way you will have lots of unix command line tools available in your command prompt.
Make sure to select MINGW32 for using in Git-Bash during installation.

Install GNU core-utils for windows:

Install GNU core utils for windows http://gnuwin32.sourceforge.net/downlinks/coreutils.php
from
http://gnuwin32.sourceforge.net/packages/coreutils.htm

Install ps tools:
https://download.sysinternals.com/files/PSTools.zip
pstools has some usefull CLI tools like psexec & many others
Install gtools:

Install gtools http://www.p-nand-q.com/download/gtools/gtools-current.exe from
https://code.google.com/p/pserv4/

gtools has some usefull CLI tools like pathed & many others ( See http://p-nand-q.com/download/gtools/index.html )

Install Gcal , a tool to print calendar on console & have same functionality as Unix_Cal
( http://gnuwin32.sourceforge.net/downlinks/gcal.php )
Install bc , a command line calculator that lets do floating point calculations on command prompt
(http://gnuwin32.sourceforge.net/downlinks/bc.php)

Still missing 'clear' & 'pwd':

Run this code on your cmd:
  1. echo cls > %WINDIR%\system32\clear.bat
you will have unix clear  on your command prompt.
Download this file from :
https://raw.githubusercontent.com/ahmedmohiduet/Scripts/master/pwd.bat
and place it on your system directory:(C:\WINDOWS\system32).
If you have already installed wget with chocoletey then just run the follwing commands on your command prompt:
  1. cd c:
  2. cd C:\WINDOWS\system32
  3. wget --no-check-certificate https://raw.githubusercontent.com/ahmedmohiduet/Scripts/master/pwd.bat

Download and install UnxUtils from
http://unxutils.sourceforge.net/UnxUtils.zip
It has lotta useful utilities like du.

Download and install http://www.paulsadowski.com/wsh/cmdprogs.htm
http://www.paulsadowski.com/wsh/cmdutils.zip
It has lotta useful tools like df

Download and install Putty Installer from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
https://the.earth.li/~sgtatham/putty/latest/x86/putty-0.67-installer.exe
make sure to add environment variable:
  1. setx /m PATH "%PATH%;C:\Program Files (x86)\PuTTY"

It has lotta useful tools like pscp,putty,plink etc

Download and install nmap
https://nmap.org/dist/nmap-7.60-setup.exe
it has lotta network utilities like nmap, npcap, ncat, ndiff, nping

Download and install util-linux-ng
http://downloads.sourceforge.net/gnuwin32/util-linux-ng-2.14.1-setup.exe
it has lotta tools like col, colcrt, colrm, ddate, getopt, hexdump, line, rename, rev, taiff

In Command Prompt you dont get to copy & paste convenient enough. But fortunately in Git-Bash you copy and paste with ctrl+inst and shift+inst.

I am trying maintaining a list of all command-line tools available for windows & trying to make the list as much as comprehensive as possible.
Feel free to add comment if you believe I am missing any more tool :)