Skip to content

Instantly share code, notes, and snippets.

Winget 使用代理

命令行参数(单次使用) 1.开启配置(需要管理员权限)

winget settings --enable ProxyCommandLineOptions 2.使用

winget install Git.Git --proxy http://127.0.0.1:10809 使用管理员配置(不需要每次输入)

@gudezhi
gudezhi / readmeai.md
Last active November 25, 2024 04:47
ReadmeAI
@gudezhi
gudezhi / VPS安装Docker.md
Last active December 6, 2023 15:21
docker操作相关

VPS安装Docker

在VPS上安装Docker,可以参考官方文档

确认 VPS 的操作系统

  1. 登录到您的 VPS: 使用 SSH 连接到您的 VPS。您可能需要 VPS 提供的 IP 地址和登录凭证。通常使用以下命令:
@gudezhi
gudezhi / 备份数据库.md
Last active December 8, 2023 07:51
clickhouse操作相关

当然,您可以使用 docker cp 命令来在 Docker 容器和宿主机之间复制文件,而不需要重启您的 Docker 容器。这是一个简单有效的方法来备份和恢复数据。首先,确保在宿主机和 Docker 容器内都创建了相应的备份目录。

创建备份目录

  1. 在宿主机上创建备份目录

    mkdir -p ~/clickhouse_backup
@gudezhi
gudezhi / treeForPowershell.ps
Created December 2, 2023 15:54
[object Object]
function Show-Tree {
param(
[string]$RootPath,
[string[]]$ExcludeFolders
)
$indentation = " "
$folderStack = New-Object 'string[]' 100 # 增加数组的初始大小
function Print-Line($line, $depth) {
@gudezhi
gudezhi / sql操作.md
Last active November 23, 2023 13:53
PostgreSQL相关

访问Docker下的PostgreSQL

  1. Identify the Container: First, identify the name or ID of your PostgreSQL Docker container. You can list all running containers using:

    docker ps
  2. Connect to the PostgreSQL Database: Use the docker exec command to start a bash shell inside the container, and then use the psql command-line tool to connect to your PostgreSQL database. For example:

要直接拉取远程服务器的最新版本并覆盖掉本地所有更改,您可以使用一系列 Git 命令来重置本地状态,使其与远程仓库同步。这些操作会丢弃所有本地未提交的更改,因此在执行之前,请确保您不需要这些本地更改。

下面是如何做到这一点的步骤:

1. 切换到目标分支

首先,切换到您想要同步的分支。例如,如果您想要同步 main 分支:

git checkout main
@gudezhi
gudezhi / today.AppleScript
Created September 17, 2019 05:23 — forked from kemitchell/today.AppleScript
Short AppleScript for dumping descriptions of today's events from iCal to the console. Meant for use with GeekTool.
#!/usr/bin/osascript
-- calendar from which to ignore events
set TASKS_CALENDAR to "Toodledo iCal"
-- the current timestamp
set now to (current date)
-- midnight this morning
set today to now - (time of now)
-- midnight tomorrow morning
set tomorrow to (today) + (24 * 60 * 60)
-- list of output lines
function getSimilarColors (color, nombre) {
var base_colors = [{ "ncs" : "S 0300-N", "R" : "255" , "G" : "255" , "B" : "255"},{ "ncs" : "S 0500-N", "R" : "252" , "G" : "252" , "B" : "251"},{ "ncs" : "S 1000-N", "R" : "242" , "G" : "242" , "B" : "240"},{ "ncs" : "S 1500-N", "R" : "224" , "G" : "223" , "B" : "222"},{ "ncs" : "S 2000-N", "R" : "216" , "G" : "216" , "B" : "215"},{ "ncs" : "S 2500-N", "R" : "206" , "G" : "205" , "B" : "204"},{ "ncs" : "S 3000-N", "R" : "192" , "G" : "191" , "B" : "190"},{ "ncs" : "S 3500-N", "R" : "176" , "G" : "176" , "B" : "175"},{ "ncs" : "S 4000-N", "R" : "165" , "G" : "165" , "B" : "164"},{ "ncs" : "S 4500-N", "R" : "151" , "G" : "151" , "B" : "150"},{ "ncs" : "S 5000-N", "R" : "142" , "G" : "142" , "B" : "141"},{ "ncs" : "S 5500-N", "R" : "133" , "G" : "133" , "B" : "131"},{ "ncs" : "S 6000-N", "R" : "122" , "G" : "121" , "B" : "119"},{ "ncs" : "S 6500-N", "R" : "109" , "G" : "109" , "B" : "107"},{ "ncs" : "S 7000-N", "R" : "96" , "G" : "96" , "B" : "94"},{ "ncs" : "S 75
var Canvas2Image=function(){var $support=function(){var canvas=document.createElement('canvas'),ctx=canvas.getContext('2d');return{canvas:!!ctx,imageData:!!ctx.getImageData,dataURL:!!canvas.toDataURL,btoa:!!window.btoa}}();var downloadMime='image/octet-stream';function scaleCanvas(canvas,width,height){var w=canvas.width,h=canvas.height;if(width==undefined){width=w}if(height==undefined){height=h}var retCanvas=document.createElement('canvas');var retCtx=retCanvas.getContext('2d');retCanvas.width=width;retCanvas.height=height;retCtx.drawImage(canvas,0,0,w,h,0,0,width,height);return retCanvas}function getDataURL(canvas,type,width,height){canvas=scaleCanvas(canvas,width,height);return canvas.toDataURL(type)}function saveFile(strData){document.location.href=strData}function genImage(strData){var img=document.createElement('img');img.src=strData;return img}function fixType(type){type=type.toLowerCase().replace(/jpg/i,'jpeg');var r=type.match(/png|jpeg|bmp|gif/)[0];return'image/'+r}function encodeData(data){if(!windo