2024-07-08

Windows CPU/RAM/Disk Performance Monitor Log - typeperf

$Path = 'C:\';
$Folder = 'PerfLogs';
$FullPath = ($Path + $Folder + '\');
$CounterFile = 'Counters.txt';
$LoopSeconds = 5;
$LogKeepDays = 30;

$Now = (Get-Date);

if ((Test-Path $FullPath) -eq $False) {
write-host ('Path ' + $FullPath + ' not found.');
New-Item -Path $Path -Name $Folder;
exit;
};

2024-04-26

Get Web Site SSL Certificate Expired Date

 $Uri = 'https://www.contoso.com';

$request = [System.Net.WebRequest]::Create($Uri);
$request.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
$response = $request.GetResponse();
(($request.ServicePoint).Certificate).GetExpirationDateString();

其中 ($request.ServicePoint).Certificate.Subject 可以核對 FQDN

參考資料: https://stackoverflow.com/questions/22233702/how-to-download-the-ssl-certificate-from-a-website-using-powershell

2024-01-30

Windows Firewall Block Public InBound 80 Port

Windows Firewall Block Public InBound 80 Port

$FWGroupName = "BlockPublicInBound80Port";

# Remove Rule
$Remove = New-NetFirewallRule -DisplayName "RemovePrepare" -Group $FWGroupName -Direction inbound -Program "C:\windows\system32\calc.exe" -Action Block -RemoteAddress $BlockIPs
Remove-NetFirewallRule -Group $FWGroupName -Confirm:$False

# Add Rule
$BlockIPs = @("0.0.0.1-9.255.255.255", "11.0.0.0-172.15.255.255", "172.32.0.0-192.167.255.255", "192.169.0.0-255.255.255.255")
New-NetFirewallRule -DisplayName "Block 80 Port inBound" -Group $FWGroupName -Direction "inBound" -Protocol "TCP" -LocalPort 80 -Action Block -RemoteAddress $BlockIPs

2024-01-01

美食口袋名單-竹縣&新竹以北

美食口袋名單 Google 地圖

美食口袋名單-新竹

美食口袋名單-竹縣

美食口袋名單-新竹以南

美食口袋名單-台北

竹北

紅倉庫歐陸廚房 (03) 550-4258
新竹縣竹北市文興路一段255號
https://www.facebook.com/redloft2017/?locale=zh_TW

艾蜜奇義大利坊 竹北文興店 (03) 667-3691
新竹縣竹北市文興路一段183號
http://www.amici.com.tw

樹夏坐坐 0916-000-025
新竹縣竹北市成功二街166號
https://restaurant-92819.business.site/

薄多義 義式手工披薩 (03) 657-3878
新竹縣竹北市光明一路127號
https://www.bite2eatpizza.com/

BELLINI Pasta Pasta 竹北遠百店 (03) 550-6489
新竹縣竹北市莊敬北路18號7樓 (遠百竹北)
https://www.bellinipasta.com.tw/

景點口袋名單-新竹

廢物媽媽農場 09-17
門票$200(可兌換海綿蛋糕or飲料)
0976 165 115
新竹市香山區海埔路518巷75弄85之1號

福祥仙人掌多肉植物園
03 588 3218
新竹縣新埔鎮北平里38號

美食口袋名單-台北

美食口袋名單 Google 地圖

美食口袋名單-新竹

美食口袋名單-竹縣

美食口袋名單-新竹以南

美食口袋名單-台北

貳樓敦南店 02-2700-9855
台北市大安區敦化南路二段63巷14號
https://www.secondfloorcafe.com/menu/
https://maps.app.goo.gl/WAD9ayybxzXBPYGx9

豬跳舞小餐館 02-2731-6469
台北市大安區光復南路290巷48號
https://www.facebook.com/dancingpigpig/
https://maps.app.goo.gl/meHuMkRDQ1W459Pv8

波記茶餐廳 02-8773-1913
台北市大安區延吉街70巷8號
https://www.facebook.com/bokeytea/
https://maps.app.goo.gl/DVN3tY3SBL7yzrKA8

墨墨義大利麵 02-2731-0550
台北市大安區忠孝東路三段276巷10號
https://mur-mur-pasta.business.site/
https://maps.app.goo.gl/v4NHbyrGMxZT9GEf8

美食口袋名單-新竹

美食口袋名單 Google 地圖

美食口袋名單-新竹

美食口袋名單-竹縣

美食口袋名單-新竹以南

美食口袋名單-台北

托斯卡尼尼義大利餐廳-竹科店 (03) 666-9505
新竹市新安路2-1號2樓(竹科尼尼生活館內)
http://www.toscanini.com.tw/multimedia2.html?page=4

八庵壽司割烹二館關新店 (03) 577-7707
新竹市東區關新西街69號
https://www.facebook.com/baansushihsinchu/?locale=zh_TW

貳樓新竹店 (03) 578-9222
新竹市新莊街212號
https://www.secondfloorcafe.com/%E6%96%B0%E7%AB%B9%E5%BA%97.php

TASTy西堤牛排 新竹中正店 (03) 524-5522
新竹市北區中正路178號2樓
https://www.tasty.com.tw/shop/content.php?store=13

BELLINI Pasta Pasta 新竹巨城店 (03) 533-9529
新竹市東區中央路229號7樓 (遠東巨城購物中心)
https://www.bellinipasta.com.tw/

美食口袋名單-新竹以南

美食口袋名單 Google 地圖

美食口袋名單-新竹

美食口袋名單-竹縣

美食口袋名單-新竹以南

美食口袋名單-台北

苗栗貢鍋共鍋麻辣鍋
0913 668 828
苗栗縣苗栗市建中街61巷8號
https://www.facebook.com/gonghotpot

2023-12-12

40號桌。

40號桌。

在等待慣性遲到的她抵達之前,先見到的竟是我相依為命的母親。母親在那套著縫縫補補椅套的桌前坐了下來,我問:「待會兒她來了,妳是要去樓上吃飯還是先回家?」母親眼睛咕溜溜地轉了一下,停了半晌:「我先回去好了。」登時心中五味雜陳:『我沒有趕妳回去的意思呀。』

就在母親起身時,貌似老年癡呆的感覺襲上心頭,而遠處見到她正向這裡走來。於是夢醒了,沒有見著她長得什麼模樣,臉是一團模糊的馬賽克。

『嘛,還好只是個夢』

2023-08-30

PowerShell Script to Change Public IP Address of VM on Azure

需搭配 Connect-AzAccount with Saved Encryped Credential in Powershell 實現自動化


Param (
    [String]$VMName = ''
);

if ($VMName -eq '') {
    exit;
};

Set-Location -Path ('C:\ChangeVMPublicIP');

if (Test-Path -Path (($VMName) + '.Lock')) {
    if ((Get-Date) -lt (Get-Item -Path (($VMName) + '.Lock')).LastWriteTime.AddMinutes(5)) {
        write-Host 'VM Locked';
        exit;
    };
};
$VMName | Out-File (($VMName) + '.Lock');

$CredentailFileName = 'AzCredential.txt';
$AzSubscriptionID = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';