博文

Hexo博客配置

树莓派Hexo博客配置 关于Hexo Hexo是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。 安装Hexo Hexo基于nodejs,同时需要git,已安装则可以跳过 sudo apt update audo apt install nodejs git npm npm install -g hexo-cli 进入欲安装的文件夹 hexo init blog #其中blog为欲安装的文件夹名称,将在子目录下创建该文件夹 cd blog npm install hexo server 至此安装完毕,可以通过访问 http://localhost:4000 访问博客了,也可以通过其他计算机访问该计算机IP+4000端口来访问 Hexo 主题 Hexo提供了众多主题供选择,可以使用一款material design主题 indigo 写作 Hexo采用markdown渲染,只需要将写好的文件放入 /source/_post 文件夹中即可,不过这样并不会产生标题,如果需要产生主题,作者,标签等等内容,需要在首行添加以下内容: --- title: your title author: Jiang dates: 2016-10-21 tags: --- ​

Django建站

Django建站 Django 是由 Python 开发的一个免费的开源网站框架,可以用于快速搭建高性能,优雅的网站! 1.环境搭建 需要先安装pip sudo apt install python-pip 安装python3版本的pip sudo apt install python3-pip 安装Django pip安装方法 pip install Django python3安装 pip3 install Django 或者用apt安装 sudo apt install python-django 检查是否安装成功,进入python shell模式 >>> import django >>> django.VERSION (1, 8, 7, 'final', 0) >>> 显示版本号安装成功。 TODO:多个互不干扰的环境。 2.创建django工程 django-admin startproject hello 会创建hello目录,进入hello目录可以看到结构如下 . ├── hello │ ├── __init__.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── manage.py hello为工程名,manage.py为管理工具,settings.py是工程的相关设置,包括数据库与安装的app等设置,urls.py为网站页面的相关映射,将python相关函数映射为网址。 3.新建app python manage.py startapp index 此时目录结构如下 . ├── hello │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-35.pyc │ │ └── settings.cpython-35.pyc │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── index │ ├── admin.py │ ├── __init__.py │ ├── mig...

CMake入门

关于CMake CMake 是一个跨平台的自动化建构系统,它使用一个名为 CMakeLists.txt 的文件来描述构建过程,可以产生标准的构建文件,如 Unix 的 Makefile 或Windows Visual C++ 的 projects/workspaces 。文件 CMakeLists.txt 需要手工编写,也可以通过编写脚本进行半自动的生成。CMake 提供了比 autoconfig 更简洁的语法。 CMake Wiki 安装CMake cmake包含在ubunu源中,直接apt安装即可 sudo apt install cmake 使用CMake 网上下载的许多项目都需要CMake来编译,进入项目文件夹 mkdir build cd build cmake .. make 至此,已能运行,如果需要安装进系统中,则可以执行 sudo make install 使用CMake来构建项目 使用CMake的目录结构可以如下,每个目录下均需要一个CMakeLists.txt文件: ---project ------lib ---------a.c ---------b.c ---------CMakeLists.txt ------include ---------a.h ---------b.h ---------CMakeLists.txt ---main.c ---CMakeLists.txt 其中最上层CMakeLists.txt文件内容如下: #项目名称 project(main) #需要的CMake最低版本 cmake_minium_required(VERSION 2.6) #将目录下的所有文件名赋值给DIR_SRC变量 aux_source_directories(. DIR_SRC) #添加include文件夹,存放头文件 include_directories(include) #生成可执行文件 add_executable(main ${DIR_SRC}) #添加子目录 add_subdirectory(lib) #将生成文件与动态库链接 target_link_libraries(main test) /lib/CMakeLists.txt #赋值 aux_source_direc...

树莓派openwrt+ipv6尝试

树莓派openwrt+ipv6尝试 A attempt about flashing openwrt to RaspberryPi and enable ipv6. 1.刷入openwrt 从网上发现树莓派能够刷入openwrt,同时科协技术部缺少一个能免费上网的东西,于是想使用树莓派刷入openwrt挂上shadowsocks来免费上网。 至于如何ipv6免费上网,可以参考我的这篇博客 校园ipv6免流量 。 I have seen many sites about how to flash openwrt to RaspberryPi.Also,the techology department of NWPU Science and Techology Association need a way to surf the internet free.So,i attempt to do something. How to surf the internet free?You can view my blogger, 校园ipv6免流量 。 下载openwrt镜像 openwrt 。 但是官方的有问题,wiki上写了支持树莓派3,没有bcm2710版本所以选择了lede项目组的镜像,下载地址 LEDE project Download the image of openwrt openwrt . There some issues about official source. Also the wiki says it supports RaspberryPi 3B,but there is no version of bcm2710.So I choose the image of LEDE project openwrt . 写入openwrt镜像 windows 使用Win32DiskImager Download pages Use Win32DiskImager Download pages Linux 使用dd命令烧写镜像 Use dd comand to flash. dd if=lede-brcm2708-bcm2710-rpi-3-ext4-sdcard.img of=/dev/sdb ...

vim vundle 配置

vim vundle 配置 Vim Vundle 配置 Set up Vim Vundle. 1.关于Vundle About Vundle. Vundle 是一个Vim的包管理工具,类似于sublime text,atom,oh-my-zsh的插件管理工具。 Vundle is a package manager of Vim. Just like packages manager of sublime text, atom, oh-my-zsh, etc. Vundle的Github主页是 Vundle.vim The index of Vundle is Vundle.vim 2.配置Vundle Set up Vundle. git clone  https://github.com/VundleVim/Vundle.vim.git  ~/.vim/bundle/Vundle.vim 将这些代码放到 ~/.vimrc 文件中,如果没有这个文件需要自己创建。 Put the below codes into ~/.vimrc . If the docments is not exists, just creat one. set nocompatible              " be iMproved, required filetype off                  " required   " set the runtime path to include Vundle and initialize set rtp+=...

树莓派+nginx+php

树莓派+nginx+php 树莓派+nginx+php建站 Setup a webpage on Raspberry by nginx and php. 1.更新软件源 update the list of softwares sudo apt update && sudo apt upgrade 2.安装nginx和php install nginx and php sudo apt install nginx sudo apt install php 也能使用以下命令 also,can use these commands sudo apt install php5 关于php版本的问题,php5比php7更加稳定。 It looks like that php5 is more stable than php7. More information on this site: php.net 3.配置nginx Setup nginx. nginx的配置文件存放在/etc/nginx/sites-available目录下。 只需要修改该目录下的default配置即可 The configurations of nginx are in /etc/nginx/sites-available. Just need to edit the default to configure. cd /etc/nginx/sites-available sudo vim default 根据提示添加index.php,取消php配置前的注释。 Add "index.php" to the below line and unmark the configurations of php. # Add index.php to the list if you are using PHP inde...