Hanjie's Blog

一只有理想的羊驼

选择 Scheme

在主题_config.yml文件中修改scheme: Pisces的值。

菜单设置

在主题_config.yml文件中修改:

1
2
3
4
5
6
menu:
home: /
categories: /categories
archives: /archives
tags: /tags
about: /about

代码高亮

在网站_config.yml文件中,设置auto_detect: true

开启第三方评论

disqus注册一个账号,并且Set up disqus on a new site。这时需要Choose your unique Disqus URL,记下你填下的disqus_shortname,在网站_config.yml文件中添加:

1
disqus_shortname: your-disqus-shortname

如需取消某个页面的评论,在md文件的front-matter中增加[^7]:

1
comments: false

社交信息

网站_config.yml文件中添加:

1
2
3
4
5
6
7
since: 2016
social:
github: https://github.com/HanjieLuo
# twitter: https://twitter.com/your-user-name
# weibo: http://weibo.com/your-user-name
# douban: http://douban.com/people/your-user-name
# zhihu: http://www.zhihu.com/people/your-user-name

自定义字体

编辑主题的 source/css/_variables/custom.styl文件,新增变量:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$font-family-headings = Baskerville, Georgia, "Liberation Serif", "Kaiti SC", STKaiti, "AR PL UKai CN", "AR PL UKai HK", "AR PL UKai TW", "AR PL UKai TW MBE", "AR PL KaitiM GB", KaiTi, KaiTi_GB2312, "TW\-Kai", Lato, "PingFang SC", "Microsoft YaHei", sans-serif, "Times New Roman", serif; // 标题,修改成你期望的字体族

$font-family-base = askerville, Georgia, "Liberation Serif", "Kaiti SC", STKaiti, "AR PL UKai CN", "AR PL UKai HK", "AR PL UKai TW", "AR PL UKai TW MBE", "AR PL KaitiM GB", KaiTi, KaiTi_GB2312, "TW\-Kai", Lato, "PingFang SC", "Microsoft YaHei", sans-serif; // 修改成你期望的字体族

$code-font-family = "Input Mono", "PT Mono", Consolas, Monaco, Menlo, monospace // 代码字体

// Font size
$font-size-base = 16px // 正文字体的大小
$font-size-small = $font-size-base - 2px
$font-size-smaller = $font-size-base - 4px
$font-size-large = $font-size-base + 4px

// Headings font size
$font-size-headings-base = 28px
$font-size-headings-step = 2px

$code-font-size = 13px // 代码字体的大小

其他的可参看base.styl文件。

将侧边栏头像修改为圆形1

修改_sidebar.styl,增加两段程序:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.site-author-image {
display: block;
margin: 0 auto;
max-width: 96px;
height: auto;
padding: 2px;
border-width: 1px;
border-color: $gainsboro;

/* start*/
border-radius: 50%
webkit-transition: 1.4s all;
moz-transition: 1.4s all;
ms-transition: 1.4s all;
transition: 1.4s all;
/* end */
}


  1. http://fancyluo.com/2015/09/18/2015-09-18-hexo-next-update/↩︎

首先需要在GitHub上下载Hexo的源代码,然后安装:

1
2
3
hexo init
npm install hexo
npm install -g

安装调试程序:

1
npm install -g node-inspector

输入 node-inspector 启动调试工具,然后1

1
node --debug-brk=5858 node_modules/.bin/hexo generate

调试工具会监听5858端口。然后打开一个新的终端,输入2

1
node-inspector

打开Chrome输入http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858,脚本现在就已经断点在了第一行3


  1. http://stackoverflow.com/questions/30942953/how-can-i-debug-a-node-app-that-is-started-via-the-command-line-cli-like-forev↩︎

  2. http://blog.domlib.com/articles/686.html↩︎

  3. http://xzper.com/2014/08/17/浅析Hexo的Generate命令/↩︎

系统配置1

系统内核
1
uname -r

内核必须要至少3.5.0版本。

Dependences
1
2
3
4
5
6
7
8
# Ubuntu 16.04
sudo apt-get install libraw1394-11 libgtkmm-2.4-1v5 libglademm-2.4-1v5 libgtkglextmm-x11-1.2-dev libgtkglextmm-x11-1.2 libusb-1.0-0

# Ubuntu 14.04
sudo apt-get install libraw1394-11 libgtkmm-2.4-1v5 libglademm-2.4-1v5 libgtkglextmm-x11-1.2-dev libgtkglextmm-x11-1.2 libusb-1.0-0

# Ubuntu 12.04
sudo apt-get install libgtkmm-2.4-dev libglademm-2.4-dev libusb-1.0-0
系统设置
1
sudo gedit /etc/default/grub

1
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

替换为

1
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.usbfs_memory_mb=1000"

保存后执行:

1
sudo update-grub

重启,然后运行下指令测试:

1
cat /sys/module/usbcore/parameters/usbfs_memory_mb

安装FlyCapture SDK

For 14.04:

1
2
3
4
5
cd tools/flycapture2-2.9.3.43-amd64

sudo apt-get install libraw1394-11 libgtkmm-2.4-1c2a libglademm-2.4-1c2a libgtkglextmm-x11-1.2-dev libgtkglextmm-x11-1.2 libusb-1.0-0 libglademm-2.4-dev

sudo sh install_flycapture.sh

For 16.04:

1
2
3
4
5
6
7
8
cd tools/flycapture2-2.11.3.164-amd64

sudo apt-get install libraw1394-11 libavcodec-ffmpeg56 \
libavformat-ffmpeg56 libswscale-ffmpeg3 libswresample-ffmpeg1 \
libavutil-ffmpeg54 libgtkmm-2.4-dev libglademm-2.4-dev \
libgtkglextmm-x11-1.2-dev libusb-1.0-0

sudo sh install_flycapture.sh

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
Would you like to add a udev entry to allow access to IEEE-1394 and USB hardware?
If this is not ran then your cameras may be only accessible by running flycap as sudo.
(y/n)$ y
Launching conf script

This script will assist users in configuring their udev rules to allow
access to 1394 and USB devices. The script will create a udev rule which
will add the 1394 cards and USB devices to a group called pgrimaging.
The user may also choose to restart the udev daemon. All of this can be done
manually as well. Please note that this script will change the permissions
for all IEEE1394 devices including hard drives and web cams. It will allow
the user to read and modify data on any IEEE1394 device.


Enter the name of the user to add to this user group.
$ yourusername
Is this user name ok?: yourusername
(y/n)$ y

Add user yourusername to group pgrimaging.
Is this ok?:
(y/n)$ y

Writing the udev rules file.

Do you want to restart the udev daemon?
(y/n)$ y
udev stop/waiting
udev start/running, process 5764

Configuration complete. A reboot may be required on some systems for changes to take effect

Complete

运行测试

1
flycap
flycap

  1. https://www.ptgrey.com/tan/10685↩︎

0%