0%

install git

1
yum install git

check

1
git --version

git version 1.8.3.1

server side

1
2
3
cd /home
mkdir myrepo
git init --bare /home/myrepo/gs.git

client side

git clone root@blog.guoshuang.com:/home/myrepo/gs.git

git add .

git commit -m ‘hi,test’
git push

hooks

cd hooks

创建post-receive文件

vim post-receive

输入以下内容

1
2
#!/bin/bash
git --work-tree=/home/guoshuang/nginx/html/blog checkout -f
1
chmod +x post-receive

-https://juejin.im/post/5c7e4e43f265da2d980923a6
-https://www.digitalocean.com/community/tutorials/how-to-create-a-blog-with-hexo-on-ubuntu-14-04

Package ControlUnable to download Sass. Please view the console for more details.

删除包控制器,然后重装。

deleted the ~/.config/sublime-text-3/Packages/Package Control folder and the
~/.config/sublime-text-3/Installed Packages/Package Control.sublime-package file and reinstalled the package manager. Now it’s working again.

重装

https://packagecontrol.io/installation#st2

via

https://upcloud.com/community/tutorials/wordpress-with-docker/

图形界面 配置网络 dhcp

1
nmtui
1
yum update && yum upgrade
1
2
systemctl start httpd.service
# systemctl enable httpd.service
1
2
3
firewall-cmd --permanent --add-service=http
# systemctl restart firewalld
systemctl restart httpd.service

sudo systemctl stop firewalld

or

systemctl disable firewalld

aili mirrors

http://mirrors.aliyun.com/centos/7/isos/x86_64/

1
2
3
4
5
6
7
8
9
10
11
sudo yum update httpd

sudo yum install httpd

sudo systemctl start httpd

sudo systemctl status httpd

sudo systemctl restart httpd

sudo systemctl enable httpd

/etc/init.d/network restart

======

sudo vi /etc/httpd/conf/httpd.conf

sudo vi /etc/httpd/sites-available/example.com.conf

<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/example.com/html
ErrorLog /var/www/example.com/log/error.log
CustomLog /var/www/example.com/log/requests.log combined

local

1
ssh-keygen -t rsa

SSH密钥会保存在home目录下的.ssh/id_rsa文件中.SSH公钥保存在.ssh/id_rsa.pub文件中

upload key 2 server

ssh-copy-id username@remote-server

反过来

server {
listen 80;
server_name blog.guoshuang.com;
charset utf-8;
location / {
root /usr/share/nginx/html/blog;
index index.html index.htm;
}
}

Check the fingerprint for the ECDSA key sent by the remote host

添加了重复的 主机

1
2
3
ssh-keygen -R <remote-system-ip-address>


用CSS给SVG 的内容添加样式

https://www.w3cplus.com/svg/styling-svg-use-content-css.html

js add style

1
2
3
4
5
6
7
8
9
10
11
12
13
var css = 'h1 { background: red; }',
head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');

head.appendChild(style);

style.type = 'text/css';
if (style.styleSheet){
// This is required for IE8 and below.
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}

Create and append style sheets to document using JavaScript

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(function() {
var css = [
'/css/default.css',
'/css/section.css',
'/css/custom.css'
],
i = 0,
link = document.createElement('link'),
head = document.getElementsByTagName('head')[0],
tmp;
link.rel = 'stylesheet';

for(; i < css.length; i++){
tmp = link.cloneNode(true);
tmp.href = css[i];
head.appendChild(tmp);
}
})();

78.141.222.176

ssh root@78.141.222.176


curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

python get-pip.py

pip install shadowsocks

vi /etc/shadowsocks.json

{
“server”:”0.0.0.0”,
“server_port”:443,
“local_port”:1080,
“password”:”1234567890”,
“timeout”:600,
“method”:”aes-256-cfb”
}

vi /etc/systemd/system/shadowsocks.service

[Unit]
Description=Shadowsocks
[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json
[Install]
WantedBy=multi-user.target

设置开机自启命令

systemctl enable shadowsocks

启动命令

systemctl start shadowsocks

#查看状态命令
systemctl status shadowsocks

firewalld(centos7)

systemctl stop firewalld

https://www.4spaces.org/centos-open-porter/

find server ip

1
ip addr

default directory

1
/usr/share/nginx/html

global configuration

1
/etc/nginx/nginx.conf

ss install

默认有防火墙,需要关闭

virtual host

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
server {
listen 80;
listen [::]:80;

root /guoshuang/demo;

index index.html;

server_name demo.guoshuang.com;

access_log /var/log/nginx/demo.guoshuang.com.access.log;
error_log /var/log/nginx/demo.guoshuang.com.error.log;

location / {
try_files $uri $uri/ =404;
}
}

css

flex 排版

bootstrap

svg

1
2
3
4
<svg viewbox="0 0 10 50">
<path d="M1 49 V5 Q1 1 5 1 H9 V49z"
fill="rgba(255, 122, 0, 0.8)" />
</svg>

d3

-d3 tooltips

测试

Integrity

1
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">

生成 (1.js)Integrity

1
openssl dgst -sha384 -binary 1.js | openssl base64 -A