Skip to content

Commit 91e4b57

Browse files
committed
update
1 parent 4f3f716 commit 91e4b57

19 files changed

+2140
-2132
lines changed

_drafts/Others/2025-06-14-工具软件备忘.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
* 超星阅读器: <http://ssreader.chaoxing.com/>
8080
* WinDjView: <https://windjview.sourceforge.io/en/>
8181
* Zeal(Zeal is an offline documentation browser for software developers): <https://zealdocs.org/>
82+
* ViewCompanion(View, annotate and convert PDF, DWF, PLT, CGM, TIFF and CALS): <https://www.softwarecompanions.com/>
8283

8384
## 浏览器
8485

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
---
2+
title: "Aloys的环境搭建手册"
3+
categories:
4+
- setup-environment
5+
tags:
6+
- 环境搭建
7+
toc: true
8+
---
9+
10+
11+
## Ubuntu 16.04安装SQLLite3
12+
13+
```shell
14+
jiangxin@db01:~$ sudo apt-get install sqlite3
15+
jiangxin@db01:~$ sqlite3 test.db
16+
SQLite version 3.11.0 2016-02-15 17:29:24
17+
Enter ".help" for usage hints.
18+
sqlite> create table mytable(id integer primary key, value text);
19+
sqlite> insert into mytable(id, value) values(1, 'Micheal');
20+
sqlite> select * from mytable;
21+
1|Micheal
22+
sqlite> .help
23+
.backup ?DB? FILE Backup DB (default "main") to FILE
24+
.bail on|off Stop after hitting an error. Default OFF
25+
.binary on|off Turn binary output on or off. Default OFF
26+
.changes on|off Show number of rows changed by SQL
27+
.clone NEWDB Clone data into NEWDB from the existing database
28+
.databases List names and files of attached databases
29+
.dbinfo ?DB? Show status information about the database
30+
.dump ?TABLE? ... Dump the database in an SQL text format
31+
If TABLE specified, only dump tables matching
32+
LIKE pattern TABLE.
33+
.echo on|off Turn command echo on or off
34+
.eqp on|off Enable or disable automatic EXPLAIN QUERY PLAN
35+
.exit Exit this program
36+
.explain ?on|off|auto? Turn EXPLAIN output mode on or off or to automatic
37+
.fullschema Show schema and the content of sqlite_stat tables
38+
.headers on|off Turn display of headers on or off
39+
.help Show this message
40+
.import FILE TABLE Import data from FILE into TABLE
41+
.indexes ?TABLE? Show names of all indexes
42+
If TABLE specified, only show indexes for tables
43+
matching LIKE pattern TABLE.
44+
.limit ?LIMIT? ?VAL? Display or change the value of an SQLITE_LIMIT
45+
.load FILE ?ENTRY? Load an extension library
46+
.log FILE|off Turn logging on or off. FILE can be stderr/stdout
47+
.mode MODE ?TABLE? Set output mode where MODE is one of:
48+
ascii Columns/rows delimited by 0x1F and 0x1E
49+
csv Comma-separated values
50+
column Left-aligned columns. (See .width)
51+
html HTML <table> code
52+
insert SQL insert statements for TABLE
53+
line One value per line
54+
list Values delimited by .separator strings
55+
tabs Tab-separated values
56+
tcl TCL list elements
57+
.nullvalue STRING Use STRING in place of NULL values
58+
.once FILENAME Output for the next SQL command only to FILENAME
59+
.open ?FILENAME? Close existing database and reopen FILENAME
60+
.output ?FILENAME? Send output to FILENAME or stdout
61+
.print STRING... Print literal STRING
62+
.prompt MAIN CONTINUE Replace the standard prompts
63+
.quit Exit this program
64+
.read FILENAME Execute SQL in FILENAME
65+
.restore ?DB? FILE Restore content of DB (default "main") from FILE
66+
.save FILE Write in-memory database into FILE
67+
.scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off
68+
.schema ?TABLE? Show the CREATE statements
69+
If TABLE specified, only show tables matching
70+
LIKE pattern TABLE.
71+
.separator COL ?ROW? Change the column separator and optionally the row
72+
separator for both the output mode and .import
73+
.shell CMD ARGS... Run CMD ARGS... in a system shell
74+
.show Show the current values for various settings
75+
.stats on|off Turn stats on or off
76+
.system CMD ARGS... Run CMD ARGS... in a system shell
77+
.tables ?TABLE? List names of tables
78+
If TABLE specified, only list tables matching
79+
LIKE pattern TABLE.
80+
.timeout MS Try opening locked tables for MS milliseconds
81+
.timer on|off Turn SQL timer on or off
82+
.trace FILE|off Output each SQL statement as it is run
83+
.vfsinfo ?AUX? Information about the top-level VFS
84+
.vfslist List all available VFSes
85+
.vfsname ?AUX? Print the name of the VFS stack
86+
.width NUM1 NUM2 ... Set column widths for "column" mode
87+
Negative values right-justify
88+
sqlite> .quit
89+
jiangxin@db01:~$\
90+
```
91+
92+
由于Sqlite本身不支持远程访问,如果需要在Windows上连接远程Linux上的Sqlite,需要在Linux上共享文件给Windows。
93+
共享方式见:
94+
Ubuntu创建共享文件夹并支持Windows访问:http://jingyan.baidu.com/article/2fb0ba40a8283500f2ec5f35.html
95+
96+
97+
在Windows上打开资源浏览器,在输入框输入\\192.168.1.150
98+
然后输入用户名、密码即可
99+
100+
![](https://raw.githubusercontent.com/jiangxincode/PicGo/master/aloys_build_manual/image104.png)
101+
102+
103+
![](https://raw.githubusercontent.com/jiangxincode/PicGo/master/aloys_build_manual/image105.png)
104+
105+
将之前创建的test.db移到share/sqlite目录:
106+
107+
jiangxin@db01:~$ mv test.db share/sqlite/
108+
109+
在Windows上用dbeaver连接Linux上的远程数据库
110+
111+
![](https://raw.githubusercontent.com/jiangxincode/PicGo/master/aloys_build_manual/image106.png)
112+
113+
## 安装Prometheus
114+
下载地址:
115+
https://prometheus.io/download/
116+
117+
jiangxin@tomcat:~$ sudo mkdir /usr/local/prometheus
118+
jiangxin@tomcat:~$ sudo chown -R jiangxin:jiangxin /usr/local/prometheus
119+
jiangxin@tomcat:~$ cd /usr/local/prometheus/
120+
jiangxin@tomcat:/usr/local/prometheus$ ls
121+
prometheus-1.7.1.linux-amd64.tar.gz
122+
jiangxin@tomcat:/usr/local/prometheus$ tar -zxvf prometheus-1.7.1.linux-amd64.tar.gz
123+
jiangxin@tomcat:/usr/local/prometheus$ cd prometheus-1.7.1.linux-amd64/
124+
125+
jiangxin@tomcat:/usr/local/prometheus/prometheus-1.7.1.linux-amd64$ sudo vim /etc/profile
126+
127+
export PROMETHEUS_HOME=/usr/local/prometheus/prometheus-1.7.1.linux-amd64
128+
export PATH=$PATH:$PROMETHEUS_HOME
129+
130+
jiangxin@tomcat:/usr/local/prometheus/prometheus-1.7.1.linux-amd64$ source /etc/profile
131+
jiangxin@tomcat:/usr/local/prometheus/prometheus-1.7.1.linux-amd64$ cd
132+
### 启动
133+
jiangxin@tomcat:~$ prometheus -config.file=${PROMETHEUS_HOME}/prometheus.yml
134+
INFO[0000] Starting prometheus (version=1.7.1, branch=master, revision=3afb3fffa3a29c3de865e1172fb740442e9d0133) source="main.go:88"
135+
INFO[0000] Build context (go=go1.8.3, user=root@0aa1b7fc430d, date=20170612-11:44:05) source="main.go:89"
136+
INFO[0000] Host details (Linux 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64 tomcat (none)) source="main.go:90"
137+
INFO[0000] Loading configuration file /usr/local/prometheus/prometheus-1.7.1.linux-amd64/prometheus.yml source="main.go:252"
138+
INFO[0000] Loading series map and head chunks... source="storage.go:428"
139+
INFO[0000] 0 series loaded. source="storage.go:439"
140+
INFO[0000] Starting target manager... source="targetmanager.go:63"
141+
INFO[0000] Listening on :9090 source="web.go:259"
142+
143+
144+
145+
146+
### 查看界面
147+
http://192.168.1.130:9090/metrics
148+
149+
![](https://raw.githubusercontent.com/jiangxincode/PicGo/master/aloys_build_manual/image189.png)
150+
151+
152+
153+
http://192.168.1.130:9090/graph
154+
155+
![](https://raw.githubusercontent.com/jiangxincode/PicGo/master/aloys_build_manual/image190.png)
156+
157+
158+
159+
## Windows 10系统下搭建Jenkins环境
160+
161+
主要参考:
162+
http://www.cnblogs.com/edward2013/p/5269465.html
163+
但是没有安装ant,而且java、maven、tomcat都是使用的压缩包方式安装。
164+
165+
## Ubuntu 16.04安装docker
166+
167+
主要参考:
168+
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
169+
170+
## 配置AOSP源码查看环境
171+
172+
### 在Windows上安装Repo,同步AOSP代码【不推荐】
173+
174+
第一个想到的方案是在Windows上配置Repo,然后下载AOSP源码,参考:
175+
Windows安装repo的真正解决方案:https://ysy950803.blog.csdn.net/article/details/104188793
176+
但是就像Repo官网(https://gerrit.googlesource.com/git-repo/+/HEAD/docs/windows.md)说的那样:
177+
Repo is primarily developed on Linux with a lot of users on macOS. Windows is, unfortunately, not a common platform. There is support in repo for Windows, but there might be some rough edges.
178+
Keep in mind that Windows in general is “best effort” and “community supported”. That means we don't actively test or verify behavior, but rely heavily on users to report problems back to us, and to contribute fixes as needed.
179+
Windows版的Repo虽然可用,但是可能会出现各种各样的问题,这些问题可能会让我们在解决环境问题上分心过多,所以不推荐这种方式。
180+
181+
### 在Linux上安装Repo,同步AOSP代码【推荐】
182+
183+
根据实际情况有两种工作模式:
184+
1、 Linux作为AOSP代码的同步、存储、查看、修改、编译环境,大部分工作都是在Linux上完成,Android Studio也是安装在Linux上,这种我觉得是最完美的模式。但是要求Linux的性能足够好。由于我这边没有实际的Linux机器,是在Windows上用虚拟机配置的Linux环境,所以没有采用这种方法。
185+
2、 Linux作为AOSP代码的同步、存储、编译环境,查看和修改工作在Windows上完成,具体的实现方式有两种:
186+
a) 用Samba服务器把Linux上的AOSP代码共享到Windows平台,然后在Windows平台上安装IDE环境,直接打开远程AOSP代码目录,查看和修改,这种方式的优点是配置简单,不用代码同步。但是我这边网速一般,而AOSP代码量太大,导致Android Studio经常卡死,所以我也放弃了这种方式。
187+
b) 将android.iml/android.ipr以及常用的仓(比如frameworks/base frameworks/native等)使用rsync等工具同步到Windows平台,然后在Windows上使用Android Studio导入,进行查看和修改,修改完成后通过Beyondcompare工具将修改的内容同步到Linux平台进行编译等工作。这个各方面折中的方案。后续主要介绍这种工作环境的配置。
188+
189+
#### 安装配置Linux环境
190+
191+
如果已经有Linux机器,本步骤省略。我在家中没有,遂采用在Windows上安装Virtualbox,然后通过Virtualbox安装Linux(Ubuntu)。
192+
同时按需安装Git/Vim/OpenSSH Server等工具,安装方式不再赘述,网上有很多。
193+
194+
#### 下载AOSP源码
195+
196+
在配置好的Linux环境中下载AOSP源码,Google官方的下载AOSP源码的方式:https://source.android.com/docs/setup/build/downloading。
197+
但是由于墙的原因,这种方式不容易实现,所以推荐使用清华的镜像,使用指导:https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/。
198+
Repo的使用方式可以参考:Repo实践指南:https://www.cnblogs.com/jiangxinnju/p/14274982.html
199+
200+
#### 配置Windows上的工具
201+
1、 安装SSH客户端工具,这里推荐MobaXTerm,因为它不仅免费还自带了rsync命令行工具,可以非常方便从Linux上同步代码到Windows。
202+
a) mkdir -p /drives/d/Code/sync/aosp/frameworks
203+
b) rsync -az --progress --delete --exclude=".git" [email protected]:/home/android/aosp/frameworks/base /drives/d/Code/sync/aosp/frameworks/
204+
c) rsync -az --progress --delete --exclude=".git" [email protected]:/home/android/aosp/frameworks/native /drives/d/Code/sync/aosp/frameworks/
205+
2、 安装BeyondCompare工具,方便对比,将修改的代码同步到Linux环境。
206+
3、 安装Android Sudio,将AOSP源码导入到Android Studio进行查看:https://www.cnblogs.com/jiangxinnju/p/14426645.html
207+
4、 安装Source Insight工具,AS查看AOSP的Java代码比较合适,但是C/C++代码不支持跳转,着色也比较差,看这部分代码还是SI比较好用。
208+
209+
## TensorFlow环境搭建
210+
211+
### 预备条件
212+
 Ubuntu 22.04.2 LTS
213+
 配置好固定IP,安装SSH(Server)/Samba等基础网络连接软件
214+
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: "腾讯云环境构建"
3+
categories:
4+
- setup-environment
5+
tags:
6+
- 环境搭建
7+
- 腾讯云
8+
toc: true
9+
---
10+
11+
## 开启root用户
12+
13+
```bash
14+
ubuntu@ubuntu:~$ sudo passwd root
15+
```
16+
17+
## 修改主机名
18+
19+
```bash
20+
ubuntu@ubuntu:~$ sudo vim /etc/hostname
21+
```
22+
23+
修改成ubuntu
24+
25+
```bash
26+
ubuntu@ubuntu:~$ sudo reboot
27+
```
28+
29+
## 调整SSH配置
30+
31+
```bash
32+
# 注意是sshd_config,不是ssh_config
33+
ubuntu@ubuntu:~$ sudo vim /etc/ssh/sshd_config
34+
```
35+
36+
修改或者取消注释如下内容
37+
38+
```bash
39+
# 允许root用户登录
40+
PermitRootLogin yes
41+
42+
# 防止SSH经常断连
43+
ClientAliveInterval 30
44+
ClientAliveCountMax 86400
45+
```
46+
47+
```bash
48+
ubuntu@ubuntu:~$ sudo service ssh restart
49+
```
50+
51+
## 安装JDK
52+
53+
54+
55+
## 安装Tomcat
56+
57+
58+
59+
## 安装MySQL
60+
61+
62+
63+
## 部署项目
64+
65+
war包放到$CATALINA_HOME/webapps/目录下,然后重启tomcat
66+
shutdown.sh; startup.sh ; tail -f $CATALINA_HOME/logs/catalina.out
67+
68+
http://124.222.145.48:8080/java-web-test/index.jsp
69+
70+
## 安装Apache
71+
72+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## 安装Apache
2+
3+
安装Apache作为HTTP文件下载服务器
4+
5+
```bash
6+
ubuntu@ubuntu:~$ sudo apt-get install apache2
7+
```
8+
9+
尝试启动Apache2服务
10+
11+
```bash
12+
ubuntu@ubuntu:~$ /etc/init.d/apache2 start
13+
Starting apache2 (via systemctl): apache2.service==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
14+
Authentication is required to start 'apache2.service'.
15+
Authenticating as: qcloud (ubuntu)
16+
Password:
17+
==== AUTHENTICATION COMPLETE ===
18+
.
19+
```
20+
21+
直接访问<http://124.222.145.48:80/>,既可看到对应的Apache2默认页面。
22+
23+
![](https://raw.githubusercontent.com/jiangxincode/PicGo/master/2025-07-26_12-25-59.png)
24+
25+
存放的目录为`/var/www/html/`,想要下载的文件直接放到这个目录下,然后直接访问既可。
26+
27+
<http://124.222.145.48/download/>
28+
29+
```bash
30+
31+
命令汇总
32+
33+
```bash
34+
# 启动Apache2服务
35+
/etc/init.d/apache2 start
36+
37+
# 查看Apache2服务状态
38+
/etc/init.d/apache2 status
39+
40+
# 停止Apache2服务
41+
/etc/init.d/apache2 stop
42+
43+
# 重启Apache2服务
44+
/etc/init.d/apache2 restart
45+
```

0 commit comments

Comments
 (0)