Posts

Constructing C++ Projects via CMake

1. Installing CMake CMake Download 2. Building Source Code Files hello.cc #include <iostream> int main(void) { std::cout << "Hello World!" << std::endl; return 0; } 3. Building CMakeLists.txt File # Specify the minimum version of CMake cmake_minimum_required(VERSION 3.10) # Project name project(hello) # Source code files add_executable(hello hello.cpp) 4. Building Project In the above code, cmake_minimum_required specifies the minimum required version of CMake, while project specifies the name of the project. add_executable specifies the name of the generated executable file and the path of the source code files. 5. Running Project Open the terminal in the project folder and enter the following command to build: mkdir build # Create a "build" folder cd build # Enter "build" cmake .. # Generate Makefile make # Compile the source code and generate the executable file 6. Building Cross-Platform Project ...

FFmpeg

FFmpeg extract audio mp3 from mp4 video ffmpeg -i video.mp4 -b:a 192K -vn music.mp3 How to merge audio and video file in ffmpeg ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac output.mp4

Generate ctags on FreeBSD

Install ctags # pkg install ctags Execute ctags Go to the directory where you want to generate ctags file and run command as follows: $ /usr/local/bin/exctags -R

Update the value of column value in clickhouse database

The command is as follows: :) ALTER TABLE tablename UPDATE column_name = column expresion1 WHERE  expression; Example: :) ALTER TABLE tablename UPDATE time = time / 100 WHERE id = 0;

YCM error. The ycmd server SHUT DOWN (restart wit...the instructions in the documentation) In FreeBSD

Open .py file with vim I got error message as following: " YCM error. The ycmd server SHUT DOWN (restart wit...the instructions in the documentation) " Solution: 1. Install cmake # pkg install cmake 2. Compile $ cd /home/j/.vim/bundle/YouCompleteMe $ python3 install.py

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,         "allowTransparen...

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