0%

安装

下载

官方地址
中科大源

使用 rufus 写入U盘

下载 rufus

注意选择DD镜像模式,不然U盘启动后找不到安装文件

替换镜像源

1
2
3
4
5
6
# 删除企业源
rm -rf /etc/apt/sources.list.d/pve-enterprise.list
# 添加非订阅源
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/pve/ buster pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
#添加ceph源
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-nautilus buster main " >/etc/apt/sources.list.d/pve-ceph.list
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
nano /etc/apt/sources.list

# pve6 <--> debian buster

#deb http://ftp.debian.org/debian buster main contrib
#deb http://ftp.debian.org/debian buster-updates main contrib
# security updates
#deb http://security.debian.org buster/updates main contrib

# https needs(apt install apt-transport-https -y)
deb https://mirrors.aliyun.com/debian buster main contrib non-free
deb https://mirrors.aliyun.com/debian buster-updates main contrib non-free
deb https://mirrors.aliyun.com/debian-security buster/updates main contrib non-free

# pve6 repository: pve-no-subscription
#deb http://download.proxmox.com/debian/pve buster pve-no-subscription
#deb https://mirrors.ustc.edu.cn/proxmox/debian/pve buster pve-no-subscription
deb http://download.proxmox.wiki/debian/pve buster pve-no-subscription
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 建议同时使用国内debian源
vim /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

# 更新升级
apt update && apt dist-upgrade

升级 PVE 工具

1
2
3
4
5
rm /etc/apt/sources.list.d/pve-enterprise.list
export LC_ALL=en_US.UTF-8
apt update && apt -y install git && git clone https://github.com/ivanhao/pvetools.git
cd pvetools
./pvetools.sh

安装 nodejs

1
2
3
4
5
6
# 使用的镜像为 jenkins/jenkins:lts-alpine
docker exec -it urmate_jenkins bash
apk update
apk search nodejs
apk add nodejs
apk add npm

安装阿里镜像

1
npm install -g cnpm --registry=https://registry.npm.taobao.org

安装 Hexo

1
npm install hexo-cli -g

提交修改

1
docker commit -a "Bin" -m "add nodejs" urmate_jenkins jenkins/jenkins

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

使用到的命令: VBoxManage

1
2
3
4
rem 语法
VBoxManage.exe startvm (uuid)|(name) [--type |gui|sdl|headless]
rem windows 中的启动样例 (headless - 后台启动,不显示窗口)
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm "CentOS7" --type headless

将后台启动命令写入一个新建的 bat 执行文件后,放入以下目录

1
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

VBoxManage 的其他用法

1
2
3
4
rem 查看目前在运行的 vm
"C:\Users\qianb>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list runningvms
rem 如果有运行中的 vm,会看到以下类似信息
"CentOS7" {beee421b-bdf8-4593-9035-5689a8699fca}

下载 Gitea

创建用户

1
2
3
4
5
6
# 创建账户
net user git /add /expires:never /active:yes
# 设置密码永不过期
wmic UserAccount where "name='git'" set PasswordExpires=False
# 添加到管理组
net localgroup administrators git /add

创建本地服务

使用 cnpm 的淘宝镜像

1
2
3
npm install -g cnpm --registry=https://registry.npm.taobao.org
# 安装成功后查看 cnpm 版本信息
cnpm -v

更换 npm 的镜像源

单次使用

1
npm install --registry=https://registry.npm.taobao.org

永久使用

1
2
3
4
5
6
7
8
9
10
# 打开 .npmrc, 路径 nodejs\node_modules\npm\npmrc,没有的话创建之
# 增加一行 registry=https://registry.npm.taobao.org
# 或者输入一下命令进行设置
npm config set registry https://registry.npm.taobao.org
# 检测是否设置成功
npm config get registry
# 或输入一下查看
npm info express
# 如想还原 npm 原仓库,再次运行一下命令
npm config set registry https://registry.npmjs.org/

使用管理员权限打开 PowerShell

1
2
3
# 开启 Administrator
net user administrator password /active:yes
# 请将 password 改为你的密码

查看 Profile 路径

1
$Profile

创建一个 Profile

1
2
New-Item -Path $Profile -Type File
# -Force 是强制创建,加上后即使已存在 Profile,也创建并覆盖原来的 Profile

使用记事本编辑 Profile

1
2
3
notepad $Profile
# Profile 里面,可以输入任何你在ps中输入的命令、函数
# (如:个性化自己的ps界面、自己常用的函数等)

方法案例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 测试 Baidu 连接,设置调用别名 trybaidu
function Test-BaiduConnection
{
Test-Connection www.baidu.com
}
Set-Alias trybaidu Test-BaiduConnection

# 编辑 hosts 文件,设置调用别名 eh
function Edit-Host
{
Start-Process notepad -Verb runas -ArgumentList "$env:windir\System32\drivers\etc\hosts" -wait
ipconfig /flushdns | Out-Null
}
Set-Alias eh Edit-Host

如遇到无法加载 ps1 文件

1
2
3
4
5
6
7
# 以管理员身份打开 PowerShell

# 查看系统执行策略状态
get-ExecutionPolicy

# 修改执行策略状态
set-executionpolicy remotesigned

进入docker

1
docker exec -it jenkins_container_name bash

设置 git 的 user name 和 email

1
2
git config --global user.name "Jenkins"
git config --global user.email "jenkins@abc.com"

创建 ssh key

1
2
3
cd /root/.ssh
ssh-keygen -t rsa -C "jenkins@abc.com"
cat id_rsa.pub

将 key 加入 github 后验证

1
2
3
4
5
ssh -T git@github.com
# 失败显示
git@github.com: Permission denied (publickey).
# 成功显示
> Hi your_userid! You've successfully authenticated, but GitHub does not provide shell access.

提交修改

1
2
3
4
5
# -a: 修改者
# -m: 注释
# contain_id: 容器id或名称
# image_name: 新的镜像名称(后面可加:tag)
docker commit -a "Bin" -m "add git" contain_id image_name

©

This is an H1

This is an H2

This is an H1

This is an H2

This is an H6

This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

This is the first level of quoting.

This is nested blockquote.

Back to the first level.

This is a header.

  1. This is the first list item.
  2. This is the second list item.

Here’s some example code:

return shell_exec("echo $input | $markdown_script");
test

test

  • Red
  • Green
  • Blue
  • Red
  • Green
  • Blue

Use the printf() function.

There is a literal backtick (`) here.

single underscores

double asterisks