Showing posts with label Windows Tips & Tricks. Show all posts
Showing posts with label Windows Tips & Tricks. Show all posts

Tuesday, 15 August 2023

A Guide to Installing and Configuring SSH Tunneling | Windows

Introduction:

Secure communication and data protection are paramount in today's digital landscape. One effective way to ensure this is through the use of SSH tunneling. In this guide, we'll walk you through the process of installing, setting up, and utilizing SSH tunneling on a Windows operating system. This technique will provide you with a secure and encrypted channel for your data transmission needs.

Step 1: Install OpenSSH as a Windows Optional Feature
  1. Begin by installing OpenSSH as an optional feature on your Windows machine.
  2. Windows will automatically create a new firewall rule to permit inbound SSH access over port 22.
Note that, if you manually download and install OpenSSH, you'll need to create an inbound rule to allow SSH port access.

Step 2: Start and Enable the SSH Service

1. Open PowerShell as an administrator
2. Start the SSH service using the following command 
Start-Service ssh

Thursday, 14 February 2019

Excel: Increment Numbers Based on Another Column(Criteria) when Value Changes | Windows

apple 1
apple 2
apple 3
mango 1
mango 2
coco 1
coco 2
coco 3
coco 4
vanila 1
vanila 2

=IF(B10<>B9,1,C9+1)
or

=COUNTIF($A$2:A2,A2) 

to under what the $ sign is in excel forumula, please visit this: https://www.quora.com/What-is-the-difference-between-a-2-a2-and-a2-in-Excel 

Wednesday, 7 March 2018

Find and kill a process which is listening on port 8080 | Windows


netstat –aon | find "<port number>"
Example:
netstat -ano -t  | findstr LISTENING | findstr :8080


now kill using taskkill command

taskkill /F /pid xxx

or kill by name for example.
taskkill /im notepad.exe

Tip: to find a string in a file using findstr:
findstr /i "helloworld" abc.txt
or
findstr /i "^hell*rld" abc.txt


------------------------------

Linux:
my best command:
netstat -tulpen

example:
netstat -tulpn | grep LISTEN | grep '(8080 |8081 |8082 | xxx)'

or

$ lsof -i tcp:1555

Wednesday, 28 February 2018

Schedule this Batch to Download via FTP | Windows

We can use Linux-based utilities which are more secure and available for windows, like "wget" and "WinSCP" which is also a good option, but I preferred to stay in windows using the default old FTP command. Or we also can use Powershell instead of the old command-prompt-based batch file.


Anyhow, below is just one windows command using echo to redirect the text in a file and then the file will be called by FTP.

Just Run or you can write this command in a batch file to schedule.

cd /d "C:\Users\AQ\INTEGRATION\download"

echo open 10.152.30.229 >> ftp.txt & echo user myuser mypassword >> ftp.txt & echo binary >> ftp.txt & echo get "filename.dat" >> ftp.txt & echo bye >> ftp.txt & ftp -n -v -s:ftp.txt & del ftp.txt


1. 1st line is the path, where you want to download. 

2. Replace myuser and mypassword with the real FTP user credentials.

3. This script will create a file ftp.txt, and at the end of the line: this file is called by FTP before deletion. 


Note: Security concerns: username and password are written here. 

We also can use power sh


Wednesday, 1 November 2017