I hereby claim:
- I am ml4den on github.
- I am ml4den (https://keybase.io/ml4den) on keybase.
- I have a public key whose fingerprint is CDBC C75A 5608 2E1B 8848 4D90 A685 01A0 EA4F 14CD
To claim this, I am signing this object:
| // Place outside of the ViewController class. | |
| override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { | |
| view.endEditing(true) | |
| } |
| function SendEmail { | |
| param([string]$emailSubject, [string]$emailBody) | |
| $recipientEmail = "john.smith@example.com" | |
| $senderName = "John Smith" | |
| $senderEmail = "noreply@example.com" | |
| $serverSMTP = "mail.example.com" | |
| Send-MailMessage -To $recipientEmail -From "$senderName <$senderEmail>" -Subject $emailSubject -Body $emailBody -BodyAsHtml -SmtpServer $serverSMTP | |
| } |
| var loc = window.location.href+''; | |
| if (loc.indexOf('http://')==0){ | |
| window.location.href = loc.replace('http://','https://'); | |
| } |
| # Quick and dirty transliteration method. | |
| # Uses the Streamlined System. | |
| # Don't forget to use "-Encoding UTF8" when working with files. | |
| $string = $string -replace 'а','a' -replace 'б','b' -replace 'в','v' -replace 'г','g' -replace 'д','d' -replace 'е','e' -replace 'ж','zh' -replace 'з','z' -replace 'и','i' -replace 'й','y' -replace 'к','k' -replace 'л','l' -replace 'м','m' -replace 'н','n' -replace 'о','o' -replace 'п','p' -replace 'р','r' -replace 'с','s' -replace 'т','t' -replace 'у','u' -replace 'ф','f' -replace 'х','h' -replace 'ц','ts' -replace 'ч','ch' -replace 'ш','sh' -replace 'щ','sht' -replace 'ъ','a' -replace 'ь','y' -replace 'ю','yu' -replace 'я','ya' |
| $servers = "printserver1","printserver2" | |
| $remoteFolder = "\\fileshare\backups" | |
| foreach ($server in $servers){ | |
| $localFile = "C:\temp\$server.PrinterExport" | |
| & "C:\Windows\System32\spool\tools\PrintBrm.exe" -s $server -b -f $localFile | |
| Move-Item $localFile $remoteFolder -Force | |
| } |
| # Simple find and quit: | |
| (New-Object -comObject Shell.Application).Windows() | where-object {$_.LocationName -eq "Personalisation"} | foreach-object {$_.quit()} | |
| # Credit: https://www.tenforums.com/customization/51260-apply-windows-10-theme-cmd-powershell-programming-post963151.html#post963151 | |
| # Wait for window and quit: | |
| do { | |
| $windowcheck = (New-Object -comObject Shell.Application).Windows() | where-object {$_.LocationName -eq "Personalization"} | |
| Write-Host "Waiting for window..." | |
| Start-Sleep -m 200 | |
| } |
| # A quick and dirty PowerShell script to search for a particular MAC address on Windows DHCP servers across all scopes. | |
| $dhcpServers = @("dhcp-server-01","dhcp-server-02") # Define your servers here | |
| $results = @() | |
| $clientId = Read-Host -Prompt "Input the MAC address you want to search for" | |
| foreach ($dhcpServer in $dhcpServers) { | |
| Write-Host "Searching $dhcpServer..." | |
| Get-DhcpServerv4Scope -ComputerName $dhcpServer | ForEach-Object { | |
| $results += Get-DhcpServerv4Reservation -ComputerName $dhcpServer -ScopeId $_.ScopeId -ClientId $clientId -ErrorAction SilentlyContinue |
| Function Get-HostCertificateGrade ($hostname) { | |
| # Rudimentary function for checking host certificate grades using the SSL Labs API | |
| # https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md | |
| Do { | |
| $apiCall = Invoke-RestMethod -Uri "https://api.ssllabs.com/api/v3/analyze?host=$hostname&fromCache=on" | |
| Write-Host $hostname "status:" $apiCall.status | |
| if ($apiCall.status -eq "DNS") {Start-Sleep -Seconds 5} |
| const dns = require('dns'); | |
| var callback = function (err, data) { | |
| if (err) return console.error(err); | |
| console.log(data); | |
| }; | |
| dns.resolveTxt("example.com",callback) |
I hereby claim:
To claim this, I am signing this object: