Posts

Install v2ray on FreeBSD

Install # pkg install v2ray Configuration Set v2ray system startup. Add content as following below to /etc/rc.conf # sysrc v2ray_enable=yes set v2ray's config.json of client. {   "log": {     "access": "",     "error": "",     "loglevel": "warning"   },   "inbounds": [     {       "tag": "socks",       "port": 10808, // port of client for socks       "listen": "127.0.0.1",       "protocol": "socks",       "sniffing": {         "enabled": true,         "destOverride": [           "http",           "tls"         ],         "routeOnly": false       },       "settings": {         "auth": "noauth",         "udp": true,         "allowTransparent": false       }     },     {       "tag": "http",       "port&q

Error message "Unknown function: togglebg#map" when open vim on FreeBSD

 Solution: $ mkdir ~/.vim/autoload $ cp ~/.vim/bundle/vim-colors-solarized/autoload/togglebg.vim ~/.vim/autoload

Cannot find color scheme 'zenburn' when open vim on FreeBSD

Solution: $ mkdir ~/.vim/colors $ cp ~/.vim/bundle/Zenburn/colors/zenburn.vim ~/.vim/colors/   

How to make VIM an IDE for Python on FreeBSD

Install VIM # pkg install vim VIM Extensions The first thing you need is a good extension manager. Vundle VIM has serveral extension managers, but I strongly recommend Vundle . Let's get Vundle installed: $ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim This command downloads the Vundle plugin manager and chucks it in your VIM bundles directory. Now you  can manage all your extensions from the .vimrc configuration file . $ touch ~/.vimrc Now set up Vundle in your .vimrc by adding the following to the top of the file: set nocompatible              " required filetype off                  " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " alternatively, pass a path where Vundle should install plugins "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required Plugin 'gmarik/Vundle.vim' " add all your plugins here (no

curl/curl.h file not found in FreeBSD

When I use clang to compile test.c, the following error occurs. fatal error : 'curl/curl.h' file not found The compile command is: $ clang test.c -o test I did some research. Then I know I need to change the compile command as follows: $ clang -I/usr/local/include -L/usr/local/lib -lcurl test.c -o test

fopen vs open in C

1. fopen is defined in the C standard library , but open is not. Therefore fopen is more portable than open. 2. fopen provides you with buffering IO that may turn out to be a lot faster than what you're doing with open.

Bold italic vectors in LaTex

Use \boldsymbol For example: $E = mc^{2}$ After bold italic vectors: \$\boldsymbol{E = mc^{2}}\$, the equation as follows: $\boldsymbol{E = mc^{2}}$