Skip to content

Instantly share code, notes, and snippets.

View dvsseed's full-sized avatar
💭
I may be slow to respond.

曾令燊 dvsseed

💭
I may be slow to respond.
View GitHub Profile
@dvsseed
dvsseed / enhanced_recorder.py
Created August 21, 2025 08:39
Enhanced Screen and Input Recorder
import cv2
import numpy as np
import mss
from pynput import mouse, keyboard
import threading
import time
from datetime import datetime
import ctypes
import ctypes.wintypes
import re
@dvsseed
dvsseed / SystemReport.ps1
Created June 8, 2025 09:25
A PowerShell script that generates a system resource report in Excel (.xlsx) and CSV (.csv) formats, and displays the contents in the PowerShell console. It collects process information (Name, CPU, Memory in MB), exports it to an Excel file with a formatted table and a column chart, and saves a CSV backup. The script also reads and displays the …
# 檢查是否已載入 ImportExcel 模組,若無則嘗試載入
if (-not (Get-Module -Name ImportExcel -ListAvailable)) {
Write-Host "ImportExcel module not found. Please install it using: Install-Module -Name ImportExcel -Scope CurrentUser"
exit
}
Import-Module ImportExcel
# 動態獲取當前使用者的桌面路徑,確保腳本在不同環境下可移植
$desktopPath = [System.Environment]::GetFolderPath("Desktop")
$reportPath = Join-Path $desktopPath "SystemReport_$(Get-Date -Format yyyyMMdd).xlsx"
@dvsseed
dvsseed / Monitor-DHCP.ps1
Created May 24, 2025 14:19
PowerShell Script: Automated DHCP Monitoring with Non-TLS SMTP Notifications
# PowerShell 腳本:監控 DHCP 服務並透過非 TLS SMTP 發送電子郵件通知
# 適用於 Microsoft Server 2022,範圍 10.10.10.0/24
# 參數設定
$ComputerName = "YourDHCPServer" # DHCP 伺服器名稱或 IP,請替換為實際值
$ScopeId = "10.10.10.0" # DHCP 範圍(Scope)ID
$UsageThreshold = 80 # IP 佔用率閾值(百分比)
$SmtpServer = "smtp.yourcompany.com" # SMTP 伺服器地址,請替換為實際值
$SmtpPort = 25 # SMTP 埠(非 TLS,標準埠 25)
$FromEmail = "[email protected]" # 發件人郵件地址,請替換
@dvsseed
dvsseed / fastCopy.ps1
Created April 26, 2025 12:17
fastCopy.ps1 - A PowerShell script for efficient file backups using Robocopy. Copies files from a source to a destination directory with multi-threaded performance, retry logic, and detailed UTF-8 BOM encoded logging. Includes success/error feedback and timestamped logs for easy tracking.
# Set source and destination folders
$src = "D:\sourceFiles"
$dst = "D:\destinationDirectory"
# Set log directory
$logDir = "C:\Logs"
if (!(Test-Path $logDir)) {
New-Item -ItemType Directory -Path $logDir | Out-Null
}
@dvsseed
dvsseed / generate_windows_commands_csv.py
Created April 13, 2025 11:30
A Python script to export a CSV file with common Windows commands and their descriptions — great for IT and sysadmin reference.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
產生 Windows 常用指令清單的 CSV 檔案
Author: ChatGPT
Date: 2025-04-13
Description:
將常用的 Windows 指令及其功能輸出為 UTF-8 編碼的 CSV 檔案。
"""
@dvsseed
dvsseed / network_scanner.py
Created April 1, 2025 14:21
Network Scanner with Topology Visualization
import socket
import subprocess
import concurrent.futures
import platform
import asyncio
import logging
import json
import re
import matplotlib.pyplot as plt
from scapy.all import ARP, Ether, srp, conf
@dvsseed
dvsseed / ArchiveSyslogByYear.ps1
Created March 31, 2025 06:53
A PowerShell script to archive .gz syslog files (e.g., 10.10.10.84.log-20250115.gz) into quarterly folders based on the year and IP address. The script organizes files into folders named by the first Friday of each quarter (e.g., 2025-01-03) and creates IP-based subfolders (e.g., 2025-01-03\10.10.10.84). Supports both the current year (default) …
# 指定年份: .\archive_year.ps1 -Year "2024"
param (
[string]$Year = (Get-Date -Format "yyyy") # 預設為當前年份
)
# 定義來源資料夾路徑為當前目錄
$sourcePath = "."
# 使用參數指定的年份或預設年份
@dvsseed
dvsseed / LINE_AutoLogin.ahk
Created March 25, 2025 10:16
AutoHotkey Script for Automating LINE Login on Windows This AutoHotkey script automates the login process for LINE (version 9.7.0.3556) on Windows 11 Pro 23H2. It launches LINE, switches to English input method, dynamically calculates the password input field position, enters the password, and logs in automatically. The script is designed to ada…
#Requires AutoHotkey v2.0
#NoTrayIcon
#WinActivateForce
; 檢查管理員權限
if !A_IsAdmin {
Run '*RunAs "' A_ScriptFullPath '"'
ExitApp
}
@dvsseed
dvsseed / midi_composition_pipeline.py
Last active March 10, 2025 13:01
Python script to generate multi-track MIDI music with melody/chords, export to PDF sheet music via MuseScore, and convert to WAV audio using FluidSynth & SoundFonts
"""
MIDI Music Generation Pipeline
- Creates multi-instrument MIDI composition
- Exports to PDF sheet music using MuseScore
- Converts to audio WAV using FluidSynth
Requires: music21, MuseScore 4, FluidSynth, and GeneralUser GS SoundFont
"""
from music21 import *
import os
@dvsseed
dvsseed / network_security_scanner.py
Created March 8, 2025 05:40
🔍 Python network scanner for detecting active IPs and open ports (1-1024) in a local subnet. Features: Identifies risky ports (21/FTP, 23/Telnet, 445/SMB, etc.) Highlights local machine IP Multi-threaded scanning with configurable network range Generates security warnings for high-risk exposures Includes ping-based host discovery Ideal for basic…
import socket
import subprocess
from datetime import datetime
from concurrent.futures import ThreadPoolExecutor
# 定義風險端口列表
risky_ports = [21, 23, 139, 445, 3389, 6667, 1080, 8080] # 可根據需求調整
# 獲取本機 IP 地址
def get_local_ip():