Monday, October 17, 2011

how to open a new port tho firewall

netsh firewall add portopening protocol=TCP port=465 name="NAME" mode=enable scope=all profile=standard

How to check your ports on windows

#1 Checking the listening ports

netstat -an

Piping the command above with find /i "WORD_HERE" perhaps ease your search.

Copy files and dirs to ec2 machine

scp -i penfilfe Source_name ec2user@ec2Public_DNS:Destination

How to add a new user and a password on lunix

Run following cmd to create a new user.
/usr/sbin/useradd new_username

This will prompt the password twice.
/usr/bin/passwd new_username

Now it's all set!

Source : http://www.mediacollege.com/linux/red-hat/useradd.html

Wednesday, October 12, 2011

Generating dummy file on cmd

http://www.windows-commandline.com/2009/07/how-to-create-large-dummy-file.html

syntax to create a file:
fsutil file createnew filename length

(length is in bytes)
For example, to create a dummy file test.txt, with size as 50MB :

fsutil file createnew test.txt 52428800

Note that the above command creates a sparse file which does not have any real data. If you want to create a file with real data then you can use the below command line script.

echo “This is just a sample line appended to create a big file ” > dummy.txt
for /L %i in (1,1,14) do type dummy.txt >> dummy.txt

(Run the above two commands one after another or you can add them to a batch file.)

The above commands create a 1 MB file dummy.txt within few seconds. If you want to create 1 GB file you need to change the second command as below.

echo “This is just a sample line appended to create a big file ” > dummy.txt
for /L %i in (1,1,24) do type dummy.txt >> dummy.txt

Friday, September 23, 2011

Recover mysql root pass on Win2008

http://www.geekpedia.com/KB105_How-to-reset-your-MySQL-root-password-under-Windows.html