├── themes └── demons-ladder │ ├── static │ ├── css │ │ ├── custom.css │ │ ├── highlight_railscasts.css │ │ ├── sanitize.css │ │ ├── responsive.css │ │ ├── theme.css │ │ └── theme.less │ ├── images │ │ └── head.jpg │ └── js │ │ └── highlight.pack.js │ ├── .gitignore │ ├── layouts │ ├── index │ │ ├── index2.html │ │ ├── index1.html │ │ └── post.html │ ├── _default │ │ ├── single2.html │ │ └── single.html │ └── partials │ │ ├── disqus.html │ │ ├── footer.html │ │ └── header.html │ └── LICENSE.md ├── modules ├── time.sh ├── get_config.sh ├── get_meta.sh ├── get_page_meta.sh ├── sort.sh ├── gen_post.sh ├── gen_page.sh └── gen.sh ├── content ├── post │ ├── birthday.md │ ├── move-to-hexo.md │ ├── blog-reborn.md │ ├── mirror.md │ ├── domain-changed.md │ ├── move-to-hugo.md │ ├── neovim.md │ ├── 0bin.md │ ├── new-image-host.md │ ├── oh-my-termux.md │ ├── vimrc.md │ ├── google-mirror.md │ ├── ss-speedup.md │ ├── hack-a-dprk-server.md │ ├── storage-space-running-out.md │ ├── certificate-transparency.md │ ├── net-speeder.md │ ├── vps2arch.md │ ├── lets-encrypt.md │ ├── sign.md │ ├── linux-deploy.md │ ├── port-forwarding.md │ ├── sslh.md │ ├── ss.md │ └── h2o.md └── page │ ├── about.md │ └── friends.md ├── config.toml ├── balog.sh └── libs └── markdown.sh /themes/demons-ladder/static/css/custom.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/demons-ladder/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /themes/demons-ladder/layouts/index/index2.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /themes/demons-ladder/layouts/_default/single2.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /themes/demons-ladder/static/images/head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4679/balog/HEAD/themes/demons-ladder/static/images/head.jpg -------------------------------------------------------------------------------- /themes/demons-ladder/layouts/index/index1.html: -------------------------------------------------------------------------------- 1 |
2 |

Recent Articles

3 | -------------------------------------------------------------------------------- /modules/time.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | timestamp() { 4 | echo $(date -d "$1" +%s) 5 | } 6 | 7 | format_date() { 8 | echo $(date -d "$1" +"$(get_config dateFormat)") 9 | } 10 | -------------------------------------------------------------------------------- /modules/get_config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | get_config() { 4 | local config=${1} 5 | cat $work_dir/config.toml | grep "$config = \"" | head -n 1 |awk -F " = " '{print $2}' | sed 's/"//' | sed 's/"*$//' 6 | } 7 | -------------------------------------------------------------------------------- /themes/demons-ladder/layouts/index/post.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ .Title }}

3 |
4 | {{ .Date }}   5 |
6 |
7 | -------------------------------------------------------------------------------- /modules/get_meta.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | get_meta() { 4 | local meta_file_name=${1} 5 | local meta=${2} 6 | cat $content_path/post/$meta_file_name.md | grep "$meta = \"" | head -n 1 | awk -F " = " '{print $2}' | sed 's/"//' | sed 's/"*$//' 7 | } 8 | -------------------------------------------------------------------------------- /modules/get_page_meta.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | get_page_meta() { 4 | local meta_page_name=${1} 5 | local page_meta=${2} 6 | cat $content_path/page/$meta_page_name.md | grep "$page_meta = \"" | head -n 1 | awk -F " = " '{print $2}' | sed 's/"//' | sed 's/"*$//' 7 | } 8 | -------------------------------------------------------------------------------- /content/post/birthday.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-02T00:12:01+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "birthday" 10 | tags = ["me"] 11 | title = "祝自己生日快乐" 12 | 13 | +++ 14 | 就十七岁了 时间过得真快 15 | -------------------------------------------------------------------------------- /content/post/move-to-hexo.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-11-06T00:55:31+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "move-to-hexo" 10 | tags = ["blog"] 11 | title = "转投到Hexo" 12 | 13 | +++ 14 | 迁移到了Hexo 感觉不错 15 | 16 | -------------------------------------------------------------------------------- /content/page/about.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-12-21T12:30:14+08:00" 3 | draft = false 4 | slug = "about" 5 | title = "关于我" 6 | hidden = true 7 | +++ 8 | - 高三学渣 9 | - Archlinux用户 [AUR](https://aur.archlinux.org/account/4679kun/) 10 | - [微博](http://weibo.cn/u/1963942417) 11 | - 邮箱 4679kun@outlook.com -------------------------------------------------------------------------------- /content/post/blog-reborn.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-01-26T19:28:45+08:00" 3 | draft = false 4 | slug = "blog-reborn" 5 | tags = ["blog"] 6 | title = "博客复活了" 7 | 8 | +++ 9 | 前几天上VPS 发现我Hugo的文件夹不见了 10 | 11 | 当时我就懵逼了 还好文章的源文件都在github 12 | 13 | 于是在和拖延症搏斗了几天后 就有了你们现在看到的这个博客 14 | 15 | 顺便换了个主题 因为之前主题的配置文件一起不见了 16 | -------------------------------------------------------------------------------- /themes/demons-ladder/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | 3 |
4 |
5 |

{{ .Title }}

