Skip to content

Instantly share code, notes, and snippets.

View ZhanZiyuan's full-sized avatar
🏠
Working from home

Zhan Ziyuan ZhanZiyuan

🏠
Working from home
View GitHub Profile
@ZhanZiyuan
ZhanZiyuan / upgrade_conda.sh
Created December 30, 2023 03:12
The shell script to upgrade conda packages.
#!/bin/bash
# activate base environment
conda activate base
# activate learning environment
# conda activate learning
# inspect all conda environments
# you can also do this by using: `conda info -e`
@ZhanZiyuan
ZhanZiyuan / upgrade_ubuntu.sh
Created December 30, 2023 03:16
The shell script to check updates for Ubuntu.
#!/bin/bash
# update apt-get and update wget ca-certificates
sudo apt-get update && sudo apt-get install wget ca-certificates
# check if there are updates available for installed packages, giving a summary report
# upgrade installed packages
# [apt update and apt upgrade](https://blog.csdn.net/CSDN_duomaomao/article/details/77802673)
sudo apt update && sudo apt upgrade
@ZhanZiyuan
ZhanZiyuan / openssh_for_powershell.ps1
Created December 30, 2023 06:25
To access a remote server with OpenSSH for Windows.
ssh -o ServerAliveInterval=60 username@hostIP
@ZhanZiyuan
ZhanZiyuan / Microsoft.PowerShell_profile.ps1
Last active January 24, 2024 12:35
Oh My Posh profiles of PowerShell and Windows PowerShell.
# PowerShell
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\froczh.omp.json" | Invoke-Expression
# Windows PowerShell
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\capr4n.omp.json" | Invoke-Expression
@ZhanZiyuan
ZhanZiyuan / launch_wt_profiles.ps1
Last active March 26, 2024 14:25
Create new tabs in one instance of Windows Terminal from the command line, based on the profile names assigned.
# Launch Windows Terminal Profiles
#
# Please refer to:
# https://learn.microsoft.com/zh-cn/windows/terminal/command-line-arguments?tabs=powershell
wt.exe `
new-tab `
--profile "Windows PowerShell" `
--startingDirectory "C:\Users\user\Downloads" `
<Configuration>
<MemoryInMB>8192</MemoryInMB>
<ProtectedClient>Enable</ProtectedClient>
<MappedFolders>
<MappedFolder>
<HostFolder>D:\Sandbox</HostFolder>
<SandboxFolder>C:\Users\WDAGUtilityAccount\Downloads</SandboxFolder>
<ReadOnly>true</ReadOnly>
</MappedFolder>
</MappedFolders>

yt-dlp较高级的使用方法

  • 下载质量最好的mp4+m4a合并成mp4

    yt-dlp -f "bv[ext=mp4]+ba[ext=m4a]" --embed-metadata --merge-output-format mp4 "link"