Skip to content

Instantly share code, notes, and snippets.

@fagnercarvalho
Last active December 10, 2020 22:24
Show Gist options
  • Save fagnercarvalho/ebba78cf15eecbd1ac87581199f98f95 to your computer and use it in GitHub Desktop.
Save fagnercarvalho/ebba78cf15eecbd1ac87581199f98f95 to your computer and use it in GitHub Desktop.
Useful Windows/Linux prompt commands
# Windows
# Reset TCP/IP configuration to try to fix faulty NIC
# Removes all user-configured IPv4 (Internet Protocol version 4) settings
netsh int ip reset resetlog.txt
# Check if port is binded to another service in the machine
Get-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess
Get-Process -Id (Get-NetUDPEndpoint -LocalPort YourPortNumberHere).OwningProcess
# Add env variable
[System.Environment]::SetEnvironmentVariable('DATA_SOURCE_NAME', 'user:password@(localhost:3306)/',[System.EnvironmentVariableTarget]::Machine)
# Disable Internet Connection Sharing
# https://answers.microsoft.com/en-us/windows/forum/all/solved-unable-to-stop-internet-connection-sharing/b01e1ebc-4f9d-4bf6-8d15-37a782fa03ff
# Check reserved ports
netsh interface ipv4 show excludedportrange protocol=tcp
# Wireshark filter to find raspberrypi IP in network
eth.addr[0:3] == B8:27:EB
# Create SQL scripts with all scripts from the current folder
Get-Content *.sql | Set-Content "script.sql"
# Get examples for command
Get-Help Test-NetConnection -examples
# Combine all files into one
Get-Content C:\logs\*.txt | Out-File C:\Combined.txt
# Windows/Linux
# Clear all unused networks/stopped containers
docker system prune
# Delete volume
docker volume rm <name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment