博文

目前显示的是 十月, 2016的博文

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...