V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  tinyint00  ›  全部回复第 1 页 / 共 1 页
回复总数  7
jenkins(打包机) + k3s (服务器) k3s 内置 traefik 怪好用的
姓名 佣金比例 佣金 时间
xxx 有限公司 0.003000 0.01 2023-05-22 17:08:28
类似这样的?
go 基本都是搭积木,看公司需求。
您这个属实是,简单问题复杂化。
2023-05-19 08:02:51 +08:00
回复了 ggp1ot2 创建的主题 程序员 VSCODE 有没有什么类似 Jupyter Notebook 类似的目录/导航插件?
vscode markdown



# your tag

```sql
CREATE TABLE `customers` (
`id` bigint NOT NULL COMMENT '客户 id 关联',
`created_at` datetime(3) NOT NULL,
`updated_at` datetime(3) NOT NULL,
`deleted_at` bigint NOT NULL DEFAULT '0',
`customer_service` bigint NOT NULL DEFAULT '0',
`customers_business_apply_id` bigint NOT NULL DEFAULT '0',
`delay_apply_id` bigint NOT NULL DEFAULT '0',
`customers_service_modify_id` bigint NOT NULL DEFAULT '0',
`company_type` varchar(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='客户基础信息';
```

快捷键是这个家伙
{
"key": "shift+cmd+o",
"command": "workbench.action.gotoSymbol"
}
这样你就能快速转跳到对应标签了
这个类似的做法,你指定用户试试 user, err := user.Lookup("you user name")

```go
c.clientCmd = exec.Command(name, args...)
// c.clientCmd.Stdin = os.Stdin
// c.clientCmd.Stdout = os.Stdout
// c.clientCmd.Stderr = os.Stderr
// c.clientCmd = exec.Command("sh")
fmt.Println(c.clientCmd.String())
var err error
user, err := user.Lookup("you user name")
if err != nil {
fmt.Println(err, "invalid user", name)
return
}

// var ids_s, _ = user.GroupIds()
// ids := make([]uint32, len(ids_s), len(ids_s))

// for k, _ := range ids_s {
// s, _ := strconv.Atoi(ids_s[k])
// ids[k] = uint32(s)
// }

// 获取用户 id
uid, err := strconv.ParseUint(user.Uid, 10, 32)
if err != nil {
fmt.Println(err)
}

// 获取用户组 id
gid, err := strconv.ParseUint(user.Gid, 10, 32)
if err != nil {
fmt.Println(err)
}
c.clientCmd.SysProcAttr = &syscall.SysProcAttr{
// Cloneflags: syscall.CLONE_NEWUTS |
// syscall.CLONE_NEWIPC |
// syscall.CLONE_NEWPID |
// syscall.CLONE_NEWNS |
// syscall.CLONE_NEWUSER |
// syscall.CLONE_NEWNET,

Pdeathsig: syscall.SIGKILL, // linux 下退出后杀死子孙进程 或者设置 {Setpgid: false}
}

//设置进程执行用户
c.clientCmd.SysProcAttr.Credential = &syscall.Credential{
Uid: uint32(uid),
Gid: uint32(gid),
}

// c.read()

time.Sleep(time.Second * 2)
fmt.Println("xxxx")
err = c.clientCmd.Start()

if err != nil {
fmt.Printf("error start: -> %s ", err.Error())
return
}

err = c.clientCmd.Wait()
if err != nil {
fmt.Printf("error wait: -> %s ", err.Error())
return
}

```
2023-04-26 08:31:10 +08:00
回复了 MasterCai 创建的主题 程序员 自建 git 服务器能否连接 github
- 每个仓库建立一个脚本分支
- 起一个服务用于定时调用
- 服务定时 `rebase` 你需要同步的分支
- 服务定时 推送 `rebase` 过来的分支到指定 git 平台

本质上就是一个定时脚本能够解决。
或者更极端点,用钩子去触发你的脚本。配置远程平台当成镜像
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   887 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 18ms · UTC 22:11 · PVG 06:11 · LAX 15:11 · JFK 18:11
Developed with CodeLauncher
♥ Do have faith in what you're doing.