function noteToFreq(note) {
let a = 440; //frequency of A (coomon value is 440Hz)
return (a / 32) * (2 ** ((note - 9) / 12));
}function noteToFreq($note) {| # Install sber-swap pre-requisites for Windows 10 on an Azure VM of type NC (GPU) | |
| # NVIDIA TeslaK80 / Radeon | |
| Set-ExecutionPolicy Bypass -Scope Process -Force; | |
| # Install chocolatey | |
| iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); | |
| refreshenv |
| New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT -ErrorAction SilentlyContinue | Out-Null | |
| $count = 0 | |
| try { | |
| Get-ChildItem HKCR: -ErrorAction SilentlyContinue | ForEach-Object { | |
| if((Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue).PSObject.Properties.Name -contains "URL Protocol") { | |
| $name = $_.PSChildName | |
| $count += 1 | |
| $line = "URI Handler {0:d4}: {1}" -f $count, $name | |
| Write-Host $line | |
| } |
| internal class MongoTracking | |
| { | |
| private readonly Action<CommandStartedEvent> onCommandStartEvent; | |
| private readonly Action<CommandSucceededEvent> onCommandSucceededEvent; | |
| private readonly Action<CommandFailedEvent> onCommandFailedEvent; | |
| private IEnumerable<string> NotTrackedCommands { get; } = new[] | |
| {"isMaster", "buildInfo", "getLastError", "saslStart", "saslContinue"}; |
<key> <groupname> <id or $><key> <id or $><key> <groupname><key> <consumername><key> [<start> <stop>]<key> <group-name> <consumer-name> <min-idle-time> <ID-1> <ID-2> ...<key> <ID-1> <ID-2> ...[CONSUMERS|GROUPS|STREAM|...]. STREAM is the default| // connect() is a function that injects Redux-related props into your component. | |
| // You can inject data and callbacks that change that data by dispatching actions. | |
| function connect(mapStateToProps, mapDispatchToProps) { | |
| // It lets us inject component as the last step so people can use it as a decorator. | |
| // Generally you don't need to worry about it. | |
| return function (WrappedComponent) { | |
| // It returns a component | |
| return class extends React.Component { | |
| render() { | |
| return ( |
| function Send-UdpDatagram | |
| { | |
| Param ([string] $EndPoint, | |
| [int] $Port, | |
| [string] $Message) | |
| $IP = [System.Net.Dns]::GetHostAddresses($EndPoint) | |
| $Address = [System.Net.IPAddress]::Parse($IP) | |
| $EndPoints = New-Object System.Net.IPEndPoint($Address, $Port) | |
| $Socket = New-Object System.Net.Sockets.UDPClient |
Dear white hat attackers,
recently we observed a number of Redis instances that were targeted by a simple attack,
consisting in setting a password using the CONFIG SET requirepass <password> command
to instances which are left open on the internet.
This is, in my opinion, a good idea, since those Redis instances are going to be cracked anyway. I believe you are doing this in order to make Redis users aware they forgot to setup firewalling rules in order to make their instances not reachable from the outside.
| function Update-AssemblyInfoVersionFiles | |
| { | |
| Param | |
| ( | |
| [Parameter(Mandatory=$true)] | |
| [string]$productVersion | |
| ) | |
| $buildNumber = $env:BUILD_BUILDNUMBER | |
| if ($buildNumber -eq $null) |
| # extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip | |
| # under public domain terms | |
| country_bounding_boxes = { | |
| 'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)), | |
| 'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)), | |
| 'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)), | |
| 'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)), | |
| 'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)), | |
| 'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)), |