配置 Ubuntu 开发环境

wangjianfeng@pc:~/source$ uname -a Linux pc 5.11.0-36-generic  

1 基础软件

包括常用办公工具,Android系统构建阶段的依赖库

sudo apt-get install -y git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip libssl-dev libssl-dev openssl autoconf m4 libxml2-utils bc libxml-simple-perl ssh terminator minicom tree net-tools vim 

2 共享: Samba

通过samba服务,实现文件资源共享。

 [root@10_2_5_133 ~] [root@10_2_5_133 ~] [root@10_2_5_133 ~] [root@10_2_5_133 ~] ... [serverA] workgroup = my_domain comment = wangjianfeng path = /home/wangjianfeng/source directory mask = 0775 create mask = 0775 browseable = yes public = yes available = yes writable = yes    admin users = hinzer [root@10_2_5_133 ~] [root@10_2_5_133 ~] [root@10_2_5_133 ~] [root@10_2_5_133 ~]  hinzer@pc:~/source$ sudo apt-get install -y cifs-utils hinzer@pc:~/source$ cat /etc/auth.smb ... username=hinzer password=1 domain=my_domain hinzer@pc:~/source$ sudo vim /etc/fstab ... //10.2.5.133/serverA /home/hinzer/source/server cifs credentials=/etc/auth.smb,gid=1000,uid=1000,iocharset=utf8,rw 0 0 hinzer@pc:~/source$ mkdir /home/hinzer/source/server hinzer@pc:~/source$ sudo mount -a  hinzer@pc:~/source/server$ ll total 144 drwxr-xr-x 2 hinzer hinzer 0 1014 20:07 ./ drwxrwxr-x 12 hinzer hinzer 4096 1014 20:06 ../ -rwxr-xr-x 1 hinzer hinzer 1305 1011 19:38 build.sh* -rwxr-xr-x 1 hinzer hinzer 137352 1011 19:23 .config* 
  • samba用户不属于系统用户,但添加samba用户时需要系统存在同名用户;
  • samba配置指定samba用户对共享资源的权限,客户端凭借该身份访问共享资源;
  • 共享资源的权限同时受客户端约束,在挂载时可以配置共享文件的uid gid等属性;

3 文档: GitBook

公司wiki不方便编辑,导入/导出,检索和维护。个人/团队的经验、技术、文档比较难形成沉淀。

本地编辑:markdown编辑器 + git工具
服务器:gitlab + git/repo工具 + gitbook服务器
团队协同:通过gitlab来实现公共文档的权限管理,文档编辑

持续集成和持续渲染:服务器上lixnux执行定时任务,来实现源码的同步,渲染页面

 hinzer@pc:~$ sudo npm install gitbook-cli -g hinzer@pc:~$ gitbook -V   hinzer@pc:~$ git clone git@gitlab.loongnix.org:wangjianfeng/repositories.git  hinzer@pc:~$ gitbook init  hinzer@pc:~$ vim book.json  hinzer@pc:~$ gitbook install  

book.json

{ "plugins": [ "expandable-chapters-small", "-lunr", "-search", "search-plus", "-sharing", "splitter", "anchor-navigation-ex-toc", "hide-element", "-insert-logo", "code", "summary", "simple-page-toc", "copy-code-button", "edit-link" ], "pluginsConfig": { "hide-element": { "elements": [".gitbook-link"] }, "insert-logo": { "url": "", "style": "background: none; max-height: 120px; min-height: 120px" }, "simple-page-toc": { "maxDepth": 3, "skipFirstH1": true }, "edit-link": { "base": "http://gitlab.loongnix.org/wangjianfeng/gsgpu-docs/-/tree/master", "label": "Edit This Page" } } } 
mkdir -p /var/log/gitbook nohup gitbook serve --port 4000 --lrport 35730 --watch & nohup gitbook serve --port 3000 --lrport 35731 --watch & ps -aux | grep gitbook 
 hinzer@pc:~/source/gitbook$ crontab -l  */5 * * * * /usr/bin/bash /home/hinzer/source/gitbook/reposync.sh hinzer@pc:~/source/gitbook$ cat /home/hinzer/source/gitbook/reposync.sh    SHELL_FOLDER=$(cd "$(dirname "$0")";/usr/bin/pwd) cd ${SHELL_FOLDER} /home/hinzer/bin/repo sync --force-sync >> ${SHELL_FOLDER}/reposync.log 
hinzer@pc:~/source/gitbook$ crontab -l  */5 * * * * /usr/bin/bash /home/hinzer/source/gitbook/reposync.sh */5 * * * * /usr/bin/bash /home/hinzer/source/gitbook/book-update.sh hinzer@pc:~/source/gitbook$ cat /home/hinzer/source/gitbook/book-update.sh    SHELL_FOLDER=$(cd "$(dirname "$0")";/usr/bin/pwd) cd ${SHELL_FOLDER} /home/hinzer/bin/repo forall -c "/usr/bin/gitbook init && /usr/bin/gitbook build" >> ${SHELL_FOLDER}/book-update.log 

4 源码: OpenGrok

搭建一个源码阅读环境,opengrok方便我在浏览器上直接对源码进行检索和查看。

sudo apt install docker.io docker-compose 
 root@pc:~  root@pc:~ root@pc:~ root@pc:~/opengrok-etc  root@pc:~/opengrok-etc root@pc:~/opengrok-etc  root@pc:~ root@pc:~  root@pc:~  root@a5f0b9ae784a:/usr/local/tomcat 
version: "3"  services: opengrok: container_name: flower image: opengrok/docker:latest ports: - "4001:8080/tcp" environment: SYNC_PERIOD_MINUTES: '60'  volumes: - '~/opengrok-src/:/opengrok/src/'  - '~/opengrok-etc/:/opengrok/etc/'  - '~/opengrok-data/:/opengrok/data/'  

5 References

N/A

原文链接:https://blog.csdn.net/feit2417/article/details/128442943

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享