arp-scan --localnet
du -h
cat /path/to/file.txt | grep -o -P '.{0,3}string-to-match.{0,10}'
| import requests | |
| requests.post('http://{}/job/{}/buildWithParameters?{}={}'.format( | |
| jenkins_url, | |
| job_name, | |
| parameter_name, | |
| parameter_value | |
| )) |
| $serverAddress = "1.1.1.1" | |
| $userName = "user" | |
| $securePassword = ConvertTo-SecureString -AsPlainText -Force -String "password" | |
| $credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $userName,$securePassword | |
| $session = New-PSSession -ComputerName $serverAddress -Credential $credentials | |
| Invoke-Command -Session $session -ScriptBlock { | |
| Write-Host "hello world" | |
| } |
| use [dbname] | |
| go | |
| grant execute to [user] |
git credential-manager clear
| Param([string]$fileName, [string]$find, [string]$replace) | |
| (Get-Content $fileName -encoding UTF8) | foreach-object { | |
| $_ -replace $find, $replace | |
| } | Set-Content $fileName -encoding UTF8 |
| winrm quickconfig | |
| winrm s winrm/config/client '@{TrustedHosts="myservername.domain"}' | |
| # To list the trusted hosts: | |
| Get-Item WSMan:\localhost\Client\TrustedHosts |
| $dbName = "MyDatabase" | |
| $serverAddress = ".\SqlServer" | |
| # Delete the existing database. | |
| $server = new-Object Microsoft.SqlServer.Management.Smo.Server($serverAddress) | |
| if($server.Databases[$dbName) | |
| { | |
| $server.KillDatabase($dbName) | |
| } |