Skip to content

Instantly share code, notes, and snippets.

View CN-CODEGOD's full-sized avatar
😏
share my thought

CN-CODEGOD

😏
share my thought
View GitHub Profile
按下 Win + R 键打开运行对话框,输入 taskschd.msc,然后按回车。
在任务计划程序中点击“创建基本任务...”或“创建任务...”。
输入任务的名称和描述,选择触发任务的条件。
设置触发器信息,如特定时间、登录时等。
设置操作,例如运行某个程序。
查看设定好的任务。
基本命令
oh-my-posh init pwsh --config $env:homedir\theme3.json|Invoke-Expression
模板一:添加文字
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"final_space": true,
"version": 3,
"blocks": [
{
@CN-CODEGOD
CN-CODEGOD / gist:f4317bd634bdd5acf42ba5780a22b733
Created March 16, 2025 09:21
如何在powershell 上传个人模组
1.register
Register-PSRepository -Name "PSGallery" -SourceLocation "https://www.powershellgallery.com/api/v2"
2.获取API
访问 PowerShell Gallery 网站。https://www.powershellgallery.com/
点击 "Sign in" 并使用 Microsoft 账号登录。
进入 "API Keys" 页面,创建一个新的 API Key(建议权限为 Push-Only 以提高安全性)。
复制 API Key,稍后会用到。
3.在模组中创建psd 包含作者名字,描述,模组名字
New-ModuleManifest -Path .\console.psd1 -Description "console grid using out-consolegridview for series occasion" -Author 'cn_codegod' -ModuleVersion "1.0" -RequiredModules "Microsoft.PowerShell.ConsoleGuiTools"
大部分主流压缩都支持分卷压缩了,常见的格式有:7z、ace、alz、bz2、gz、mou、rar、bz2、zip、zipx等。但不是所有支持上述格式的软件都支持分卷有很多是不支持分卷的,但是官方的软件都可以完美的支持自己格式的分卷,比如:7-Zip支持7z分卷,winace支持ace分卷,alzip支持alz分卷,winmount支持mou分卷,winrar支持rar分卷,winzip支持zip zipx分卷。
winrar默认 RAR 卷以‘volname.partNNN.rar’格式命名,NNN的位置是卷号。使用 -vn 开关 可以转换成其它的扩展基本命名规则,卷组中第一分卷文件的扩展名是 .rar,以后卷从 .r00 到 .r99 命名。
7z格式分卷命名是从第一个以*.001开始,第二个是*.002,以此类推。
mou格式命名,第一卷是*.part01.mou,第二卷是**.part02.mou,以此类推。
卷也可以是 固实 和 自解压格式。第一个自解压卷有不同的文件扩展名,例如对于DOS 自解压卷是 .exe。
$installpath=[System.IO.PATH]::combine("$env:onedrive","example_folder") 连接路径和文件名
$installpath=[System.IO.PATH]::GetDirectoryName($path) 获取文件夹路径
@CN-CODEGOD
CN-CODEGOD / gist:0fffa68d4e282f9bb177a9f4b0a9e9b1
Created January 27, 2025 02:37
wallpaperEngine 命令行
wallpaper32.exe -control pause
wallpaper32.exe -control openWallpaper -file "C:\Program Files (x86)\Steam\steamapps\common\wallpaper_engine\projects\myprojects\myWallpaper\project.json"
wallpaper32.exe
-control pause
-control stop
-control play
-control mute
-control unmute
@CN-CODEGOD
CN-CODEGOD / gist:e143247861647189a116cc526b14a088
Created January 13, 2025 02:59
Powershell public import for module
foreach ($file in Get-ChildItem "Private", "Public") {
. $file.FullName
}
@CN-CODEGOD
CN-CODEGOD / gist:d293c7a0ce16a395456d1923d08654a5
Created January 12, 2025 04:27
powershell 判断路径是文件夹或文件
$param=$home
PS> (Get-Item $param -isnot [System.IO.DirectoryInfo])
false
PS> (Get-Item $param -is [System.IO.DirectoryInfo])
true
@CN-CODEGOD
CN-CODEGOD / gist:2e351838a5e172af4be7b40ba8fda81e
Created January 11, 2025 17:46
Powershell 文本转换规则
文本加上双引号
$Shortcut.Arguments = "-control openWallpaper -file `"$path`""
-join
@CN-CODEGOD
CN-CODEGOD / gist:1c3da46346d3c4f89245db8bf6a9f358
Created January 11, 2025 10:11
解决 Ubuntu Firefox 中文乱码
尝试用浏览器打开,
在文字编码 或者 Text Encoding 中,
更换编码格式不能选择,除了Unicode选中,其他都无法点击。
解决方案(从网上获取):
第一种方式
1.安装wqy-zenhei字体
apt-get install ttf-wqy-zenhei
2.修改系统字体配置文件/etc/fonts/conf.d/49-sansserif.conf
打开/etc/fonts/conf.d/49-sansserif.conf这个文件: