Chrome,按
Github help有专门的资料。
需要注意的是404页面自定义,必须有顶级域名,并且该域名已经解析到了Github pages,例如username.github.io。
具体步骤是在Github网站仓库中新建一个404.html,或者404.md文件。然后对该404文件进行YAML front matter,YAML前标记也就是在文件的开头按照固定格式为预定义或自定义变量赋值。
$ cd wisetc.github.io
$ curl baidu.com| sed -e '1i\---' -e $'1i\permalink: /404.html' -e '1i\---' > 404.html
$ sed -i 's/baidu/uqugu/g; 5s/0/5/g' 404.html
$ cat 404.html
$ sed -i '5a\没有找到您要访问的页面,请通过www网址访问此页,5秒钟后将跳转回首页。' 404.html
$
$ git add 404.html
$ git commit -m '404 custom'
$ git push
修改后的404.h
首先什么是Github pages?
引用一句话:
Hosted directly from your GitHub repository. Just edit, push, and your changes are live.
大概是说Github pages是Github提供给开发者、组织和项目的网站主机,这个网站直接由你的github仓库发布运行,你只需要编辑、推送你的代码就行,你对代码的更改会实时的体现在网站的页面中。
那么为什么要说到Github pages的A记录解析功能,它到底解决了什么,在说Github pages A记录解析之前,先说说这次万网域名解析上遇到的一个冲突。
是这样的,为了正常收信,注册的企业邮箱(域名邮箱的一种)需要对邮箱服务器域名进行MX解析,要求主机记录为@,只不过@已经被CNAME解析到http服务器,要进行MX解析,CNAME死活不答应。只能二选一,经过一番沉痛的取舍,决定要保留企业邮箱。那么就是要舍弃CNAME咯,可是不想舍弃,更不能舍弃,因为百度收录的入口就是不带www的主页,郁闷,舍弃后就不能通过百度入口访问本站点。
于是
有些文件由于访问者不是所有者本身,所以即便是管理员也不能删除或重命名这种文件,这时就需要修改文件的权限和所有者。而通过文件属性中的安全设置文件的所有者比较麻烦,通过命令比较快捷易行。这里主要用到 icacls
这个程序,因为记不住,所以记录一下。
例如修改所有者为 system 的文件 test.dll 的所有者为 administrator:
> icacls test.dll /setowner administrator
sed是linux下的一种文本流编辑器。
sed - stream editor for filtering and transforming text. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).
sed和vim的命令有着相似之处,例如删除d,插入i,增加a,匹配/regexp/,替换s/regexp/replacement/等。
一般来说sed有着如下经常用法。
假设文件名为test.txt
$ cat <<EOF >test.txt
> Can you feel my warm?
> How about having dinner with me?
> How am supposed to live without you?
> How many times you stand up for youself.
> EOF
$ grep