Skip to content

Instantly share code, notes, and snippets.

Avatar

Ali Falahi afalahi

  • Denver, CO
View GitHub Profile
@afalahi
afalahi / request.rb
Created Apr 5, 2022 — forked from zaru/request.rb
AWS SNS publish api curl request
View request.rb
require 'json'
require 'aws-sigv4'
require 'active_support/core_ext'
params = {
'Action' => 'Publish',
'TargetArn' => 'arn:aws:sns:ap-northeast-1:000000000000:example-topic',
'Message' => 'message',
'Version' => '2010-03-31'
}.to_query
View password-import-hook.json
{
"eventId": "3o9jBzq1SmOGmmsDsqyyeQ",
"eventTime": "2020-01-17T21:23:56.000Z",
"eventType": "com.okta.user.credential.password.import",
"eventTypeVersion": "1.0",
"contentType": "application/json",
"cloudEventVersion": "0.1",
"source": "https://${yourOktaDomain}/api/v1/inlineHooks/cal2xd5phv9fsPLcF0g7",
"data": {
"context": {
View create-nat-switch.ps1
$VerbosePreference = "Continue"
Write-Verbose -Message "Creating the VM Switch"
$SwitchName=Read-Host "Switch Name"
New-VMSwitch -Name "$SwitchName" -SwitchType Internal
Write-Verbose -Message "Switch Created Successfully"
Write-Verbose -Message "Assiging IP and SubnetMask to $SwitchName"
$GateWay= Read-Host "Enter Gatway Address"
$prefixLength = 24
$ifIndex = Get-NetAdapter | Where {$_.Name -like "*$SwitchName*"}
New-NetIPAddress -IPAddress $GateWay -PrefixLength $prefixLength -InterfaceIndex $ifIndex.ifIndex