PowershellでSMTP認証メール送信

$Credentials = Get-Credential Send-MailMessage -To to@xxx.com -Subject test -From from@xxx.com -SmtpServer smtp.sendgrid.net -Port 587 -Credential $Credentials

AppServiceのメトリック取得

$ret=Get-AzMetric -ResourceId "/subscriptions/xxxxxxxxxxxxxxx/resourceGroups/JS002/providers/Microsoft.Web/sites/xxxxxxx" -MetricName "Requests" -TimeGrain 00:01:00 -StartTime 2020-04-29T15:00:00Z -EndTime 2020-04-29T15:10:00Z$ret.data

VMメトリック取得

$resourceid="/subscriptions/xxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxx/providers/Microsoft.Compute/virtualMachines/xxxxxxxxx" $ret1=Get-AzMetric -ResourceId $resourceid -TimeGrain 01:0:00 -MetricName "Percentage CPU" -StartTime 2019-07-0…

証明書情報取得

openssl s_client -connect example.com:443 -servername example.com < /dev/null 2>/dev/null | openssl x509 -noout -text | grep -e "Not After" -e "DNS"

【Azure PowerShell】AppServiceのftps状態一覧取得

$WebApps = Get-AzureRmWebApp; for($i = 0; $i -lt $WebApps.Count; $i++) { $Resource = Get-AzureRmResource -ResourceType "microsoft.web/sites/config" -ResourceGroupName $WebApps[$i].ResourceGroup -ResourceName $WebApps[$i].Name -ApiVersion '…

【Azure PowerShell】SecurityGroupRule一覧取得

Get-AzureRmNetworkSecurityGroup -Name xxxxx -ResourceGroupName xxxxx | Get-AzureRmNetworkSecurityRuleConfig | Sort-Object -Property Priority | format-table -property Name,Protocol,SourcePortRange,DestinationPortRange,SourceAddressPrefix,De…

【Azure CLI】vmコア数一覧取得

az vm list -o tsv --query "[].[name, location, hardwareProfile.vmSize]"

【Azure CLI】カスタムドメイン一覧取得

az webapp list --resource-group js001 -o tsv --query "[].[name]" | sort | while read line do set -- $line webappsname=$1 az webapp config hostname list --resource-group js001 --webapp-name $webappsname --output tsv --query "[].{SiteName:si…

【apache】時分別アクセス数集計

grep '10/Mar/2018:2' /var/log/httpd/access_log | awk '{print $4}' | awk -F ':' '{print $2 $3}' | sort | uniq -c

【mysql】mysql-clientインストール

https://dev.mysql.com/downloads/repo/yum/ yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm yum list | grep mysql.*client yum install mysql-community-client.x86_64

【web.config】Proxy使用時のIP制限&HOSTヘッダチェック

<security> <ipSecurity allowUnlisted="false" denyAction="Forbidden" enableProxyMode="true"> <add allowed="true" ipAddress="xxx.xxx.xxx.xxx" /> <add allowed="true" ipAddress="xxx.xxx.xxx.xxx" /> </ipSecurity> </security> <rewrite> <rules> </rules></rewrite>

【bash】カーソルより右側削除

Ctrl+k