Skip to content

Instantly share code, notes, and snippets.

View skmkzyk's full-sized avatar

Kazuyuki Sakemi skmkzyk

  • Microsoft
  • Tokyo
View GitHub Profile
@skmkzyk
skmkzyk / stylus.css
Created January 24, 2024 07:19
Wide ChatGPT
/* change the input area*/
.xl\:max-w-3xl {
max-width: 95% !important;
}
/* change the message area*/
.text-base {
max-width: 95% !important;
}
@skmkzyk
skmkzyk / gist:1efc7e696bb6cbda3605e13fac7ddff2
Created March 11, 2023 10:22
list for the Windows10 Azure Marketplace images.
Architecture Offer Publisher Sku Urn Version
-------------- ---------- ----------------------- --------------------------- ------------------------------------------------------------------------------------ ---------------------
x64 Windows-10 MicrosoftWindowsDesktop 19h1-ent-gensecond MicrosoftWindowsDesktop:Windows-10:19h1-ent-gensecond:18362.1198.2011031735 18362.1198.2011031735
x64 Windows-10 MicrosoftWindowsDesktop 19h1-ent-gensecond MicrosoftWindowsDesktop:Windows-10:19h1-ent-gensecond:18362.1256.2012032308 18362.1256.2012032308
x64 Windows-10 MicrosoftWindowsDesktop 19h1-entn-gensecond MicrosoftWindowsDesktop:Windows-10:19h1-entn-gensecond:18362.1198.2011031735 18362.1198.2011031735
x64 Windows-10 MicrosoftWindowsDesktop 19h1-entn-gensecond Micros
@skmkzyk
skmkzyk / gist:e3fa45f9dc1a17b18fd280df244508c2
Created March 11, 2023 10:20
list for the Windows11 Azure Marketplace images.
Architecture Offer Publisher Sku Urn Version
-------------- ---------- ----------------------- -------------------- ------------------------------------------------------------------------- -----------------
x64 windows-11 MicrosoftWindowsDesktop win11-21h2-avd MicrosoftWindowsDesktop:windows-11:win11-21h2-avd:22000.1219.221105 22000.1219.221105
x64 windows-11 MicrosoftWindowsDesktop win11-21h2-avd MicrosoftWindowsDesktop:windows-11:win11-21h2-avd:22000.1335.221202 22000.1335.221202
x64 windows-11 MicrosoftWindowsDesktop win11-21h2-avd MicrosoftWindowsDesktop:windows-11:win11-21h2-avd:22000.1455.230107 22000.1455.230107
x64 windows-11 MicrosoftWindowsDesktop win11-21h2-avd MicrosoftWindowsDesktop:windows-11:win11-21h2-avd:22000.1574.230207 22000.1574.230207
x64 windows-11
javascript: if (location.href.match(/((docs|azure|learn)\.microsoft\.com)\/en-us\//)) { location.href = location.href.replace(/en-us/, "ja-jp") } else if (location.href.match(/((docs|azure|learn)\.microsoft\.com)\/ja-jp\//)) { location.href = location.href.replace(/ja-jp/, "en-us") }
@skmkzyk
skmkzyk / s2svpn.bicep
Created June 30, 2022 06:56
Bicep file for S2S VPN between 2 VNets in different region.
param primary_region string = 'southeastasia'
param secondary_region string = 'eastasia'
@secure()
param psk string
resource vnet01 'Microsoft.Network/virtualNetworks@2021-08-01' = {
name: 'vnet-sea01'
location: primary_region
properties: {
@skmkzyk
skmkzyk / Reassign-AzWvdSessionHost.ps1
Created April 17, 2022 02:08
temporary workaround script to reassign AVD single session host.
$subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$hostPoolName = "hp01"
$sessionHostName = "sh01-0.xxx.onmicrosoft.com"
$newUser = "avduser01@xxx.onmicrosoft.com"
$apiVersionParam = "api-version=2021-09-03-preview"
$sessionHostId = "/subscriptions/${subscriptionId}/resourceGroups/avd/providers/Microsoft.DesktopVirtualization/hostpools/${hostPoolName}/sessionhosts/${sessionHostName}"
$contentJson = (Invoke-AzRestMethod -Method GET -Path "${sessionHostId}?${apiVersionParam}").Content
$content = ConvertFrom-Json $contentJson
@skmkzyk
skmkzyk / enable-ansible-by-customscriptextension.bicep
Created March 5, 2022 09:59
Bicep file for enabling ansible by CustomScriptExtension with CredSSP authentication.
resource extension 'Microsoft.Compute/virtualMachines/extensions@2015-06-15' = {
name: '${virtualMachineName}/CustomScriptExtension'
location: location
properties: {
publisher: 'Microsoft.Compute'
type: 'CustomScriptExtension'
typeHandlerVersion: '1.10'
autoUpgradeMinorVersion: true
settings: {}
protectedSettings: {
@skmkzyk
skmkzyk / StoragePermission.ps1
Created November 18, 2021 13:01
a bunch of script to manipulate Storage Account share permissions.
# Get Directory Properties
# https://docs.microsoft.com/en-us/rest/api/storageservices/get-directory-properties
$storageAccount = "xxx"
$accesskey = "xxx"
$container = "ntfs"
$method = "GET"
$version = "2019-02-02"
$resource = "$container/project-puni"
$queue_url = "https://$storageAccount.file.core.windows.net/$resource`?restype=directory"
@skmkzyk
skmkzyk / New-ManyADUser.ps1
Created October 31, 2021 07:30
Wrapped New-ADUser script to add many users.
$password = "xxx"
$secured = ConvertTo-SecureString $password -AsPlainText -Force
for ($i = 1; $i -lt 10000; $i++) {
Write-Host $("wvduser{0:000000}" -f $i)
New-ADUser -PasswordNeverExpires $true -AccountPassword $secured -Name $("wvduser{0:000000}" -f $i) -Enabled $true
}
@skmkzyk
skmkzyk / equinix-metal-vmware-esxi.md
Created October 25, 2021 12:32
create VMware ESXi host on Equinix Metal
  1. VMware を選択して、server を作成する
  • いったんは Public IP アドレスはなしにする
  1. IPs & Networks から Public IP アドレスを /29 くらい申請する
  2. Layer 2 から適当に VLAN を作成する
  3. Metal Gateway から上記作成した VLAN、Public IP アドレスを用いて Gateway を作成する
  4. VMware の server に戻り、Network メニューから Convert to Other Network Type から Hybrid Bonding にして、上記 VLAN を選択する
  5. OpenVPN を張ってれば management vlan でログインできるはずなのでログイン
  • https://10.x.x.x とかでアクセスできるはず
  • できなければ iptables 多分忘れてる
  1. (こっからの手順自信ない) Port group を作成する