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
@CN-CODEGOD
CN-CODEGOD / gist:8cf66aaae1b3e33cbf96782a310fe699
Created December 18, 2024 11:16
powershell 创建快捷键方式
$Destination = "$home\links\$title.lnk"
$sourcepath =$url
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Destination")
$Shortcut.TargetPath = $sourcepath
@CN-CODEGOD
CN-CODEGOD / 防火墙配置,端口开放
Last active December 29, 2024 07:00
Linux 常用命令
以下是一些常用的 Linux 命令,这些命令可以帮助你在 Linux 系统中进行文件管理、系统监控、网络配置等操作。
### 文件和目录管理
1. **`ls`** — 列出目录内容
- `ls`:列出当前目录的文件和子目录。
- `ls -l`:列出详细信息(权限、所有者、大小、修改日期等)。
- `ls -a`:显示所有文件(包括隐藏文件)。
2. **`cd`** — 改变目录
- `cd /path/to/directory`:切换到指定目录。
@CN-CODEGOD
CN-CODEGOD / gist:574cbdd8203208dafc08e3ea58b278af
Last active December 29, 2024 06:02
How to use linux in windows
1.
download WSL
2.download subsys for WSL
(ubuntu)
PS.
you can use the linux directory
cd /home
you can use linux to download system software(nginx...)
sudo install nginx
@CN-CODEGOD
CN-CODEGOD / gist:6fdd5db67953597d01a67691b4abb795
Created December 29, 2024 19:49
解决pwsh 无法使用Add-appxpackage 问题
# NOTE: If you are using PowerShell 7+, please run
# Import-Module Appx -UseWindowsPowerShell
# before using Add-AppxPackage.
@CN-CODEGOD
CN-CODEGOD / gist:635b5fafd61d3815b8927d94d1672974
Created December 30, 2024 07:35
修改本地注册表单修改右键菜单
1.添加项在路径下下
2.在项下添加icon字符串
3.在项下新建command项
4.在command项下的默认字符串添加命令
文件右键菜单:
HKEY_CLASSES_ROOT\*\shell\
文件夹右键菜单:
HKEY_CLASSES_ROOT\Directory\shell\
列出images
docker images
开启images
docker compose up -d
列出运行的docker
docker ps
打开logs
docker compose logs -f
@CN-CODEGOD
CN-CODEGOD / gist:5be19815ec81c81b48035af2cfb22337
Created December 30, 2024 17:08
powershell open filedialog
Add-Type -AssemblyName System.Windows.Forms
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ InitialDirectory = [Environment]::GetFolderPath('Desktop') }
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
#选择路径
InitialDirectory = [Environment]::GetFolderPath('Desktop')
#filter 后缀
Filter = 'Documents (*.docx)|*.docx|SpreadSheet (*.xlsx)|*.xlsx'
}
$Null = $FileBrowser.ShowDialog()
@CN-CODEGOD
CN-CODEGOD / gist:a231503b9e07e78b390b6b8bd361fa8d
Created January 3, 2025 17:57
Powershell adding key function with psreadline
$parameters = @{
# setting key for psreadline
Chord = if ($args.Count -eq 0 -or $null -eq $args[0]["Key"]) { "F7" } else { $args[0]["Key"] }
BriefDescription = 'Show Matching Command History'
Description = 'Show Matching Command History using Out-ConsoleGridView'
#setting scriptblock for psreadline
ScriptBlock = {
$params = @{ Global = $false }
if ($F7Diagnostic) { $params["Diagnostic"] = $true }
if ($F7UseNetDriver) { $params["UseNetDriver"] = $true }
@CN-CODEGOD
CN-CODEGOD / gist:cec236fd6114c49022c5f176e2bb0ac2
Created January 5, 2025 11:43
html 常用modules 导入方法
description:
因为常常写html,需要导入bootstrap,tailwind,所以写一个gist总结方法
#jQuery,cdn
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
#
bootstap ,cdn
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
#tailwind
@CN-CODEGOD
CN-CODEGOD / gist:392f6c97383d144877784a027f48d841
Created January 5, 2025 14:40
how to open shell with wt keybinding
First :adding action blocks
{
"command":
{
"action":"openNewTabDropdown",
},
"id":"user.mynewtabdropdown"
}