6 |
7 | {{ .Date }}   8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /content/post/mirror.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-09T15:56:05+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "mirror" 10 | tags = ["blog"] 11 | title = "给博客做了个镜像" 12 | 13 | +++ 14 | [--------这里--------](https://borderland.me) 15 | 16 | 放在github 速度应该还不错 17 | 要是vps抽风的话 就访问这个吧 18 | 19 | -------------------------------------------------------------------------------- /content/post/domain-changed.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-04-05T15:08:00+08:00" 3 | draft = false 4 | slug = "domain-changed" 5 | tags = ["blog"] 6 | title = "换域名了" 7 | 8 | +++ 9 | ## 我去namesilo注册回来了(;´Д`) 10 | 11 | ~~之前用的.space太小众 正好今天看到了name.com首年免费的消息 吓得我立马注册了个.com的~~ 12 | 13 | 14 | ~~之前的4679.space直接301过来了 评论用disqus的工具迁移了~~ 15 | 16 | 17 | 淦你娘的name.com 把我账号关了 域名收回 说我滥用 玩不起就不要玩 一生黑 -------------------------------------------------------------------------------- /content/post/move-to-hugo.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-21T18:30:19+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "move-to-hugo" 10 | tags = ["blog"] 11 | title = "迁移到Hugo" 12 | 13 | +++ 14 | 15 | 第二次迁移博客了 这次迁移到了Hugo 一款用go语言编写的静态博客生成器 优点是效率比Hexo高太多 之前每次生成博客需要两三秒 现在只用1秒不到 不过目前还没有用于Hexo的迁移方案 全是我手动迁移的 累死了(´_ゝ`) -------------------------------------------------------------------------------- /content/post/neovim.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-04-23T23:04:03+08:00" 3 | draft = false 4 | slug = "neovim" 5 | tags = ["tech"] 6 | title = "从vim转到neovim" 7 | 8 | +++ 9 | 最近从vim跟风换到了neovim,把之前vim的配置改了改,没发现什么不兼容的 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /content/post/0bin.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-04-10T13:07:03+08:00" 3 | draft = false 4 | slug = "0bin" 5 | tags = ["tech"] 6 | title = "客户端加密的代码剪切板" 7 | 8 | +++ 9 | 闲着无聊想搭个代码剪切板玩玩,结果在github上发现了这货 10 | 11 | 12 | [0bin](https://github.com/sametmax/0bin/) 13 | 14 | 15 | 亮点就是在浏览器进行AES-256加密,服务器无法获知上传的内容,并且支持阅后即焚 16 | 17 | 18 | 于是我就搭了一个,并汉化了下 19 | 20 | 21 | [这是地址](https://paste.libnull.com/) 22 | 23 | 24 | 各位可以体验一下 还挺不错的 25 | 26 | 27 | PS:可以粘贴图片哦 -------------------------------------------------------------------------------- /config.toml: -------------------------------------------------------------------------------- 1 | baseurl = "http://127.0.0.1:4679/" 2 | languageCode = "zh-CN" 3 | theme = "demons-ladder" 4 | title = "Nothing Here" 5 | disqusShortname = "4679" 6 | dateFormat = "%b %d, %Y" 7 | 8 | subtitle = "Hi." 9 | github = "https://github.com/4679" 10 | weibo = "http://weibo.com/u/1963942417" 11 | links = "https://libnull.com/friends/" 12 | about = "https://libnull.com/about/" 13 | profile = "https://dn-4679kun.qbox.me/head.jpg" 14 | copyright = "Written by 4679kun" 15 | analytics = "UA-32121582-2" 16 | -------------------------------------------------------------------------------- /content/post/new-image-host.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-04-12T15:21:00+08:00" 3 | draft = false 4 | slug = "new-image-host" 5 | tags = ["blog"] 6 | title = "弄了个新图床" 7 | 8 | +++ 9 | ## 想起七牛还有1000代金券 不用白不用 10 | 11 | 我在看了V2EX上的[这个帖子](https://www.v2ex.com/t/269463)之后 我慌了 万一哪天有人来刷我怎么办 12 | 13 | 14 | 于是 [我给自己搭了个图床](https://img.libnull.com) 15 | 16 | 17 | 搭在OpenShift上 走Kloudsec CDN 有1G空间 也够我用了 18 | 19 | 20 | 系统用的Lychee [一键安装](https://github.com/gautamkrishnar/Lychee-openshift-quickstart) 21 | 22 | 23 | 我这移动网 速度还不错 -------------------------------------------------------------------------------- /balog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source modules/time.sh 4 | source modules/sort.sh 5 | source modules/get_config.sh 6 | source modules/get_meta.sh 7 | source modules/get_page_meta.sh 8 | source modules/gen_post.sh 9 | source modules/gen_page.sh 10 | source modules/gen.sh 11 | 12 | content_path="$(pwd)/content" 13 | config_path="$(pwd)/config.toml" 14 | themes_path="$(pwd)/themes" 15 | tmp_path="$(pwd)/.tmp" 16 | work_dir="$(pwd)" 17 | 18 | rm -rf $tmp_path/* > /dev/null 2>&1 19 | sort_file 20 | echo "[$(date +%T)] "开始生成 21 | echo "[$(date +%T)] "----------------------- 22 | time gen 23 | -------------------------------------------------------------------------------- /content/post/oh-my-termux.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2016-01-08T19:23:15+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "oh-my-termux" 10 | tags = ["tech"] 11 | title = "oh my termux" 12 | 13 | +++ 14 | 15 | Termux是安卓上的一款软件 能提供一个差不多能用的linux环境 值得一提的是 它带有包管理器apt 常用的软件包差不多都有 16 | 我写了个快速配置Termux的脚本 [oh-my-termux](https://github.com/4679/oh-my-termux) 17 | 18 | 19 |
20 | -------------------------------------------------------------------------------- /content/post/vimrc.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-21T19:16:05+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "vimrc" 10 | tags = ["tech"] 11 | title = "一份简洁 优雅的vim配置" 12 | 13 | +++ 14 | 用心感受 15 | 16 | 17 | 如丝般顺滑 开箱即用 遵循KISS原则 18 | 19 | 20 | # 2016-01-07 21 | - 更新了 这次绝对不坑爹 22 | 23 | 24 | # 2016-04-24 25 | - 把vundle换成了vim-plug 26 | - 优化了安装脚本 27 | 28 | 29 |
30 | -------------------------------------------------------------------------------- /modules/sort.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sort_file() { 4 | ls $content_path/post | sed 's/ /\n/g' > $tmp_path/name.tmp 5 | ls $content_path/page | sed 's/ /\n/g' > $tmp_path/page.tmp 6 | local line=$(cat $tmp_path/name.tmp | wc -l) 7 | 8 | while [[ $line -gt 0 ]]; do 9 | local filename=$(cat $tmp_path/name.tmp | sed -n "${line}p") 10 | local time=$(cat $content_path/post/$filename | grep "date = \"" | awk -F " = " '{print $2}' | sed 's/"//g') 11 | local timestamp=$(timestamp $time) 12 | echo "$timestamp $filename" >> $tmp_path/list.tmp 13 | local line=$(expr $line - 1) 14 | done 15 | sort -r $tmp_path/list.tmp -o $tmp_path/list.tmp 16 | } 17 | -------------------------------------------------------------------------------- /content/page/friends.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-11-06T15:57:30+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "friends" 10 | tags = ["me"] 11 | title = "朋友们" 12 | hidden = true 13 | +++ 14 | - 友链(排名不分先后) 15 | - [Siege][1] 16 | - [I Loli][2] 17 | - [Forest Castel][3] 18 | - [格式化秘密][4] 19 | - [iclementine][5] 20 | - [Мвудаг/Этура Яннъ][6] 21 | - [雨宫千鹤][7] 22 | - [UbuntuHOT][8] 23 | 24 | [1]: https://ky0n.xyz/ 25 | [2]: http://i-loli.net/ 26 | [3]: http://rednik.pw/ 27 | [4]: https://www.forloop.top/ 28 | [5]: https://iclementine.wordpress.com/ 29 | [6]: https://etula.me/ 30 | [7]: https://bismarck.moe/ 31 | [8]: https://www.ubuntuhot.com/ 32 | -------------------------------------------------------------------------------- /content/post/google-mirror.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-01-29T16:44:45+08:00" 3 | draft = false 4 | slug = "google-mirror" 5 | tags = ["tech"] 6 | title = "搭建了个Google反向代理" 7 | 8 | +++ 9 | ## [https://g.4679.space](https://g.libnull.com) ## 10 | 11 | 用到了wen.lu提供的[ngx_http_google_filter_module](https://github.com/cuber/ngx_http_google_filter_module) 12 | 13 | 14 | ~~为了方便安装 我写了个PKGBUILD放在aur上 Arch用户可以直接安装 [nginx-mainline-boringssl-google_fliter](https://aur.archlinux.org/packages/nginx-mainline-boringssl-google_fliter/)~~ 15 | 16 | 17 | 这个坑弃了 新的服务端 [nginx-mainline-mod4679](https://aur.archlinux.org/packages/nginx-mainline-mod4679/) 18 | 19 | 20 | [配置文档在这](https://github.com/cuber/ngx_http_google_filter_module/blob/master/README.zh-CN.md) 21 | -------------------------------------------------------------------------------- /themes/demons-ladder/layouts/partials/disqus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /content/post/ss-speedup.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-03T20:09:44+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "ss-speedup" 10 | tags = ["tech"] 11 | title = "利用阿里的免费服务器中转SS加速" 12 | 13 | +++ 14 | **转载 [原文](http://xuqk.tk/251)** 15 | 16 | 在国外的vps上架设的SS 难免会掉包 高延迟 目前比较不错的解决办法是用国内的高质量服务器进行转发 17 | 财大气粗的阿里为我们提供了免费的服务器 18 | 19 | 前面的步骤直接看原文吧 20 | 21 | 需要说明的地方是配置文件那部分 22 | 23 | ```cfg 24 | global 25 | ulimit-n 51200 26 | defaults 27 | log global 28 | mode tcp 29 | option dontlognull 30 | timeout connect 1000 31 | timeout client 150000 32 | timeout server 150000 33 | frontend ss-in 34 | bind *:8080 35 | default_backend ss-out 36 | backend ss-out 37 | server server1 SS服务器IP:SS端口号 maxconn 20480 38 | ``` 39 | 40 | 41 | -------------------------------------------------------------------------------- /content/post/hack-a-dprk-server.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-04-06T14:55:00+08:00" 3 | draft = false 4 | slug = "hack-a-dprk-server" 5 | tags = ["tech"] 6 | title = "记一次拿下一台朝鲜服务器" 7 | 8 | +++ 9 | ### 4月7日更新: 三胖把网线拔了|∀゚ 10 | 11 | 12 | 昨晚在V2ex看到[一篇帖子](https://www.v2ex.com/t/268389) 当时我就震惊了 13 | 14 | 15 | 然后我就看到了楼主发的ip段 我就决定自己动手玩玩 16 | 17 | 18 | 楼主提到了他开启了3389端口 我就以这个为目标开始扫描 19 | 20 | 21 | 我用到的端口扫描工具是[masscan](https://github.com/robertdavidgraham/masscan) 22 | 23 | 24 | ``` 25 | masscan 175.45.176.0/24 -p3389 26 | ``` 27 | 28 | 29 | 有结果了 直接访问扫出来的ip 看到了老版本的XAMPP 30 | 31 | 32 | 查看phpinfo页面 看到了文件实际地址 33 | 34 | 35 | 之后进入phpmyadmin 一句话webshell 开启telnet 修改admin密码 开启3389 拿下 36 | 37 | 38 | 于是我开了个ss 39 | 40 | 41 | ![朝鲜SS](https://dn-4679kun.qbox.me/pic/hack-a-dprk-server/1.jpg) 42 | 43 | 44 | 三胖会不会用大浦洞轰我呢😊 -------------------------------------------------------------------------------- /content/post/storage-space-running-out.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-22T18:32:31+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "storage-space-running-out" 10 | tags = ["tech"] 11 | title = "干掉安卓烦人的 存储空间不足 的通知" 12 | 13 | +++ 14 | 这个通知真是太烦人了 于是干掉他 15 | 16 | ***需要ROOT权限*** 17 | 18 | 安卓5.x及以下 19 | 20 | - 下载SQLite编辑器 21 | 22 | ``` 23 | 打开 /data/data/com.android.providers.settings/databases/settings.db 24 | 打开 secure 25 | 编辑 sys_storage_threshold_percentage的值 改为0 26 | 重启 27 | ``` 28 | 29 | 安卓6.x 30 | 31 | - 下载终端模拟器 或者直接用adb shell 32 | 33 | ``` 34 | 执行 35 | su 36 | settings put global sys_storage_threshold_percentage 0 37 | 重启 38 | ``` 39 | 40 | 原理就是 这个值控制空间不足多少时提示空间不足 默认是10 也就是空间不足10%的时候提示 把它修改成0 就没有提示了 41 | -------------------------------------------------------------------------------- /content/post/certificate-transparency.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-03-01T08:59:03+08:00" 3 | draft = false 4 | slug = "certificate-transparency" 5 | tags = ["blog"] 6 | title = "博客启用Certificate Transparency" 7 | 8 | +++ 9 | 谷歌爸爸的东西 当然要兹磁啦 10 | 11 | 12 | 参考了这两篇文章 13 | 14 | 15 | [为 SSL 站点启用 Certificate Transparency 功能](http://blog.eqoe.cn/posts/enable-certificate-transparency-for-nginx.html) 16 | 17 | 18 | [Certificate Transparency 那些事](https://imququ.com/post/certificate-transparency.html) 19 | 20 | 21 | 你们现在看到的服务器信息应该是这样 22 | 23 | 24 | ![info](https://dn-4679kun.qbox.me/pic/certificate-transparency/1.jpg) 25 | 26 | 27 | 这是我用的服务端 [nginx-mainline-mod4679](https://aur.archlinux.org/packages/nginx-mainline-mod4679/) 28 | 29 | 30 | nginx+OpenSSL(Cloudflare的补丁)+google反代模块+Certificate Transparency模块 31 | 32 | 33 | 另外婊一下cloudflare在国内的速度 现在直连比之前走cloudflare快多了 34 | -------------------------------------------------------------------------------- /content/post/net-speeder.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-04T10:50:51+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "net-speeder" 10 | tags = ["vps"] 11 | title = "使用net-speeder缓解vps高延迟 高丢包率" 12 | 13 | +++ 14 | net-speeder是一款开源软件 能显著降低丢包率 原理简单粗暴 就是每个包发两遍 所以 使用的流量也会翻一倍 这就要靠大家取舍了 15 | 16 | [项目地址](https://github.com/snooda/net-speeder) 17 | 18 | 首先安装依赖 libnet, libpcap 19 | ```bash 20 | sudo pacman -Sy libnet libpcap 21 | ``` 22 | 每个发行版安装方法都不同 就不一一说明了 23 | 24 | 之后就是获取源代码了 25 | ```bash 26 | git clone https://github.com/snooda/net-speeder 27 | cd net-speeder 28 | ``` 29 | 30 | 然后编译 31 | 32 | vps架构是openvz的 33 | ```bash 34 | sh build.sh -DCOOKED 35 | ``` 36 | vps是Xen,KVM或者是物理机的 37 | ```bash 38 | sh build.sh 39 | ``` 40 | 41 | 编译完成后 就可以运行了 42 | 43 | 首先获取root权限 44 | ```bash 45 | su 46 | ``` 47 | 使用方法 48 | ```bash 49 | ./net_speeder 网卡名 加速规则(bpf规则) 50 | ``` 51 | 52 | 最简单的使用方法(对于OpenVZ) 53 | ```bash 54 |  ./net_speeder venet0 "ip" 55 | ``` 56 | 57 | ping一下看看效果吧:-) 58 | 59 | PS:对SS也有效哦 60 | 61 | -------------------------------------------------------------------------------- /content/post/vps2arch.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-11-05T23:19:11+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "vps2arch" 10 | tags = ["vps"] 11 | title = "用黑魔法把任意系统的vps变成Arch" 12 | 13 | +++ 14 | 作为一个有信仰的人 当然在哪都要用Arch vps也是 然而大部分vps提供商都不会有Arch这种“不稳定”的系统供我们选择 这怎么能忍 15 | 于是我找啊找 没想到真找到了办法 16 | 17 | [https://github.com/drizzt/vps2arch][1] 18 | 19 | 就是它 使用方法很简单 20 | 21 | **注意!这会清除vps上的所有数据** 22 | 23 | wget http://git.io/vps2arch 24 | chmod +x vps2arch 25 | su 26 | ./vps2arch 27 | 28 | 就这四条命令 经过一小会等待之后 安装就完成了 29 | 30 | 然后配置好软件源 执行 31 | 32 | sync ; reboot -f 33 | 34 | vps就会重启 然后再次连上ssh 就能享受Arch啦 35 | 36 | 37 | PS: 38 | 1. 不保证一切顺利 39 | 2. 这是一份测试过的vps的列表 [这里][3] 我在CheapVZ的vps里也测试过了 40 | 3. ipv6暂时还不能自动配置 有需要的请手动配置 41 | 4. base-devel组不会自动安装 需要自己装 42 | 5. 觉得棒的话 可以考虑捐助作者 43 | 6. 没了 44 | 45 | 46 | [1]: https://github.com/drizzt/vps2arch 47 | [2]: https://github.com/K-Guan/vps2arch/blob/master/README.md 48 | [3]: https://github.com/drizzt/vps2arch/wiki/Tested-VPS-Providers 49 | 50 | -------------------------------------------------------------------------------- /themes/demons-ladder/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Asuka Suzuki 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /content/post/lets-encrypt.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-04T13:27:52+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "lets-encrypt" 10 | tags = ["tech"] 11 | title = "Let's Encrypt试用笔记" 12 | 13 | +++ 14 | 昨天 也就是12月3日 Let's Encrypt项目正式启动了Public Beta 这意味着以后每个人都能用上免费的SSL证书这实在是一件大好事 下面是我的试用体验 15 | 16 | 首先 我们要获取Let's Encrypt的客户端 17 | ```bash 18 | git clone https://github.com/letsencrypt/letsencrypt 19 | cd letsencrypt 20 | ``` 21 | 22 | 之后就可以签发证书了 23 | 24 | 首先 获得root权限 25 | ```bash 26 | su 27 | ``` 28 | 29 | 之后 停掉占用了80和443端口的web服务器 30 | 这里取决于各位使用的操作系统与web服务器 我用的是Archlinux+Nginx 31 | ```bash 32 | systemctl stop nginx 33 | ``` 34 | 35 | 然后就是签发证书了 (不支持泛域名) 36 | ```bash 37 | ./letsencrypt-auto -d 你的域名 certonly 38 | ``` 39 | 40 | 等待一阵过后 你的证书就在 41 | ```bash 42 | /etc/letsencrypt/live/你的域名/ 43 | ``` 44 | 里面等着你了 赶快修改你的服务器配置文件来使用它吧 45 | 46 | 最后上一张效果图 47 | ![效果图](https://dn-4679kun.qbox.me/pic/lets-encrypt/1.jpg) 48 | 49 | PS:证书的有效期是3个月 记得续签哦 50 | 51 | 感谢Mozilla以及项目赞助者还有开发者们为了给我们带来更安全的互联网所做出的贡献! 52 | 53 | 本文是我在午睡的时候睡不着用48元包邮的渣想BKC600蓝牙键盘写下的 手感还不错:-) 54 | ![BKC600](https://dn-4679kun.qbox.me/pic/lets-encrypt/2.jpg) 55 | 56 | 57 | -------------------------------------------------------------------------------- /content/post/sign.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-01T13:56:08+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "sign" 10 | tags = ["tech"] 11 | title = "用Openshift架设自己的贴吧签到站" 12 | 13 | +++ 14 | [现成的 不想动手的就用这个吧](https://sign.libnull.com/) 15 | 16 | 首先 我们得去注册个Openshift的账号 这个应该不用详细写了 大家应该都会 17 | 18 | 19 | 登陆到控制台之后 20 | ![Image](https://dn-4679kun.qbox.me/pic/sign/1.jpg) 21 | 22 | 点击大大的蓝色按钮 23 | ![Image](https://dn-4679kun.qbox.me/pic/sign/2.jpg) 24 | 25 | 搜索cacti 点击它 26 | ![Image](https://dn-4679kun.qbox.me/pic/sign/3.jpg) 27 | 28 | 29 | 上面的输入框是域名地址 自己想一个 下面的输入框里面换成 30 | ```bash 31 | https://github.com/puteulanus/tieba-sign-install3 32 | ``` 33 | 这里感谢创世神域写的安装脚本 [原地址](http://www.puteulanus.com/archives/572) 34 | ![Image](https://dn-4679kun.qbox.me/pic/sign/4.jpg) 35 | 36 | Create! 37 | 38 | 完成以后就可以访问你刚才设定的地址了 39 | ![Image](https://dn-4679kun.qbox.me/pic/sign/5.jpg) 40 | 41 | 选不 42 | ![Image](https://dn-4679kun.qbox.me/pic/sign/6.jpg) 43 | 44 | 下面三项填好 完成 45 | ![Image](https://dn-4679kun.qbox.me/pic/sign/7.jpg) 46 | 47 | 搭建好了 48 | ![Image](https://dn-4679kun.qbox.me/pic/sign/8.jpg) 49 | 50 | 记得添加帐号之后要刷新贴吧列表哦 51 | 52 | 53 | -------------------------------------------------------------------------------- /content/post/linux-deploy.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-03-26T18:58:03+08:00" 3 | draft = false 4 | slug = "linux-deploy" 5 | tags = ["tech"] 6 | title = "在Android上使用Linux图形界面" 7 | 8 | +++ 9 | 先上几张图 10 | ![XServer XSDL](https://dn-4679kun.qbox.me/pic/linux-deploy/1.jpg) 11 | 12 | 13 | ![i3wm](https://dn-4679kun.qbox.me/pic/linux-deploy/2.jpg) 14 | 15 | 16 | ![vim](https://dn-4679kun.qbox.me/pic/linux-deploy/3.jpg) 17 | 18 | 19 | ![mc](https://dn-4679kun.qbox.me/pic/linux-deploy/4.jpg) 20 | 21 | 22 | 具体步骤呢 23 | 24 | 25 | 1.先用[Linux Deploy](http://www.coolapk.com/apk/ru.meefik.linuxdeploy)安装好系统,这个很简单,装好Busybox,在设置里选好选项一键安装就行 26 | 27 | 28 | 2.安装好[XServer XSDL](https://play.google.com/store/apps/details?id=x.org.server),Android上的X服务器,效率比用VNC好多了 29 | 30 | 31 | 3.通过ssh连接到装好的系统,客户端我推荐[JuiceSSH](http://www.coolapk.com/apk/com.sonelli.juicessh) 32 | 33 | 34 | 4.安装好你要使用的桌面,我选择的是i3wm 35 | 36 | 37 | 5.打开XServer XSDL,配置好分辨率和字体缩放,分辨率我选的原生,字体缩放0.5x,然后就会看到图1的界面了 38 | 39 | 40 | 6.进入终端,输入 export DISPLAY=:0 PULSE_SERVER=tcp:127.0.0.1:4712 41 | 42 | 43 | 7.启动桌面,比如我用i3就输入i3wm,xfce就是startxfce,lxde就是startlxde,等等 44 | 45 | 46 | 8.切换回XServer XSDL,不出意外的话你就能看到桌面了,随意折腾吧~ 47 | 48 | 49 | PS:图中i3的配置来自于[oh-my-i3](https://github.com/ID1258/oh-my-i3),很好看,赞一个 -------------------------------------------------------------------------------- /content/post/port-forwarding.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-09T18:51:30+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "port-forwarding" 10 | tags = ["tech"] 11 | title = "用阿里云的免费主机转发任意端口" 12 | 13 | +++ 14 | 上次用了阿里云的免费主机转发了SS 其实转发任何端口都是可以的 这次就以SSH的默认端口22来做示范 15 | 16 | 首先 来到TAE的控制台 17 | ![1](https://dn-4679kun.qbox.me/pic/port-forwarding/1.jpg) 18 | 19 | 点击配置管理 20 | ![2](https://dn-4679kun.qbox.me/pic/port-forwarding/2.jpg) 21 | 22 | 添加一个端口 最好访问端口和监听端口保持一致 然后记住它 (别用22 因为已经被占用了) 会提示重启 报错也没关系 手动点击重启就行 23 | 24 | 之后进入WebSSH 25 | 26 | 我们用到的软件是rinetd 简单好用 27 | 28 | 首先安装一个screen 这样才能保证WebSSH关闭之后rinetd的进程不被杀死 29 | 30 | ```bash 31 | yum install screen 32 | ``` 33 | 34 | 然后下载解压编译rinetd 35 | ```bash 36 | wget http://www.boutell.com/rinetd/http/rinetd.tar.gz 37 | tar zxvf rinetd.tar.gz 38 | cd rinetd 39 | make 40 | make install 41 | ``` 42 | 43 | 编辑配置文件 44 | ```bash 45 | vim /etc/rinetd.conf 46 | ``` 47 | vim的用法我就不说了 网上都有 48 | 49 | 填入 50 | ```cfg 51 | 0.0.0.0 刚才添加的端口号 VPS的IP 22 52 | ``` 53 | 54 | 然后开启screen 启动rinetd 55 | ```bash 56 | screen 57 | rinetd -c /etc/rinetd.conf 58 | ``` 59 | 60 | 这样就完成了 ssh连接vps的时候 IP和端口都用刚才才在配置管理里面看到的就行 61 | 62 | 重启之后 之前开启的SS转发也被关了 再开启一遍就行 63 | 64 | 这个方法可以用于转发任何端口 65 | 66 | 67 | -------------------------------------------------------------------------------- /themes/demons-ladder/layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 5 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /themes/demons-ladder/static/css/highlight_railscasts.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Railscasts-like style (c) Visoft, Inc. (Damien White) 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: #232323; 12 | color: #e6e1dc; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: #bc9458; 18 | font-style: italic; 19 | } 20 | 21 | .hljs-keyword, 22 | .hljs-selector-tag { 23 | color: #c26230; 24 | } 25 | 26 | .hljs-string, 27 | .hljs-number, 28 | .hljs-regexp, 29 | .hljs-variable, 30 | .hljs-template-variable { 31 | color: #a5c261; 32 | } 33 | 34 | .hljs-subst { 35 | color: #519f50; 36 | } 37 | 38 | .hljs-tag, 39 | .hljs-name { 40 | color: #e8bf6a; 41 | } 42 | 43 | .hljs-type { 44 | color: #da4939; 45 | } 46 | 47 | 48 | .hljs-symbol, 49 | .hljs-bullet, 50 | .hljs-built_in, 51 | .hljs-builtin-name, 52 | .hljs-attr, 53 | .hljs-link { 54 | color: #6d9cbe; 55 | } 56 | 57 | .hljs-params { 58 | color: #d0d0ff; 59 | } 60 | 61 | .hljs-attribute { 62 | color: #cda869; 63 | } 64 | 65 | .hljs-meta { 66 | color: #9b859d; 67 | } 68 | 69 | .hljs-title, 70 | .hljs-section { 71 | color: #ffc66d; 72 | } 73 | 74 | .hljs-addition { 75 | background-color: #144212; 76 | color: #e6e1dc; 77 | display: inline-block; 78 | width: 100%; 79 | } 80 | 81 | .hljs-deletion { 82 | background-color: #600; 83 | color: #e6e1dc; 84 | display: inline-block; 85 | width: 100%; 86 | } 87 | 88 | .hljs-selector-class { 89 | color: #9b703f; 90 | } 91 | 92 | .hljs-selector-id { 93 | color: #8b98ab; 94 | } 95 | 96 | .hljs-emphasis { 97 | font-style: italic; 98 | } 99 | 100 | .hljs-strong { 101 | font-weight: bold; 102 | } 103 | 104 | .hljs-link { 105 | text-decoration: underline; 106 | } 107 | -------------------------------------------------------------------------------- /themes/demons-ladder/static/css/sanitize.css: -------------------------------------------------------------------------------- 1 | /*! sanitize.css | CC0 Public Domain | github.com/jonathantneal/sanitize.css */ 2 | pre,textarea{overflow:auto} 3 | [hidden],audio:not([controls]),template{display:none} 4 | details,main,summary{display:block} 5 | input[type=number]{width:auto} 6 | input[type=search]{-webkit-appearance:textfield} 7 | input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none} 8 | progress{display:inline-block} 9 | small{font-size:75%} 10 | textarea{resize:vertical} 11 | [unselectable]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} 12 | *,::after,::before{box-sizing:inherit;border-style:solid;border-width:0} 13 | *{font-size:inherit;line-height:inherit;margin:0;padding:0} 14 | ::after,::before{text-decoration:inherit;vertical-align:inherit} 15 | :root{-ms-overflow-style:-ms-autohiding-scrollbar;overflow-y:scroll;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;box-sizing:border-box;cursor:default;font:16px/1.5 sans-serif;text-rendering:optimizeLegibility} 16 | a{text-decoration:none} 17 | audio,canvas,iframe,img,svg,video{vertical-align:middle} 18 | button,input,select,textarea{background-color:transparent;color:inherit;font-family:inherit;font-style:inherit;font-weight:inherit;min-height:1.5em} 19 | code,kbd,pre,samp{font-family:monospace,monospace} 20 | nav ol,nav ul{list-style:none} 21 | select{-moz-appearance:none;-webkit-appearance:none} 22 | select::-ms-expand{display:none} 23 | select::-ms-value{color:currentColor} 24 | table{border-collapse:collapse;border-spacing:0} 25 | ::-moz-selection{background-color:#B3D4FC;text-shadow:none} 26 | ::selection{background-color:#B3D4FC;text-shadow:none} 27 | @media screen{[hidden~=screen]{display:inherit} 28 | [hidden~=screen]:not(:active):not(:focus):not(:target){clip:rect(0 0 0 0)!important;position:absolute!important} 29 | } 30 | -------------------------------------------------------------------------------- /modules/gen_post.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gen_post() { 4 | local file_name=${1}.md 5 | local dest_path="$work_dir/public/$1" 6 | local theme_path="$themes_path/$(get_config theme)" 7 | local partials_path=${theme_path}/layouts/partials 8 | local default_path=${theme_path}/layouts/_default 9 | local permalink="$(get_config baseurl)$(get_meta $1 slug)/" 10 | local line_start=$(expr $(cat $content_path/post/$file_name | grep -n "+++" | tail -n 1 | cut -f 1 -d :) + 1) 11 | 12 | mkdir -p $dest_path 13 | 14 | cat $partials_path/header.html >> $dest_path/index.html 15 | cat $default_path/single.html >> $dest_path/index.html 16 | 17 | mkdir -p $tmp_path/post 18 | cat $content_path/post/$file_name | sed -n "$line_start,999999p" > $tmp_path/post/$file_name.tmp 19 | $work_dir/libs/markdown.sh $tmp_path/post/$file_name.tmp >> $dest_path/index.html 20 | 21 | cat $default_path/single2.html >> $dest_path/index.html 22 | cat $partials_path/disqus.html >> $dest_path/index.html 23 | cat $partials_path/footer.html >> $dest_path/index.html 24 | 25 | sed -i "s/{{.Site.LanguageCode}}/$(get_config languageCode)/g" $dest_path/index.html 26 | sed -i "s/{{ .Title }}/$(get_meta $1 title )/g" $dest_path/index.html 27 | sed -i "s/{{ .Site.Title }}/$(get_config title )/g" $dest_path/index.html 28 | sed -i "s/{{ .Site.Params.subtitle }}/$(get_config subtitle )/g" $dest_path/index.html 29 | sed -i "s#{{ .Permalink }}#$permalink#g" $dest_path/index.html 30 | sed -i "s#{{ .Site.BaseURL }}#$(get_config baseurl)#g" $dest_path/index.html 31 | sed -i "s#{{ .Site.Params.about }}#$(get_config about)#g" $dest_path/index.html 32 | sed -i "s#{{ .Site.Params.github }}#$(get_config github)#g" $dest_path/index.html 33 | sed -i "s#{{ .Site.Params.weibo }}#$(get_config weibo)#g" $dest_path/index.html 34 | sed -i "s#{{ .Site.Params.links }}#$(get_config links)#g" $dest_path/index.html 35 | sed -i "s/{{ .Date }}/$(format_date $(get_meta $1 date ))/g" $dest_path/index.html 36 | sed -i "s#{{ .Site.Params.profile }}#$(get_config profile)#g" $dest_path/index.html 37 | sed -i "s/{{ .Site.Params.name }}/$(get_config name)/g" $dest_path/index.html 38 | sed -i "s/{{ .Site.DisqusShortname }}/$(get_config disqusShortname)/g" $dest_path/index.html 39 | } 40 | -------------------------------------------------------------------------------- /modules/gen_page.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gen_page() { 4 | local page_name=${1}.md 5 | local dest_path="$work_dir/public/$1" 6 | local theme_path="$themes_path/$(get_config theme)" 7 | local partials_path=${theme_path}/layouts/partials 8 | local default_path=${theme_path}/layouts/_default 9 | local permalink="$(get_config baseurl)$(get_page_meta $1 slug)/" 10 | local line_start=$(expr $(cat $content_path/page/$page_name | grep -n "+++" | tail -n 1 | cut -f 1 -d :) + 1) 11 | 12 | mkdir -p $dest_path 13 | 14 | cat $partials_path/header.html >> $dest_path/index.html 15 | cat $default_path/single.html >> $dest_path/index.html 16 | 17 | mkdir -p $tmp_path/page 18 | cat $content_path/page/$page_name | sed -n "$line_start,999999p" > $tmp_path/page/$page_name.tmp 19 | $work_dir/libs/markdown.sh $tmp_path/page/$page_name.tmp >> $dest_path/index.html 20 | 21 | cat $default_path/single2.html >> $dest_path/index.html 22 | cat $partials_path/disqus.html >> $dest_path/index.html 23 | cat $partials_path/footer.html >> $dest_path/index.html 24 | 25 | sed -i "s/{{.Site.LanguageCode}}/$(get_config languageCode)/g" $dest_path/index.html 26 | sed -i "s/{{ .Title }}/$(get_page_meta $1 title )/g" $dest_path/index.html 27 | sed -i "s/{{ .Site.Title }}/$(get_config title )/g" $dest_path/index.html 28 | sed -i "s/{{ .Site.Params.subtitle }}/$(get_config subtitle )/g" $dest_path/index.html 29 | sed -i "s#{{ .Permalink }}#$permalink#g" $dest_path/index.html 30 | sed -i "s#{{ .Site.BaseURL }}#$(get_config baseurl)#g" $dest_path/index.html 31 | sed -i "s#{{ .Site.Params.about }}#$(get_config about)#g" $dest_path/index.html 32 | sed -i "s#{{ .Site.Params.github }}#$(get_config github)#g" $dest_path/index.html 33 | sed -i "s#{{ .Site.Params.weibo }}#$(get_config weibo)#g" $dest_path/index.html 34 | sed -i "s#{{ .Site.Params.links }}#$(get_config links)#g" $dest_path/index.html 35 | sed -i "s/{{ .Date }}/$(format_date $(get_page_meta $1 date ))/g" $dest_path/index.html 36 | sed -i "s#{{ .Site.Params.profile }}#$(get_config profile)#g" $dest_path/index.html 37 | sed -i "s/{{ .Site.Params.name }}/$(get_config name)/g" $dest_path/index.html 38 | sed -i "s/{{ .Site.DisqusShortname }}/$(get_config disqusShortname)/g" $dest_path/index.html 39 | 40 | echo "[$(date +%T)] " 页面标题: $(get_page_meta $1 title) 41 | } 42 | -------------------------------------------------------------------------------- /content/post/sslh.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-16T21:29:18+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "sslh" 10 | tags = ["vps"] 11 | title = "利用sslh在同一个端口运行nginx openvpn xmpp ssh等服务" 12 | 13 | +++ 14 | 这有什么用呢? 某些运营商或者学校可能屏蔽了一些服务的默认端口 比如屏蔽了22端口 你就只能把ssh的监听端口改成其他的 要是更变态 开启了白名单模式呢 那样就只能通过某些端口访问了 443就是其中一个 正常人一般不会屏蔽它 但是如果通过22端口访问vps的话 启用了TLS的http服务器怎么办呢 这时候就要用到sslh了 15 | sslh的原理很简单 通过分析数据包的特征辨别是什么协议的访问 把对同一端口不同协议的访问分流到不同的端口上 16 | 17 | 首先是安装 18 | 对于Archlinux用户 19 | ```bash 20 | yaourt -S sslh 21 | ``` 22 | 通用方法 (我没测试) 23 | ```bash 24 | #首先安装依赖 25 | #Debian 26 | apt-get install -y libwrap0-dev libconfig8-dev 27 | #RPM系 28 | yum install libconfig libconfig-devel 29 | 30 | #获取源码 31 | git clone https://github.com/yrutschle/sslh 32 | cd sslh 33 | 34 | #编译 35 | make 36 | 37 | #安装(Debian) 38 | make install 39 | cp scripts/etc.init.d.sslh /etc/init.d/sslh 40 | update-rc.d sslh defaults 41 | 42 | #安装(CentOS) 43 | make install 44 | cp scripts/etc.rc.d.init.d.sslh.centos /etc/rc.d/init.d/sslh 45 | ``` 46 | 47 | 之后修改位于/etc/sslh.conf或者/etc/sslh.cfg的配置文件 48 | 以下是我的 也是Arch的默认配置 49 | ```cfg 50 | # Default Arch configuration 51 | # You can find more examples in /usr/share/doc/sslh 52 | 53 | verbose: false; 54 | foreground: true; 55 | inetd: false; 56 | numeric: false; 57 | transparent: false; 58 | timeout: 2; 59 | user: "sslh"; 60 | pidfile: "/run/sslh.pid"; 61 | 62 | 63 | listen: 64 | ( 65 | { host: "::0"; port: "443"; } 66 | ); 67 | 68 | protocols: 69 | ( 70 | { name: "ssh"; service: "ssh"; host: "localhost"; port: "22"; probe: "builtin"; }, 71 | { name: "http"; host: "localhost"; port: "80"; probe: "builtin"; }, { name: "ssl"; host: "localhost"; port: "8443"; probe: "builtin"; }, 72 | { name: "anyprot"; host: "localhost"; port: "8443"; probe: "builtin"; } 73 | ); 74 | ``` 75 | 然后 把占用了443端口的服务的监听端口改到8443 或者配置文件里定义的地址 76 | 77 | 然后启动sslh 78 | ```bash 79 | #Archlinux 80 | systemctl start sslh-fork 81 | 82 | #Debian 83 | service sslh start 84 | ``` 85 | 86 | 最后测试一下通过443端口来进行ssh连接 87 | ```bash 88 | ssh 127.0.0.1 -p 443 89 | ``` 90 | 没问题的话就成功了 91 | 92 | 之后就可以禁止从外网访问22端口来提高安全性啦 93 | 标题中的openvpn xmpp也可以 按照格式添加进配置文件就行 94 | 95 | 96 | PS:我一开始其实在想 shadowsocks能不能用 后来想到 shadowsocks能不被gfw封杀 其中一个原因不就是因为没有流量特征吗 所以sslh是不能识别ss的流量的 97 | 98 | -------------------------------------------------------------------------------- /modules/gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gen() { 4 | local dest_path="$work_dir/public" 5 | local theme_path="$themes_path/$(get_config theme)" 6 | local index_path=${theme_path}/layouts/index 7 | local partials_path=${theme_path}/layouts/partials 8 | local default_path=${theme_path}/layouts/_default 9 | local baseurl="$(get_config baseurl)" 10 | local post_index=$(cat $tmp_path/list.tmp | wc -l) 11 | rm -rf $dest_path/* 12 | 13 | cat $partials_path/header.html >> $dest_path/index.html 14 | cat $index_path/index1.html >> $dest_path/index.html 15 | sed -i "s/{{ .Title }}/Index/g" $dest_path/index.html 16 | 17 | i=0 18 | while [[ $i -lt $post_index ]]; do 19 | i=$(expr $i + 1) 20 | local post_name=$(cat $tmp_path/list.tmp | sed -n "${i},${i}p" | cut -f 2 -d " " | sed 's/.md//') 21 | local post_title=$(get_meta $post_name title) 22 | local post_link="$(get_config baseurl)$(get_meta $post_name slug)/" 23 | local post_date=$(get_meta $post_name date) 24 | local post_date=$(format_date $post_date) 25 | cat $index_path/post.html >> $dest_path/index.html 26 | sed -i "s#{{ .Postlink }}#$post_link#g" $dest_path/index.html 27 | sed -i "s#{{ .Title }}#$post_title#g" $dest_path/index.html 28 | sed -i "s#{{ .Date }}#$post_date#g" $dest_path/index.html 29 | gen_post $post_name 30 | echo "[$(date +%T)] " 标题: $post_title 31 | done 32 | 33 | cat $index_path/index2.html >> $dest_path/index.html 34 | cat $partials_path/footer.html >> $dest_path/index.html 35 | 36 | sed -i "s/{{ .Site.LanguageCode }}/$(get_config languageCode)/g" $dest_path/index.html 37 | sed -i "s/{{ .Site.Title }}/$(get_config title )/g" $dest_path/index.html 38 | sed -i "s/{{ .Site.Params.subtitle }}/$(get_config subtitle )/g" $dest_path/index.html 39 | sed -i "s#{{ .Permalink }}#$baseurl#g" $dest_path/index.html 40 | sed -i "s#{{ .Site.BaseURL }}#$(get_config baseurl)#g" $dest_path/index.html 41 | sed -i "s#{{ .Site.Params.about }}#$(get_config about)#g" $dest_path/index.html 42 | sed -i "s#{{ .Site.Params.github }}#$(get_config github)#g" $dest_path/index.html 43 | sed -i "s#{{ .Site.Params.weibo }}#$(get_config weibo)#g" $dest_path/index.html 44 | sed -i "s#{{ .Site.Params.links }}#$(get_config links)#g" $dest_path/index.html 45 | sed -i "s#{{ .Site.Params.profile }}#$(get_config profile)#g" $dest_path/index.html 46 | sed -i "s/{{ .Site.Params.name }}/$(get_config name)/g" $dest_path/index.html 47 | 48 | local page_index=$(cat $tmp_path/page.tmp | wc -l) 49 | p=0 50 | while [[ $p -lt $page_index ]]; do 51 | p=$(expr $p + 1) 52 | local page_file_name=$(cat $tmp_path/page.tmp | sed -n "${p},${p}p" | sed 's/.md//') 53 | gen_page $page_file_name 54 | done 55 | 56 | cp -r $theme_path/static/* $dest_path/ 57 | 58 | echo "[$(date +%T)] "----------------------- 59 | echo "[$(date +%T)] "一共生成了${i}篇博客 $(ls -l $content_path/page | grep ".md" | wc -l)个页面 60 | } 61 | -------------------------------------------------------------------------------- /themes/demons-ladder/static/css/responsive.css: -------------------------------------------------------------------------------- 1 | /* 12 COLUMN : RESPONSIVE GRID SYSTEM 2 | DEVELOPER : DENIS LEBLANC 3 | URL : http://responsive.gs 4 | VERSION : 3.0 5 | LICENSE : GPL & MIT */ 6 | /* SET ALL ELEMENTS TO BOX-SIZING : BORDER-BOX */ 7 | * { 8 | -webkit-box-sizing: border-box; 9 | -moz-box-sizing: border-box; 10 | box-sizing: border-box; 11 | *behavior: url(/scripts/boxsizing.htc); 12 | /* If you need support for IE7 and lower make 13 | sure the boxsizing.htc file is linked properly. 14 | More info here: https://github.com/Schepp/box-sizing-polyfill */ } 15 | 16 | /* MAIN CONTAINER 17 | Set the width to whatever you want the width of your site to be. */ 18 | .container { 19 | max-width: 800px; 20 | margin: 0 auto; } 21 | 22 | /* SELF CLEARING FLOATS - CLEARFIX METHOD */ 23 | .container:after, 24 | .row:after, 25 | .col:after, 26 | .clr:after, 27 | .group:after { 28 | content: ""; 29 | display: table; 30 | clear: both; } 31 | 32 | /* DEFAULT ROW STYLES 33 | Set bottom padding according to preference */ 34 | .row { 35 | padding-bottom: 0em; } 36 | 37 | /* DEFAULT COLUMN STYLES */ 38 | .col { 39 | display: block; 40 | float: left; 41 | width: 100%; } 42 | 43 | @media (min-width: 768px) { 44 | .gutters .col { 45 | margin-left: 2%; } 46 | 47 | .gutters .col:first-child { 48 | margin-left: 0; } } 49 | /* COLUMN WIDTH ON DISPLAYS +768px 50 | You might need to play with media queries here to suite your design. */ 51 | @media (min-width: 768px) { 52 | .span_1 { 53 | width: 8.33333333333%; } 54 | 55 | .span_2 { 56 | width: 16.6666666667%; } 57 | 58 | .span_3 { 59 | width: 25%; } 60 | 61 | .span_4 { 62 | width: 33.3333333333%; } 63 | 64 | .span_5 { 65 | width: 41.6666666667%; } 66 | 67 | .span_6 { 68 | width: 50%; } 69 | 70 | .span_7 { 71 | width: 58.3333333333%; } 72 | 73 | .span_8 { 74 | width: 66.6666666667%; } 75 | 76 | .span_9 { 77 | width: 75%; } 78 | 79 | .span_10 { 80 | width: 83.3333333333%; } 81 | 82 | .span_11 { 83 | width: 91.6666666667%; } 84 | 85 | .span_12 { 86 | width: 100%; } 87 | 88 | .gutters .span_1 { 89 | width: 6.5%; } 90 | 91 | .gutters .span_2 { 92 | width: 15.0%; } 93 | 94 | .gutters .span_3 { 95 | width: 23.5%; } 96 | 97 | .gutters .span_4 { 98 | width: 32.0%; } 99 | 100 | .gutters .span_5 { 101 | width: 40.5%; } 102 | 103 | .gutters .span_6 { 104 | width: 49.0%; } 105 | 106 | .gutters .span_7 { 107 | width: 57.5%; } 108 | 109 | .gutters .span_8 { 110 | width: 66.0%; } 111 | 112 | .gutters .span_9 { 113 | width: 74.5%; } 114 | 115 | .gutters .span_10 { 116 | width: 83.0%; } 117 | 118 | .gutters .span_11 { 119 | width: 91.5%; } 120 | 121 | .gutters .span_12 { 122 | width: 100%; } } 123 | -------------------------------------------------------------------------------- /themes/demons-ladder/layouts/partials/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | {{ .Title }} | {{ .Site.Title }} 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 21 | 22 | 23 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 49 |
50 |
51 |
52 |

{{ .Site.Title }}

53 |

{{ .Site.Params.subtitle }}

54 |
55 |
56 | 63 |
64 |
65 |
66 | -------------------------------------------------------------------------------- /content/post/ss.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-11-05T23:24:52+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "ss" 10 | tags = ["vps"] 11 | title = "自购VPS搭建Shadowsocks服务器" 12 | 13 | +++ 14 | 好多丧尸都在求指导 我觉得还是写一篇教程比较好(=゚ω゚)= 15 | 16 | 首先是vps的购买 网上有很多指导挑选vps的网站 丧尸们可以挑选一款适合自己的 我用的是cheapvz的洛杉矶vps 年付75人民币 支持支付宝付款 17 | 18 | 1. 单核cpu 19 | 2. 256mb内存 15G硬盘 20 | 3. 100Mbps带宽 21 | 4. 每月500G流量 22 | 23 | 这个价格能买到这种配置也不错了 架个ss 开个小网站还是没问题的 24 | 25 | 下面是购买的步骤 26 | 27 | 首先麻烦丧尸们先访问一下我的推荐链接 这样你们购买了之后我还能获得一点佣金 28 | [https://www.cheapvz.com/aff.php?aff=42][2] 29 | 30 | 然后这是选购的链接 先把币种切换成CNY 也就是人民币 然后点击立即购买就行啦 31 | [https://www.cheapvz.com/cart.php?gid=2][3] 32 | 33 | 之后就是填写一些表格 这里我只对某些选项说明一下 其他的大家一看就懂 34 | 首先是 35 | ![1.jpg](https://dn-4679kun.qbox.me/pic/ss/1.jpg) 36 | 第一项是服务器名 大家随便取一个就行 我的是4679-vps 37 | 第二项和第三项就填 ns1 ns2 38 | 第四项root密码 之后登录服务器的时候会用到 39 | 40 | 之后是选择操作系统 41 | ![2.jpg](https://dn-4679kun.qbox.me/pic/ss/2.jpg) 42 | 第二项就是选择操作系统了 我用的是ubuntu_14.04 x86_64 43 | 建议大家也选择这个 因为下文用到的一键安装脚本是用于ubuntu和debian的 44 | 45 | 其他填好之后就是结账了 46 | ![3.jpg](https://dn-4679kun.qbox.me/pic/ss/3.jpg) 47 | 付款完成以后 48 | ![4.jpg](https://dn-4679kun.qbox.me/pic/ss/4.jpg) 49 | 稍等一会 你的邮箱里就会收到一封邮件 里面就有你的vps的ip地址啦 50 | 51 | 接下来下载putty 用来连接服务器 52 | [https://github.com/larryli/PuTTY/releases/download/putty-0.65cn/putty-0.65cn.zip][8] 53 | 下载完成后解压 打开putty.exe 54 | ![5.jpg](https://dn-4679kun.qbox.me/pic/ss/5.jpg) 55 | 在主机名称处填入ip 然后点击打开 56 | 之后会出现一个命令行窗口 显示 login as: 57 | 输入root 回车 之后是输入刚才设定的root密码 输入的时候是没有显示的 输入完回车就行 58 | 59 | 不出意外的话 就能连接上服务器了 60 | ![6.jpg](https://dn-4679kun.qbox.me/pic/ss/6.jpg) 61 | 62 | 现在就可以安装shadowsocks了 63 | 我使用的是秋水逸冰大大的一键安装脚本 [原文地址][11] 64 | 65 | 首先安装依赖(复制之后点击右键就是粘贴) 66 | ```bash 67 | apt-get install build-essential autoconf libtool libssl-dev gawk debhelper 68 | ``` 69 | 输入y 确认安装 70 | 71 | 然后输入第一条命令 72 | ```bash 73 | wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev-debian.sh 74 | ``` 75 | 完成以后输入第二条 76 | ```bash 77 | chmod +x shadowsocks-libev-debian.sh 78 | ``` 79 | 之后是第三条 80 | ```bash 81 | ./shadowsocks-libev-debian.sh 2>&1 | tee shadowsocks-libev-debian.log 82 | ``` 83 | 输入第三条命令以后 会提示设置ss的密码 84 | ![7.jpg](https://dn-4679kun.qbox.me/pic/ss/7.jpg) 85 | 输入密码然后回车 86 | 之后是设置端口 87 | 输入要设置的端口号然后回车 88 | 89 | 之后就会开始安装了 90 | ![8.jpg](https://dn-4679kun.qbox.me/pic/ss/8.jpg) 91 | 92 | 等待 安装完成后系统就会给出服务器的地址 端口 密码 加密方式 你就有属于自己的ss服务器了 93 | 94 | 完结撒花(^o^)ノ请原谅我全程没用一个标点 95 | 96 | 97 | [1]: https://dn-4679kun.qbox.me/2015/10/3036577624.png?imageView2/2/q/85/format/jpg 98 | [2]: https://www.cheapvz.com/aff.php?aff=42 99 | [3]: https://www.cheapvz.com/cart.php?gid=2 100 | [4]: https://dn-4679kun.qbox.me/2015/10/3544733802.png?imageView2/2/q/85/format/jpg 101 | [5]: https://dn-4679kun.qbox.me/2015/10/230150148.png?imageView2/2/q/85/format/jpg 102 | [6]: https://dn-4679kun.qbox.me/2015/10/2193416289.png?imageView2/2/q/85/format/jpg 103 | [7]: https://dn-4679kun.qbox.me/2015/10/1113179179.png?imageView2/2/q/85/format/jpg 104 | [8]: https://github.com/larryli/PuTTY/releases/download/putty-0.65cn/putty-0.65cn.zip 105 | [9]: https://dn-4679kun.qbox.me/2015/10/3378522319.png?imageView2/2/q/85/format/jpg 106 | [10]: https://dn-4679kun.qbox.me/2015/10/23040430.png?imageView2/2/q/85/format/jpg 107 | [11]: https://teddysun.com/358.html 108 | [12]: https://dn-4679kun.qbox.me/2015/10/3543099494.png?imageView2/2/q/85/format/jpg 109 | [13]: https://dn-4679kun.qbox.me/2015/10/3798456288.png?imageView2/2/q/85/format/jpg 110 | 111 | -------------------------------------------------------------------------------- /content/post/h2o.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "4679kun" 3 | comments = true 4 | date = "2015-12-05T12:20:53+08:00" 5 | draft = false 6 | image = "" 7 | menu = "" 8 | share = true 9 | slug = "h2o" 10 | tags = ["blog"] 11 | title = "服务器后端切换到H2O" 12 | 13 | +++ 14 | H2O是一款轻量 配置简单的HTTP服务器 特色就是HTTP/2 15 | 16 | Archlinux用户直接从AUR安装就可以了 17 | 其他系统请自行寻找源或者编译安装 18 | 19 | 下面是我的配置文件 可以当个示范 20 | ```YAML 21 | access-log: /dev/null 22 | error-log: /dev/null 23 | pid-file: /var/run/h2o.pid 24 | max-connections: 51200 25 | file.send-gzip: ON 26 | tcp-fastopen: 3 27 | user: www 28 | http2-reprioritize-blocking-assets: ON 29 | file.index: [ 'index.php', 'index.html' ] 30 | file.mime.addtypes: 31 | text/html: .html .htm .shtml 32 | text/css: .css 33 | text/xml: .xml 34 | image/gif: .gif 35 | image/jpeg: .jpeg .jpg 36 | application/javascript: .js 37 | application/atom+xml: .atom 38 | application/rss+xml: .rss 39 | 40 | text/mathml: .mml 41 | text/plain: .txt 42 | text/vnd.sun.j2me.app-descriptor: .jad 43 | text/vnd.wap.wml: .wml 44 | text/x-component: .htc 45 | 46 | image/png: .png 47 | image/tiff: .tif .tiff 48 | image/vnd.wap.wbmp: .wbmp 49 | image/x-icon: .ico 50 | image/x-jng: .jng 51 | image/x-ms-bmp: .bmp 52 | image/svg+xml: .svg .svgz 53 | image/webp: .webp 54 | 55 | application/font-woff: .woff 56 | application/java-archive: .jar .war .ear 57 | application/json: .json 58 | application/mac-binhex40: .hqx 59 | application/msword: .doc 60 | application/pdf: .pdf 61 | application/postscript: .ps .eps .ai 62 | application/rtf: .rtf 63 | application/vnd.apple.mpegurl: .m3u8 64 | application/vnd.ms-excel: .xls 65 | application/vnd.ms-fontobject: .eot 66 | application/vnd.ms-powerpoint: .ppt 67 | application/vnd.wap.wmlc: .wmlc 68 | application/vnd.google-earth.kml+xml: .kml 69 | application/vnd.google-earth.kmz: .kmz 70 | application/x-7z-compressed: .7z 71 | application/x-cocoa: .cco 72 | application/x-java-archive-diff: .jardiff 73 | application/x-java-jnlp-file: .jnlp 74 | application/x-makeself: .run 75 | application/x-perl: .pl .pm 76 | application/x-pilot: .prc .pdb 77 | application/x-rar-compressed: .rar 78 | application/x-redhat-package-manager: .rpm 79 | application/x-sea: .sea 80 | application/x-shockwave-flash: .swf 81 | application/x-stuffit: .sit 82 | application/x-tcl: .tcl .tk 83 | application/x-x509-ca-cert: .der .pem .crt 84 | application/x-xpinstall: .xpi 85 | application/xhtml+xml: .xhtml 86 | application/xspf+xml: .xspf 87 | application/zip: .zip 88 | 89 | application/octet-stream: .bin .exe .dll 90 | application/octet-stream: .deb 91 | application/octet-stream: .dmg 92 | application/octet-stream: .iso .img 93 | application/octet-stream: .msi .msp .msm 94 | 95 | application/vnd.openxmlformats-officedocument.wordprocessingml.document: .docx 96 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: .xlsx 97 | application/vnd.openxmlformats-officedocument.presentationml.presentation: .pptx 98 | 99 | audio/midi: .mid .midi .kar 100 | audio/mpeg: .mp3 101 | audio/ogg: .ogg 102 | audio/x-m4a: .m4a 103 | audio/x-realaudio: .ra 104 | 105 | video/3gpp: .3gpp .3gp 106 | video/mp2t: .ts 107 | video/mp4: .mp4 108 | video/mpeg: .mpeg .mpg 109 | video/quicktime: .mov 110 | video/webm: .webm 111 | video/x-flv: .flv 112 | video/x-m4v: .m4v 113 | video/x-mng: .mng 114 | video/x-ms-asf: .asx .asf 115 | video/x-ms-wmv: .wmv 116 | video/x-msvideo: .avi 117 | 118 | hosts: 119 | "4679.space:443": 120 | header.add: "strict-transport-security: max-age=39420000; includesubdomains; preload" 121 | header.add: "X-Frame-Options: SAMEORIGIN" 122 | header.add: "X-Content-Type-Options: nosniff" 123 | header.add: "X-XSS-Protection: 1; mode=block" 124 | listen: 125 | port: 443 126 | ssl: 127 | certificate-file: /etc/letsencrypt/live/4679.space/fullchain.pem 128 | key-file: /etc/letsencrypt/live/4679.space/privkey.pem 129 | dh-file: /etc/ssl/certs/dhparam2048.pem 130 | minimum-version: TLSv1 131 | cipher-preference: server 132 | cipher-suite: CHACHA20 EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4 133 | paths: 134 | /: 135 | file.dir: /home/www/ 136 | 137 | "4679.space:80": 138 | listen: 139 | port: 80 140 | paths: 141 | /: 142 | redirect: 143 | status: 301 144 | url: "https://4679.space/" 145 | 146 | ``` 147 | 148 | 149 | -------------------------------------------------------------------------------- /themes/demons-ladder/static/css/theme.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #262626; 3 | font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; 4 | font-size: 14px; 5 | color: #bebebe; 6 | line-height: 1.6em; 7 | letter-spacing: 0.5px; 8 | } 9 | .container { 10 | padding: 0 20px; 11 | } 12 | h1 { 13 | font-size: 19px; 14 | } 15 | h2 { 16 | font-size: 17px; 17 | } 18 | h3, 19 | h4, 20 | h5, 21 | h6 { 22 | font-size: 16px; 23 | } 24 | header a, 25 | header a:visited, 26 | main#index a, 27 | main#index a:visited, 28 | main#list a, 29 | main#list a:visited, 30 | nav a, 31 | nav a:visited { 32 | color: #bebebe; 33 | } 34 | article a, 35 | article a:visited, 36 | footer a, 37 | article a:visited { 38 | color: #f44336; 39 | } 40 | header a:hover, 41 | article a:hover, 42 | main#index a:hover, 43 | main#list a:hover, 44 | nav a:hover { 45 | color: #f44336; 46 | } 47 | main#index .meta a, 48 | main#list .meta a, 49 | main#single .meta a { 50 | color: #b4b4b4; 51 | } 52 | main#index .meta a:hover, 53 | main#list .meta a:hover, 54 | main#single .meta a:hover { 55 | color: #f44336; 56 | } 57 | article a:hover, 58 | footer a:hover { 59 | text-decoration: underline; 60 | } 61 | ul, 62 | ol { 63 | margin-left: 30px; 64 | } 65 | pre { 66 | margin: 25px 0; 67 | } 68 | table { 69 | border: 1px solid #ccc; 70 | margin: 25px 0; 71 | } 72 | th { 73 | background-color: #383838; 74 | border: 1px solid #ccc; 75 | padding: 2px 10px; 76 | } 77 | td { 78 | border: 1px solid #ccc; 79 | padding: 2px 10px; 80 | } 81 | img { 82 | max-width: 100%; 83 | height: auto; 84 | border: 0; 85 | vertical-align: middle; 86 | } 87 | header { 88 | padding: 20px 0; 89 | margin-bottom: 20px; 90 | } 91 | header h2 { 92 | font-size: 12px; 93 | } 94 | header #social { 95 | text-align: right; 96 | } 97 | header #social ul { 98 | font-size: 0; 99 | margin: 0; 100 | } 101 | header #social li { 102 | display: inline-block; 103 | font-size: 12px; 104 | padding: 0 10px; 105 | } 106 | header #social li:first-child { 107 | padding-left: 0; 108 | } 109 | header #social li + li { 110 | border-left: 1px solid #ccc; 111 | } 112 | header #social li:last-child { 113 | padding-right: 0; 114 | } 115 | @media (max-width: 767px) { 116 | header h1, 117 | header h2 { 118 | width: 100%; 119 | text-align: center; 120 | } 121 | } 122 | @media (max-width: 767px) { 123 | header #social { 124 | margin-top: 20px; 125 | text-align: center; 126 | } 127 | } 128 | nav ul.pagination { 129 | font-size: 0; 130 | text-align: center; 131 | margin: 0; 132 | } 133 | nav ul.pagination li { 134 | display: inline-block; 135 | font-size: 14px; 136 | border: 1px solid #ccc; 137 | background-color: #383838; 138 | padding: 3px 10px; 139 | margin: 0 3px; 140 | } 141 | nav ul.pagination li.active { 142 | border: 2px solid #f44336; 143 | } 144 | nav ul.pagination li:hover { 145 | border-color: #f44336; 146 | } 147 | nav.pagination-single { 148 | padding: 20px 0 20px 0; 149 | overflow: hidden; 150 | } 151 | nav.pagination-single span.previous { 152 | float: left; 153 | padding: 10px 0 10px 0; 154 | max-width: 300px; 155 | } 156 | nav.pagination-single span.next { 157 | float: right; 158 | padding: 10px 0 10px 0; 159 | max-width: 300px; 160 | } 161 | nav.pagination-single a { 162 | color: #f44336; 163 | } 164 | #single aside { 165 | margin-top: 80px; 166 | } 167 | footer { 168 | margin: 80px 0; 169 | padding: 20px 0; 170 | } 171 | footer img { 172 | border-radius: 32px; 173 | -webkit-border-radius: 32px; 174 | -moz-border-radius: 32px; 175 | margin-bottom: 10px; 176 | } 177 | @media (max-width: 767px) { 178 | footer { 179 | margin: 40px 0; 180 | } 181 | } 182 | article h1 { 183 | margin: 50px 0 25px 0; 184 | } 185 | article h2 { 186 | border-bottom: 2px solid #646464; 187 | margin: 50px 0 25px 0; 188 | padding-bottom: 10px; 189 | } 190 | article h3, 191 | article h4, 192 | article h5, 193 | article h6 { 194 | margin: 40px 0 25px 0; 195 | } 196 | article p { 197 | margin: 25px 0; 198 | } 199 | article code { 200 | color: #333; 201 | background-color: #383838; 202 | padding: 0 3px; 203 | margin: 0 3px; 204 | border: 1px solid #ccc; 205 | font-family: consolas, "Courier New", monospace; 206 | } 207 | article pre code { 208 | font-family: consolas, "Courier New", monospace; 209 | } 210 | article blockquote { 211 | margin: 25px 0; 212 | padding-left: 20px; 213 | border-left: 4px solid #ccc; 214 | font-style: italic; 215 | } 216 | article img { 217 | display: block; 218 | margin: 0 auto; 219 | text-align: center; 220 | } 221 | article #share-this { 222 | margin: 40px 0 40px 0; 223 | } 224 | .article-header { 225 | border-left: 4px solid #f44336; 226 | margin: 10px 0 25px -4px; 227 | padding: 5px 0 5px 10px; 228 | } 229 | .light-gray { 230 | color: #b4b4b4; 231 | } 232 | .summary { 233 | padding-bottom: 20px; 234 | margin-bottom: 20px; 235 | border-bottom: 1px solid #646464; 236 | } 237 | .meta { 238 | color: #b4b4b4; 239 | font-size: 12px; 240 | } 241 | -------------------------------------------------------------------------------- /themes/demons-ladder/static/css/theme.less: -------------------------------------------------------------------------------- 1 | /* Theme color 2 | --------------------------------------------------*/ 3 | @color: #29abe2; 4 | 5 | 6 | /* Basic 7 | --------------------------------------------------*/ 8 | body{ 9 | background-color: #fff; 10 | font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; 11 | font-size: 14px; 12 | color: #666; 13 | line-height: 1.6em; 14 | letter-spacing: 0.5px; 15 | } 16 | 17 | .container{ 18 | padding: 0 20px; 19 | } 20 | 21 | h1{font-size: 19px;} 22 | h2{font-size: 17px;} 23 | h3, 24 | h4, 25 | h5, 26 | h6{font-size: 16px;} 27 | 28 | header a, header a:visited, 29 | main#index a, main#index a:visited, 30 | main#list a, main#list a:visited, 31 | nav a, nav a:visited{ color: #666; } 32 | 33 | article a, article a:visited, 34 | footer a, article a:visited{ color: @color; } 35 | 36 | header a:hover, 37 | article a:hover, 38 | main#index a:hover, 39 | main#list a:hover, 40 | nav a:hover{ color: @color; } 41 | 42 | main#index .meta a, 43 | main#list .meta a, 44 | main#single .meta a{ color: #999; } 45 | 46 | main#index .meta a:hover, 47 | main#list .meta a:hover, 48 | main#single .meta a:hover{ color: @color; } 49 | 50 | article a:hover, 51 | footer a:hover{ text-decoration: underline; } 52 | 53 | ul, ol{ 54 | margin-left: 30px; 55 | } 56 | 57 | pre{ 58 | margin: 25px 0; 59 | } 60 | 61 | table{ 62 | border: 1px solid #ccc; 63 | margin: 25px 0; 64 | } 65 | 66 | th{ 67 | background-color: #eee; 68 | border: 1px solid #ccc; 69 | padding: 2px 10px; 70 | } 71 | 72 | td{ 73 | border: 1px solid #ccc; 74 | padding: 2px 10px; 75 | } 76 | 77 | img{ 78 | max-width: 100%; 79 | height: auto; 80 | border: 0; 81 | vertical-align: middle; 82 | } 83 | 84 | 85 | 86 | 87 | /* Header 88 | --------------------------------------------------*/ 89 | header{ 90 | padding: 20px 0; 91 | margin-bottom: 20px; 92 | } 93 | 94 | header h2{ 95 | font-size: 12px; 96 | } 97 | 98 | header #social{ 99 | text-align: right; 100 | } 101 | 102 | header #social ul{ 103 | font-size: 0; 104 | margin: 0; 105 | } 106 | 107 | header #social li{ 108 | display: inline-block; 109 | font-size: 12px; 110 | padding: 0 10px; 111 | } 112 | 113 | header #social li:first-child{ 114 | padding-left: 0; 115 | } 116 | 117 | header #social li + li{ 118 | border-left: 1px solid #ccc; 119 | } 120 | 121 | header #social li:last-child{ 122 | padding-right: 0; 123 | } 124 | 125 | @media (max-width: 767px) { 126 | header h1, header h2{ 127 | width: 100%; 128 | text-align: center; 129 | } 130 | } 131 | 132 | @media (max-width: 767px) { 133 | header #social{ 134 | margin-top: 20px; 135 | text-align: center; 136 | } 137 | } 138 | 139 | 140 | 141 | 142 | /* Pager (for List Page) 143 | --------------------------------------------------*/ 144 | nav ul.pagination{ 145 | font-size: 0; 146 | text-align: center; 147 | margin: 0; 148 | } 149 | 150 | nav ul.pagination li{ 151 | display: inline-block; 152 | font-size: 14px; 153 | border: 1px solid #ccc; 154 | background-color: #eee; 155 | padding: 3px 10px; 156 | margin: 0 3px; 157 | } 158 | 159 | nav ul.pagination li.active{ 160 | border: 2px solid @color; 161 | } 162 | 163 | nav ul.pagination li:hover{ 164 | border-color: @color; 165 | } 166 | 167 | 168 | /* Pager (for Single Page) 169 | --------------------------------------------------*/ 170 | .pagination-single-span(@float) { 171 | float: @float; 172 | padding: 10px 0 10px 0; 173 | max-width: 300px; 174 | } 175 | 176 | nav.pagination-single { 177 | padding: 20px 0 20px 0; 178 | overflow: hidden; 179 | } 180 | 181 | nav.pagination-single span.previous { 182 | .pagination-single-span(left); 183 | } 184 | 185 | nav.pagination-single span.next { 186 | .pagination-single-span(right); 187 | } 188 | 189 | nav.pagination-single a { 190 | color: @color; 191 | } 192 | 193 | 194 | /* Comment 195 | --------------------------------------------------*/ 196 | #single aside{ 197 | margin-top: 80px; 198 | } 199 | 200 | 201 | /* Footer 202 | --------------------------------------------------*/ 203 | footer{ 204 | margin: 80px 0; 205 | padding: 20px 0; 206 | } 207 | 208 | footer img{ 209 | border-radius: 32px; 210 | -webkit-border-radius: 32px; 211 | -moz-border-radius: 32px; 212 | margin-bottom: 10px; 213 | } 214 | 215 | @media (max-width: 767px) { 216 | footer{ 217 | margin: 40px 0; 218 | } 219 | } 220 | 221 | 222 | 223 | 224 | /* Single Page 225 | --------------------------------------------------*/ 226 | article h1{ 227 | margin: 50px 0 25px 0; 228 | } 229 | 230 | article h2{ 231 | border-bottom: 2px solid #ddd; 232 | margin: 50px 0 25px 0; 233 | padding-bottom: 10px; 234 | } 235 | 236 | article h3, 237 | article h4, 238 | article h5, 239 | article h6{ 240 | margin: 40px 0 25px 0; 241 | } 242 | 243 | article p{ 244 | margin: 25px 0; 245 | } 246 | 247 | article code{ 248 | color: #333; 249 | background-color: #eee; 250 | padding: 0 3px; 251 | margin: 0 3px; 252 | border: 1px solid #ccc; 253 | font-family: consolas, "Courier New", monospace; 254 | } 255 | 256 | article pre code{ 257 | font-family: consolas, "Courier New", monospace; 258 | } 259 | 260 | 261 | article blockquote{ 262 | margin: 25px 0; 263 | padding-left: 20px; 264 | border-left: 4px solid #ccc; 265 | font-style: italic; 266 | } 267 | 268 | article img { 269 | display: block; 270 | margin: 0 auto; 271 | text-align: center; 272 | } 273 | 274 | article #share-this { 275 | margin: 40px 0 40px 0; 276 | } 277 | 278 | 279 | /* Common 280 | --------------------------------------------------*/ 281 | .article-header{ 282 | border-left: 4px solid @color; 283 | margin: 10px 0 25px -4px; 284 | padding: 5px 0 5px 10px; 285 | } 286 | 287 | .light-gray{ 288 | color: #999; 289 | } 290 | 291 | .summary{ 292 | padding-bottom: 20px; 293 | margin-bottom: 20px; 294 | border-bottom: 1px solid #ddd; 295 | } 296 | 297 | .meta{ 298 | color: #999; 299 | font-size: 12px; 300 | } 301 | -------------------------------------------------------------------------------- /libs/markdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # uncomment the following two lines if you have both BSD sed and GNU sed installed 4 | # this script is only tested to work with GNU sed which may have the command gsed 5 | # shopt -s expand_aliases 6 | # alias sed=gsed 7 | 8 | # move the original text to a temp file that can be progressively modified 9 | temp_file="/tmp/markdown.$$" 10 | cat "$@" > "$temp_file" 11 | 12 | # All of this below business is for reference-style links and images 13 | # We need to loop across newlines and not spaces 14 | IFS=' 15 | ' 16 | refs=$(sed -nr "/^\[.+\]: +/p" "$@") 17 | for ref in $refs 18 | do 19 | ref_id=$(echo -n "$ref" | sed -nr "s/^\[(.+)\]: .*/\1/p" | tr -d '\n') 20 | ref_url=$(echo -n "$ref" | sed -nr "s/^\[.+\]: (.+)/\1/p" | cut -d' ' -f1 | tr -d '\n') 21 | ref_title=$(echo -n "$ref" | sed -nr "s/^\[.+\]: (.+) \"(.+)\"/\2/p" | sed 's@|@!@g' | tr -d '\n') 22 | 23 | # reference-style image using the label 24 | sed -ri "s|!\[([^]]+)\]\[($ref_id)\]|\"\1\"|gI" "$temp_file" 25 | # reference-style link using the label 26 | sed -ri "s|\[([^]]+)\]\[($ref_id)\]|\1|gI" "$temp_file" 27 | 28 | # implicit reference-style 29 | sed -ri "s|!\[($ref_id)\]\[\]|\"\1\"|gI" "$temp_file" 30 | # implicit reference-style 31 | sed -ri "s|\[($ref_id)\]\[\]|\1|gI" "$temp_file" 32 | done 33 | 34 | # delete the reference lines 35 | sed -ri "/^\[.+\]: +/d" "$temp_file" 36 | 37 | # blockquotes 38 | # use grep to find all the nested blockquotes 39 | while grep '^> ' "$temp_file" >/dev/null 40 | do 41 | sed -nri ' 42 | /^$/b blockquote 43 | 44 | H 45 | $ b blockquote 46 | b 47 | 48 | :blockquote 49 | x 50 | s/(\n+)(> .*)/\1
\n\2\n<\/blockquote>/ # wrap the tags in a blockquote 51 | p 52 | ' "$temp_file" 53 | 54 | sed -i '1 d' "$temp_file" # cleanup superfluous first line 55 | 56 | # cleanup blank lines and remove subsequent blockquote characters 57 | sed -ri ' 58 | /^> /s/^> (.*)/\1/ 59 | ' "$temp_file" 60 | done 61 | 62 | # Setext-style headers 63 | sed -nri ' 64 | # Setext-style headers need to be wrapped around newlines 65 | /^$/ b print 66 | 67 | # else, append to holding area 68 | H 69 | $ b print 70 | b 71 | 72 | :print 73 | x 74 | /=+$/{ 75 | s/\n(.*)\n=+$/\n

\1<\/h1>/ 76 | p 77 | b 78 | } 79 | /\-+$/{ 80 | s/\n(.*)\n\-+$/\n

\1<\/h2>/ 81 | p 82 | b 83 | } 84 | p 85 | ' "$temp_file" 86 | 87 | sed -i '1 d' "$temp_file" # cleanup superfluous first line 88 | 89 | # atx-style headers and other block styles 90 | sed -ri ' 91 | /^#+ /s/ #+$// # kill all ending header characters 92 | /^# /s/# (.*)/

\1<\/h1>/g # H1 93 | /^#{2} /s/#{2} (.*)/

\1<\/h2>/g # H2 94 | /^#{3} /s/#{3} (.*)/

\1<\/h3>/g # H3 95 | /^#{4} /s/#{4} (.*)/

\1<\/h4>/g # H4 96 | /^#{5} /s/#{5} (.*)/

\1<\/h5>/g # H5 97 | /^#{6} /s/#{6} (.*)/
\1<\/h6>/g # H6 98 | 99 | /^\*\*\*+$/s/\*\*\*+/
/ # hr with * 100 | /^---+$/s/---+/
/ # hr with - 101 | /^___+$/s/___+/
/ # hr with _ 102 | 103 | ' "$temp_file" 104 | 105 | # unordered lists 106 | # use grep to find all the nested lists 107 | while grep '^[\*\+\-] ' "$temp_file" >/dev/null 108 | do 109 | sed -nri ' 110 | # wrap the list 111 | /^$/b list 112 | 113 | # wrap the li tags then add to the hold buffer 114 | # use uli instead of li to avoid collisions when processing nested lists 115 | /^[\*\+\-] /s/[\*\+\-] (.*)/<\/uli>\n\n\1/ 116 | 117 | H 118 | $ b list # if at end of file, check for the end of a list 119 | b # else, branch to the end of the script 120 | 121 | # this is where a list is checked for the pattern 122 | :list 123 | # exchange the hold space into the pattern space 124 | x 125 | # look for the list items, if there wrap the ul tags 126 | //{ 127 | s/(.*)/\n