Kinboy's note

前端漫记


  • Home

  • About

  • Tags

  • Categories

  • Archives

  • Top

  • Search

使用vimdiff作为git mergetool

Posted on 2018-10-09 | In Git |
Words count in article: 620 | Reading time ≈ 2

译自:Use vimdiff as git mergetool

使用vimdiff作为 git mergetool 可能有点难以理解,因为它会打开多个窗口,只有极少的说明。本篇是一个简单的练习,介绍 vimdiff 的基本使用方法以及什么是 LOCAL , BASE ,和 REMOTE 。这篇教程默认你至少具备了一点基础的 vim 知识(如何移动光标,保存,窗口切换)。如果你还不具备这些知识,这里有一篇短文可以帮助到你: Using vim for writing code。显然,对git和分支的基本理解也是必须的。

Read more »

单页面应用与服务器

Posted on 2018-09-28 | In 翻译 , FE , HTTP |
Words count in article: 2.6k | Reading time ≈ 16

原文:Single-Page Applications and the Server

SPAs minimize server requests, but they aren’t server-less

Single-page applications (SPAs) are distinguished from regular applications because they do not need to make server requests when the user navigates. However, the application still needs a server to provide the initial files for the application to render. Demystifying Single-Page Applications covers the client-side aspect of how this works and here we will cover how different types of servers can support single-page applications.

Read more »

浏览器的history

Posted on 2018-09-25 | In 翻译 , FE , History |
Words count in article: 4.3k | Reading time ≈ 21

原文: A little bit of history

If you wish to understand React Router, you must first study history. More specifically, the history package, which provides the core functionality for React Router. It enables projects to easily add location based navigation on the client-side, which is essential for single page applications.

如果你想要理解 React Router,那你必须先学习 history。具体来说,是 history 包,它提供了 React Router 的核心功能。它允许项目轻松的在客户端添加基于位置(location)的导航,这对但页面应用来说是至关重要的。

Read more »

CentOS 7.4 配置路由网关服务器

Posted on 2018-09-07 | In Linux , Network |
Words count in article: 180 | Reading time ≈ 1

Linux具有内核级的路由表,默认是没有启用转发功能的,添加网卡的IP转发功能

1
2
3
sudo vim /etc/sysctl.conf
#添加如下行
net.ipv4.ip_forward = 1

重载网络配置,使生效

1
sudo sysctl -p

开启public区域ip伪装

1
sudo firewall-cmd --permanent --zone=public --add-masquerade

开启public区域ip端转发

1
sudo firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=192.168.12.0/24 masquerade'

上面命令中192.168.12.0/24 IP段包含了路由器IP:192.168.12.252,这样设置会导致CentOS与路由器的通信被转发,VPN断开连接,这里只需要指定我们需要的一部分网段就可以了。

重新加载防火墙配置

1
sudo firewall-cmd --reload

CentOS7.4搭建L2TP/IPSec VPN Client

Posted on 2018-09-07 | In Linux |
Words count in article: 993 | Reading time ≈ 5

安装ipsec和l2tp协议工具

1
sudo yum install libreswan xl2tpd

配置文件

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
# /etc/ipsec.d/work.conf

config setup
keep-alive=300

conn Work
authby=secret
pfs=yes
auto=add
keyingtries=%forever
dpddelay=30
dpdtimeout=120
dpdaction=restart
rekey=yes
rekeymargin=1h
ikelifetime=8h
keylife=1h
type=transport
left=%defaultroute
leftprotoport=udp/l2tp
right=civnet.vicp.net
rightprotoport=udp/l2tp
ike=aes_ctr,aes_cbc,camellia_cbc,serpent_cbc,twofish_cbc,3des,3DES-SHA1;MODP1024
phase2alg=aes-HMAC_SHA1,3DES-HMAC_SHA1
sha2-truncbug=yes
Read more »

浏览器缓存策略交互——maxAge 与 maxStale

Posted on 2018-08-18 | In 翻译 , FE , Cache Policy |
Words count in article: 883 | Reading time ≈ 4

原文:Cache Policy Interaction—Maximum Age and Maximum Staleness

To help ensure that the freshest content is returned to the client application, the interaction of client cache policy and server revalidation requirements always results in the most conservative cache policy. All the examples in this topic illustrate the cache policy for a resource that is cached on January 1 and expires on January 4.

为确保客户端应用程序能够被返回最新的内容,客户端缓存策略与服务端验证的交互总是产生最保守的缓存策略。这个话题中的所有示例都是说明一个1月1日被缓存,并在1月4日到期的资源的缓存策略。

Read more »

Symbolic Links|符号链接

Posted on 2018-08-10 | In 翻译 , 工具 , Git |
Words count in article: 746 | Reading time ≈ 3

原文:Symbolic links

Short version: there is no exact equivalent for POSIX symlinks on Windows, and the closest thing is unavailable for non-admins by default. Therefore, symlink emulation support is switched off by default and needs to be configured by you, the user, via the core.symlinks=true config setting.

简介:Windows平台上没有与POSIX的symlinks完全对等的对象,最接近的一种类型(symbolic link)默认对非管理员用户是不可用的。所以,在安装Git-windows的时候默认关闭了支持 symlink 的选项,需要用户通过设置 core.symlinks=true 配置项来手动配置。

Read more »

Gitlab Docker容器中SSH端口失效问题

Posted on 2018-08-06 | In Linux |
Words count in article: 284 | Reading time ≈ 1

在Gitlab配置文件/srv/gitlab/config/gitlab.rb中,将SSH协议的端口设置为8822了,但是在一些情况下会出现用SSH协议的Url执行网络同步操作时提示"访问被拒,可能是权限问题" 。

例如在我在服务器上sudo docker rm gitlab 之后再重新 sudo docker run之后就会重现以上问题。

排查过程如下:

SSH连接远程连接到12.1服务器,查看SSH进程的运行状态

1
sudo ps -aux | gerp sshd

得到如下图所示输出

Read more »

使用 Docker 搭建私有NPM仓库

Posted on 2018-08-03 | In FE , 工程化 |
Words count in article: 378 | Reading time ≈ 1

关于 Docker 的使用不在本文之中,请自行参考其他文档。

经过测试, keyvanfatehi/sinopia 可用。

  1. 将 docker image 拉下来
1
docker pull keyvanfatehi/sinopia
  1. 将 keyvanfatehi/sinopia 跑起来
1
docker run --name sinopia -d -p 4873:4873 keyvanfatehi/sinopia

docker运行在代码服务器上,此时通过 http://192.168.12.1:4873 可以访问私有NPM 仓库网页。

Read more »

用vim写代码

Posted on 2018-07-26 | In 工具 , Vim |
Words count in article: 653 | Reading time ≈ 4

Vim is a great text editor which can be much more powerful then any GUI editor or IDE. It has its learning curve, but once you are used to it you’ll never want to switch to anything else. Here’s a quick tutorial on how to use and customize vim for working with code.

Read more »
1…567
kinboy

kinboy

66 posts
31 categories
52 tags
RSS
GitHub E-Mail
0%
© 2019 kinboy

鄂公网安备 42011102002861号