小编Bra*_*man的帖子

Gitlab Runner Docker 登录在连接期间无法正常工作错误:Post http://docker:2375/v1.40/auth: dial tcp: Lookup docker on 67.207.67.3:53

我在 gitlab runner 上使用 docker executor 作为我正在使用的图像,但docker:stable 收到此错误:

$ docker login gitlab.mydomain.com:5050 -u myusername-p mytoken
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
error during connect: Post http://docker:2375/v1.40/auth: dial tcp: lookup docker on 67.207.67.3:53: no such host
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
Run Code Online (Sandbox Code Playgroud)

这是我的config.toml

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "dev-env"
  url = "https://gitlab.mydomain.com/"
  token = "REDACTED"
  executor = "docker" …
Run Code Online (Sandbox Code Playgroud)

continuous-integration gitlab docker gitlab-ci cicd

11
推荐指数
2
解决办法
2万
查看次数

VSCode rust 格式保存行长度

    "rust-analyzer.checkOnSave.command": "clippy",
    "[rust]": {
        "editor.defaultFormatter": "rust-lang.rust-analyzer",
        "editor.formatOnSave": true
    },
Run Code Online (Sandbox Code Playgroud)

我在 vscode 中有这些 Rust 设置。它们对于格式化效果很好,但行长比我想要的要短。有没有办法调整最大线长度?

rust visual-studio-code

7
推荐指数
1
解决办法
3327
查看次数

为什么我的 Go 程序在浏览文件时如此慢

为什么这个程序这么慢?我认为代码已经相当优化,但在我的根文件系统上使用时,它比 find 命令花费的时间要长得多。

它大约需要 4 分钟,而 find 命令大约需要 40 秒。

我尝试删除排序算法,但并没有加快程序速度。

package main

import (
    "fmt"
    "io"
    "io/fs"
    "log"
    "os"
    "sort"
    "sync"

    "github.com/google/fscrypt/filesystem"
    "github.com/sirupsen/logrus"
    "gopkg.in/alecthomas/kingpin.v2"
)

var (
    mountpoint = kingpin.Flag("mount", "The mount to find the largest file usages. Can be a subath of mount").Required().String()
    limit      = kingpin.Flag("limit", "The maximum number of files return to the display").Default("10").Short('l').Int()
)
var device string

type fileDisplay struct {
    Size int64
    Path string
}
type bySize []fileDisplay

func (a bySize) Len() int           { return …
Run Code Online (Sandbox Code Playgroud)

go

5
推荐指数
1
解决办法
280
查看次数

电子邮件中呈现的 HTML

我正在尝试使用呈现 html 的 Exchangelib 发送电子邮件。

下面是我的电子邮件功能和正文

def send_email(account, subject, body, recipients):
    """
    >>> send_email(account, 'Subject line', 'Hello!', ['info@example.com'])
    """
    to_recipients = []
    for recipient in recipients:
        to_recipients.append(Mailbox(email_address=recipient))
    # Create message
    m = Message(account=account,
                folder=account.sent,
                subject=subject,
                body=body,
                to_recipients=to_recipients)


    m.send_and_save()


 """
<hr>
<table class=3D"x_data_table" style=3D"margin:0px auto;border-collapse:coll=
apse;width:800px;display:inline">
<thead>
<tr>
<th style=3D"border-bottom:2px solid rgb(17, 29, 51)">Item</th>
<th style=3D"border-bottom:2px solid rgb(17, 29, 51)">Created</th>
<th style=3D"border-bottom:2px solid rgb(17, 29, 51)">Created By</th>
</tr>
</thead>
<tbody>
<tr class=3D"x_odd" style=3D"background-color:rgb(245, 245, 245)">
<td class=3D"x_table_long_text" style=3D"border:1px solid rgb(191, 194, …
Run Code Online (Sandbox Code Playgroud)

email outlook python-3.x exchangelib

4
推荐指数
1
解决办法
152
查看次数

Rust 中的列表理解

在 python 中,如果我有一个像 [2, 4, 6] 这样的数组,我可以执行以下操作

old_arr = [2, 4, 6]
new_arr = [x*2 for x in old_arr]
Run Code Online (Sandbox Code Playgroud)

rust 中是否有类似的属性可以让我在返回数组之前修改它?

list-comprehension rust

1
推荐指数
1
解决办法
1550
查看次数