https://www.gravatar.com/avatar/ecd1e184bdf4016f24c818bde9e65b3d?s=240&d=mp
记录点滴、留住时光

代理设置大全

linux terminal下设置代理

1
2
export http_proxy="http://127.0.0.1:10809"
export https_proxy="http://127.0.0.1:10809"
系统是否有效
Openwrt 19.07
MINGW64
Ubuntu 18.04

ubuntu 18.04下apt-get设置代理

1
sudo apt-get upgrade -o Acquire::http::proxy="http://127.0.0.1:10809"

curl设置代理

1
sudo curl --proxy http://127.0.0.1:10809 -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

git设置代理

1
2
3
4
git config --global http.proxy socks://192.168.23.12:10808
git config --global https.proxy socks://192.168.23.12:10808
git config --global --unset http.proxy
git config --global --unset https.proxy

windows cmd下设置代理

使用http模式

Ipsec使用证书认证

尝试

win7客户端

  • 按文档里配置win7客户端,返回错误809,服务端错误“with unencrypted notification NO_PROPOSAL_CHOSEN”,未能解决,放弃。

  • 有人说c/s两端都在同一个局域网段是无法使用证书连接的,未验证非同网段情况

rsync技术

windows用rsysc同步到linux(ubuntu 18.04)

server端

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
root@doduo:~# cat /etc/rsyncd.conf
# sample rsyncd.conf configuration file

# GLOBAL OPTIONS

#motd file=/etc/motd
#log file=/var/log/rsyncd
# for pid file, do not use /var/run/rsync.pid if
# you are going to run rsync out of the init.d script.
# The init.d script does its own pid file handling,
# so omit the "pid file" line completely in that case.
# pid file=/var/run/rsyncd.pid
#syslog facility=daemon
#socket options=

# MODULE OPTIONS

[www]

	comment = public archive
	path = /var/www/html
	use chroot = yes
#	max connections=10
	lock file = /var/lock/rsyncd
# the default for read only is yes...
	read only = false
	list = yes
	uid = www-data
	gid = www-data
#	exclude = 
#	exclude from = 
#	include =
#	include from =
	auth users = www
	secrets file = /etc/rsyncd.secrets
	strict modes = yes
#	hosts allow = *
#	hosts deny =
	ignore errors = no
	ignore nonreadable = yes
	transfer logging = no
#	log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
	timeout = 600
	refuse options = checksum dry-run
	dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
	
	# 避免各种权限问题
	incoming chmod = Du=rwx,Dgo=rx,Fu=rwx,Fgo=rx 

client端

客户端下载安装

同步指令

1
rsync.exe  -azvP --password-file=passwd --progress public/* www@123.57.245.83::www

参考资料:

Rsync 故障排查整理

Hugo初试

安装

安装choco

1
2
Set-ExecutionPolicy Bypass -Scope Process
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

安装hugo

1
choco install hugo-extended -confirm

基本使用

创建新站

1
hugo new site hugo2

初始化git

1
2
cd hugo2
git init

安装主题Book

1
2
git submodule add https://github.com/alex-shpak/hugo-book themes/book
hugo server --minify --theme book

创建新文章

hugo new posts/hugo.md

启动服务器

hugo server -D

hugo-book主题开启KaTeX、Mermaid

1
2
3
4
# Needed for mermaid/katex shortcodes
[markup]
[markup.goldmark.renderer]
  unsafe = true

hugo-book启用中文搜索

1
2
3
4
5
6
7
languageCode = "cn"
defaultContentLanguage = 'cn'
[languages]
[languages.cn]
  languageName = 'Chinaese'
  contentDir = 'content'
  weight = 1