This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script displays the directory tree structure, color-codes files and folders, | |
# and optionally shows file sizes and hidden files. | |
# Usage: | |
# tree.sh [-a] [-s] <directory> | |
# -a Show all files including hidden files | |
# -s Show file sizes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 獲取最新版本OpenSSHUrl | |
function Get-OpenSSHAsset { | |
param ( | |
[Parameter(Position = 0, ParameterSetName = "")] | |
[ValidateSet( | |
'OpenSSH-Win32.zip', | |
'OpenSSH-Win64.zip', | |
'OpenSSH-Win32.msi', | |
'OpenSSH-Win64.msi' | |
)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@(set "0=%~f0"^)#) & set "1=%*" & setlocal enabledelayedexpansion & powershell -nop -c "iex([io.file]::ReadAllText($env:0));$Host.SetShouldExit($LastExitCode);Exit $LastExitCode" & exit /b !errorlevel! | |
Write-Host "by PSVersion::" $PSVersionTable.PSVersion | |
Write-Host "Command is '$env:0 $env:1'" | |
Exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 檢查鏈接是否有效 | |
function Test-URI { | |
param ( | |
[Parameter(Position=0, Mandatory)] | |
[string] $Uri | |
) | |
try { | |
# 嘗試發送 HEAD 請求 | |
$response = Invoke-WebRequest -Uri $Uri -Method Head -TimeoutSec 10 | |
# 檢查 HTTP 狀態碼是否為 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 格式化時間單位 | |
function FormatTimes { | |
param ( | |
[Parameter(Position = 0, ParameterSetName = "", Mandatory=$false)] | |
[double] $Time=0, | |
[Parameter(Position = 1, ParameterSetName = "", Mandatory=$false)] | |
[double] $Digit=3 | |
) | |
# 設定單位 | |
$Unit_Type = 'ms' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.reddit.com/r/edge/comments/s0dmqz/global_media_controls_missing_in_970107255 | |
# 新版本的被禁用功能了 只能從啟動參數處理了... | |
$shortcutName = "Edge_MediaControls" | |
$edgePath = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" | |
$edgeArgs = "--enable-features=GlobalMediaControls" | |
$shell = New-Object -ComObject WScript.Shell | |
$userDsk = [Environment]::GetFolderPath("Desktop") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((Get-ChildItem $env:SystemRoot\servicing\Packages)-match("(Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3)(.*?)(\.mum)|(Microsoft-Windows-GroupPolicy-ClientTools-Package~3)(.*?)(\.mum)")).FullName|ForEach-Object{dism /online /norestart /add-package:$_};gpedit.msc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; chrome version: 97.0.4692.71 | |
CLASS MACHINE | |
CATEGORY !!Google:Cat_Google | |
CATEGORY !!googlechrome | |
KEYNAME "Software\Policies\Google\Chrome" | |
CATEGORY !!GoogleCast_Category | |
POLICY !!EnableMediaRouter_Policy | |
#if version >= 4 | |
SUPPORTED !!SUPPORTED_WIN7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
2021-05-23 | |
部落格說明 https://charlottehong.blogspot.com/2021/05/cc.html | |
*/ | |
#include <iostream> | |
#include <vector> | |
#include <fstream> | |
#include <string> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
2021-05-19 | |
詳細的說明可以參考我的部落格 | |
https://charlottehong.blogspot.com/2021/05/cc.html | |
*/ | |
#pragma | |
#include <vector> | |
#include <fstream> | |
#include <string> | |
#include <string_view> |
NewerOlder