• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

windows

Windows Curl Command

January 11, 2023

If you have to download a file from the Internet on a Windows server, can certainly use the browser. But if the browser is rendering the file instead of downloading them, you may have to use the curl command which is already pre-installed on most Windows servers. Just open the command line. Here’s the the curl command to download a file.

curl.exe --output index.txt --url https://website.domain/index.txt

curl.exe --output index.txt --url https://website.domain/index.txt

Filed Under: Misc Tagged With: curl, download, server, windows

Windows Check If Port is Listening

March 3, 2022

Here’s how to check if port is listening on a Windows Server.

Log in to the destination server.

netstat -ano | find "443" | find "LISTEN"
tasklist /fi "PID eq "443"

netstat -ano | find "443" | find "LISTEN" tasklist /fi "PID eq "443"

Filed Under: Misc Tagged With: check, listening, netstat, port, tasklist, windows

GCP Windows Password Reset

February 14, 2022

Instead of the GCP Console, you can reset Windows Server password via gcloud.

gcloud compute reset-windows-password server-name \
--zone us-central1-a \
--project project-id

gcloud compute reset-windows-password server-name \ --zone us-central1-a \ --project project-id

Username and password will generated.

Filed Under: Cloud Tagged With: gcloud, gcp, password, reset, windows

GCP Reset Windows Password

February 4, 2022

How to reset password of a GCP Compute Engine running on Windows OS.

gcloud compute reset-windows-password servername \
--zone us-central1-a \
--project your-project-id

gcloud compute reset-windows-password servername \ --zone us-central1-a \ --project your-project-id

Output

This command creates an account and sets an initial password for the
user [firstname_lastname] if the account does not already exist.
If the account already exists, resetting the password can cause the
LOSS OF ENCRYPTED DATA secured with the current password, including
files and stored passwords.
 
For more information, see:
https://cloud.google.com/compute/docs/operating-systems/windows#reset
 
Would you like to set or reset the password for [firstname_lastname]
(Y/n)?  y
 
Resetting and retrieving password for [firstname_lastname] on [servername]
Updated [https://www.googleapis.com/compute/v1/projects/your-project-id/zones/us-central1-a/instances/servername].
WARNING: Instance [servername] does not appear to have an external IP
address, so it will not be able to accept external connections.
To add an external IP address to the instance, use
gcloud compute instances add-access-config.
password: xxxxxxxxxxxxxxx
username: firstname_lastname

This command creates an account and sets an initial password for the user [firstname_lastname] if the account does not already exist. If the account already exists, resetting the password can cause the LOSS OF ENCRYPTED DATA secured with the current password, including files and stored passwords. For more information, see: https://cloud.google.com/compute/docs/operating-systems/windows#reset Would you like to set or reset the password for [firstname_lastname] (Y/n)? y Resetting and retrieving password for [firstname_lastname] on [servername] Updated [https://www.googleapis.com/compute/v1/projects/your-project-id/zones/us-central1-a/instances/servername]. WARNING: Instance [servername] does not appear to have an external IP address, so it will not be able to accept external connections. To add an external IP address to the instance, use gcloud compute instances add-access-config. password: xxxxxxxxxxxxxxx username: firstname_lastname

Filed Under: Cloud Tagged With: compute, gcp, password, reset, set, windows

Run Telnet on Git Bash

October 20, 2021

Although telnet is not used regularly since insecure, it’s a handy tool for testing ports.

For example, to check if a port 80 is open, you run this command.

$ telnet servername 80

$ telnet servername 80

Git Bash does not come with telnet, but you can use the Windows version by using winpty.

$ winpty telnet servername 457
Connecting To servername...Could not open connection to the host, on port 457: Connect failed

$ winpty telnet servername 457 Connecting To servername...Could not open connection to the host, on port 457: Connect failed

If port is open, you get an empty reply, just like in Windows.

Filed Under: Linux Tagged With: check, git bash, ports, telnet, windows

Where in Windows

October 6, 2021

How to find where the executable is located in Windows? Use the where command in CMD.

where gcloud
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd

where gcloud C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd

It will list multiple locations if you have several versions installed on your system.

Filed Under: Misc Tagged With: command, executable, location, where, windows

Powershell Test Network Connection

June 15, 2020

Here’s the command to test a network connection in Powershell.

C:> Test-NetConnection -ComputerName server -Port 443

C:> Test-NetConnection -ComputerName server -Port 443

Result:

ComputerName     : server
RemoteAddress    : 10.0.0.5
RemotePort       : 443
InterfaceAlias   : Ethernet 0
SourceAddress    : 10.1.1.34
TcpTestSucceeded : True

ComputerName : server RemoteAddress : 10.0.0.5 RemotePort : 443 InterfaceAlias : Ethernet 0 SourceAddress : 10.1.1.34 TcpTestSucceeded : True

Filed Under: Windows Tagged With: port, powershell, test-netconnection, windows

Windows Route Add

January 14, 2020

Here’s how to add a route in Windows. Open CMD as Administrator.

route add 10.10.10.10 mask 255.255.255.0 10.10.10.254

route add 10.10.10.10 mask 255.255.255.0 10.10.10.254

To make it persistent, add -p.

route add 10.10.10.10 mask 255.255.255.0 10.10.10.254

route add 10.10.10.10 mask 255.255.255.0 10.10.10.254

To display. Specifies IP 4 only.

route print -4

route print -4

Filed Under: Windows Tagged With: add, display, permanent, persistence, print, route, server, windows

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023