说到 Android Kernel 那就不得不说到 Linux Kernel,Android Kernel 基于 Linux Kernel 的长期稳定版本,
首先 Linux Kernel 是什么? Linux Kernel 是在 GNU GPL v2 开源许可下开源的硬件底层驱动,包括了 CPU 调度,存储管理,IO 管理,等等。Linux Kernel 是 GPL 开源,所以为了适用移动设备内存,CPU 频率,耗电等特点,Google 将这部分 Linux Kernel 做了修改,并按照 GPL 将修改开源了。
The kernel has complete control over the system.
Android 最早的内核是基于 Linux 2.6 内核的,在很长一段时间内,Android 的 Kernel 一直使用非常老版本的 Linux Kernel,但是随着时间发展,渐渐的每一个版本的 Android 发布都再使用最新的 Linux Kernel 1.
回到 Android Kernel,不同设别出厂的时候就会带一个 stock 官方的 kernel,当然这个 Kernel 是稳定可以用于日常使用的。但是有些官方优化的 Kernel 并没有发挥硬件的最佳,所以 xda 上就有很多人发布不同的 Kernel,可以支持一些电池的优化,或者对硬件一些更好的支持。
ElementalX 内核是一个我从 Nexus 6, OnePlus 3 开始就使用过的 Kernel,由 flar2 开发。
ElementalX 内核的突出特点就是稳定,在不牺牲稳定性的前提下对系统做一些优化,比如滑动手势,亮度模式,震动模式,声音控制,文件系统格式等等。
个人使用的情况也是非常稳定,没有遇到过任何硬件不兼容问题。
Franco Kernel 由 franciscofranco 开发,是非常著名的一个 Kernel,支持非常多的设备。
blu_spark kernel 由 eng.stk 开发。
更多的 kernel 可以查阅这里
OnDemand 是一个比较老的 linux kernel 中的调频器,当负载达到 CPU 阈值时,调频器会迅速将 CPU 调整到最高频率。由于这种偏向高频的特性,使得它有出色的流动性,但与其他调频器相比可能对电池寿命产生负面影响。OnDemand 在过去通常被制造商选用,因为它经过了充分测试并且很可靠,但已经过时,并且正在被 Google 的 interactive 控制器取代。
基本上是拥有 暂停、唤醒配置的 OnDemand,没有在 OnDemand 上做更多的优化。
Performance 调频器将手机的 CPU 固定在最大频率。
与 Performance 调频器相反,Powersave 调频器将 CPU 频率锁定在用户设置的最低频率。
该调速器将手机偏置为尽可能频繁地选择尽可能低的时钟速率。换句话说,在 Conservative 调频器提高 CPU 时钟速度之前,必须在 CPU 上有更大且更持久的负载。根据开发人员实现此调频器的方式以及用户选择的最小时钟速度,Conservative 调频器可能会引入不稳定的性能。另一方面,它可以有利于电池寿命。
Conservative 调频器也经常被称为“slow OnDemand”。原始的、未经修改的 Conservative 是缓慢并且低效的。较新版本和修改版本 Conservative(来自某些内核)响应速度更快,并且几乎可以用于任何用途。
这种调频器在移动设备中极为罕见,它允许用户执行的任何程序设置 CPU 的工作频率。此调频器在服务器或台式 PC 中更常见,其中应用程序(如电源配置文件应用程序)需要特权来设置 CPU 时钟速度。
Min Max 调频器会根据负载选择最低或者最高的频率,而不会使用中间频率。
Interactive 会平衡内核开发人员(或用户)设置的时钟速度。换句话说,如果应用程序需要调整到最大时钟速度(CPU 100%负载),用户可以在调频器开始降低 CPU 频率之前执行另一个任务。由于此计时器,Interactive 还可以更好地利用介于最小和最大 CPU 频率之间的中间时钟速度。它的响应速度明显高于 OnDemand,因为它在调整到最大频率时速度更快。
Interactive 还假设用户打开屏幕之后很快就会与其设备上的某个应用程序进行交互。 因此,打开屏幕会触发最大时钟速度的斜坡,然后是上述的定时器行为。
Interactive 是当今智能手机和平板电脑制造商的首选默认调频器。
由内核开发人员“Imoseyon”创建,InteractiveX 调频器主要基于交互式调频器,增强了调整计时器参数,以更好地平衡电池与性能。但是,InteractiveX 调频器的定义功能是在屏幕关闭时将 CPU 频率锁定到用户最低定义的速度。
基于 Interactive,表现和之前的 minmax 一致,smartass 相应更快。电池寿命很难精确量化,但它确实在较低频率下可以使用更长。
当睡眠时调整到 352Mhz ,Smartass 还会限制最大频率(或者如果您设置的最小频率高于 352,它将限制到您设定的最小频率)。
该调频器会在屏幕关闭时缓慢的降低频率,甚至它也可以让手机 CPU 频率降至一个让手机无法正常使用的值(如果最小频率没有设置好的话)。
从 Erasmux 中而来的 Version 2 版本,该调频器的目标是“理想的频率”,并且更加积极地向这个频率增加,并且在此之后不那么激进。它在屏幕开启或者关闭时使用不同的频率,即 awake_ideal_freq
和 sleep_ideal_freq
。 当屏幕关闭时,此调频器非常快地降低 CPU(快速达到 sleep_ideal_freq
)并在屏幕开启时快速向上调整到 awake_ideal_freq
。 屏幕关闭时,频率没有上限(与 Smartass 不同)。因此,整个频率范围可供调频器在屏幕开启和屏幕关闭状态下使用。这个调频器的主打功能是性能和电池之间的平衡。
Scary 基于 Conservative 并增加了一些 smartass 的特征,它相应地适用于 Conservative 的规则。所以它将从底部开始,采取一个负载样本,如果它高于上限阈值,一次只增加一个梯度,并一次减少一个。 它会自动将屏幕外的速度限制为内核开发人员设置的速度,并且仍然会根据保守法律进行调整。 所以它大部分时间都花在较低的频率上。 这样做的目的是通过良好的性能获得最佳的电池寿命。
Schedutil is the newest CPUFreq governor introduced back during Linux 4.7 as an alternative to ondemand, performance, and others. What makes Schedutil different and interesting is that it makes use of CPU scheduler utilization data for its decisions about CPU frequency control
这些年用 Android 下来总是最喜欢原生的系统,但是却总觉得缺少一些什么,而这些东西在用 Oxygen OS(后简称 OOS)之后发现竟然如此的贴心好用,甚至有一定程度上要超越 Google 原生的系统。比如一些非常不错的小功能,状态来显示网速,三指截屏等。
使用 GravatyBox 调整
Use Magisk order to install
Reboot the device
Android Pie 在 EdXposed 下可用的模块列表
OnePlus 7 Pro 折腾记。
先前准备:
具体步骤
adb reboot bootloader
fastboot devices
fastboot oem unlock
第三方的 Recovery,首推 TWRP, 在 OnePlus 7 Pro 推出不久之后 xda 上面的 mauronofrio 就发布了非官方版本的 TWRP,当然随着时间往后 mauronofrio 将其制作的 TWRP 发布到了官方页面 . 本人测试 2019-06-08 的 twrp-3.3.1-3-guacamole.img ,非常完美。
安装 TWRP 过程
fastboot boot twrp-3.3.1-3-guacamole.img
让手机用该 Recovery 启动,boot 命令只会让手机此次启动使用 TWRP,需要进行下一步才能让手机保持 TWRP Recovery刷完重启进入系统
注意:OnePlus 7 Pro 使用 Slot A/B,但是最新的 TWRP 已经自动支持 A/B 识别,不用担心 A/B 的问题
在 root 之前需要注意
然后根据一下流程:
fastboot flash boot boot_patched.img
fastboot reboot
重启From: xda
使用 Magisk ROOT
+
号,选择 Riru-Core 和 EdXposedFrom: xda
更新 OTA, Magisk 在拥有 slot A/B 的设备上有新的特性,能让系统正常更新而不会丢失 ROOT。如果想要了解更多 A/B 分区的问题可以参考这里.
如果想要在 OTA 之后保留 ROOT:
Install to Inactive Slot (After OTA)
选项 (中文应该是,安装到未使用的槽位,安装完 OTA 后)在上方的步骤重启进入系统之后会丢掉 TWRP,进入系统后需要重新刷入,在 OTA 之后保留 TWRP:
在最后一步,有些教程可能有问题,在这里只需要 Direct Install,而不需要 Install to Inactive Slot(After OTA) 了。
这些步骤之后就 OTA 成功,并且保留了 TWRP,以及 Magisk 和 Magisk 下所有的模块。
使用 adb 备份数据的时候千万注意,adb 备份的数据恢复时不会自动安装应用,并且可能恢复不完整。如果可能还是使用 Titanium Backup (ROOT) 等专业工具备份和恢复。
adb backup -apk -shared -all -f op7pro-backup-file.ad
参数解释:
-apk|-noapk
是否备份包含 apk 或者仅仅备份应用数据,推荐使用 -apk
选项,默认为 -noapk
-shared|-noshared
决定是否备份设备共享的 SD 卡内容,默认为 -noshared
,主要包括内部存储中的音乐,图片和视频等,推荐使用 -shared
-all
备份所有应用-system|-nosystem
决定 -all
选项是否包含系统应用,默认是 -system
-f
后面需要指定路径及文件名,表示用来存储的位置,比如 -f /path/backup.file
那么会存储在 path
目录下名为 backup.file
的文件中恢复数据
设备连接电脑,adb devices 查看连接成功
adb restore op7pro-backup-file.ad
如果想要手动解开这个备份文件,可以参考这个项目
氧系统有好几个版本的全量 ROM, GM21AA,GM21BA。这两个版本的含义是:
标记有 GM21AA 的包适用于印度、全球(不含欧洲)、美国的无锁版 Model
- GM1911: India
- GM1917: Global/US Unlocked (?)
GM21BA 欧洲销售版本
- GM1913: EU
adb 之前保证打开开发者模式,并且设置中确保设置打开,
adb devices
List of devices attached
5fxxxxxx no permissions (verify udev rules); see [http://developer.android.com/tools/device.html]
在使用 adb 连接的时候如果遇到这个问题,那么在通知栏中,换一种 USB 连接模式,保证非充电模式。如果还不行可以尝试
adb kill-server
adb start-server
更多关于 adb 和 fastboot 命令的使用可以参考之前的 adb 文章 和 fastboot 文章
按住音量下+电源键进入 Recovery 模式,在 TWRP Recovery 下,Advanced > File Manager,打开文件管理,找到:
/data/adb/modules
在这个目录里面就能看到安装的 Magisk 模块,删除新增的模块即可。
Quartz is a richly featured, open source job scheduling library that can be integrated within virtually any Java application - from the smallest stand-alone application to the largest e-commerce system.
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
客户端调用
JobDetail job = newJob(MyJob.class)
.withIdentity("myJob")
.build();
Trigger trigger = newTrigger()
.withIdentity(triggerKey("myTrigger", "myTriggerGroup"))
.withSchedule(simpleSchedule()
.withIntervalInHours(1)
.repeatForever())
.startAt(futureDate(10, MINUTES))
.build();
scheduler.scheduleJob(job, trigger);
StdSchedulerFactory 是 Scheduler 的工厂方法,实现了 SchedulerFactory 接口。
// 提供客户端可用的 Scheduler
Scheduler getScheduler() throws SchedulerException;
// 通过名字获取
Scheduler getScheduler() throws SchedulerException;
// 返回当前 JVM 中通过该 Factory 创建的所有 Scheduler
Collection<Scheduler> getAllSchedulers() throws SchedulerException;
SchedulerRepository 单例,内部持有一个 Map HashMap<String, Scheduler> schedulers
类中,绑定 (bind),解绑 (remove) 都为同步方法,保证线程安全。
Scheduler 是一个很庞大的接口,它的实现主要有
Quartz 的核心实现也基本都在这些实现类中,Scheduler 可以用来定时触发任务。
CronScheduleBuilder 用来将字符串的 cron 表达式变成 CronScheduleBuilder 对象,ScheduleBuilder 是一个抽象类
public class CronScheduleBuilder extends ScheduleBuilder<CronTrigger> {
public static CronScheduleBuilder cronSchedule(String cronExpression) { }
}
主要的实现有:
withIntervalInDays(3)
每隔 3 天,如果要使用固定间隔的可以看一下这个onDaysOfTheWeek(MONDAY, THURSDAY)
, 每一个周一和周四比如
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpr());
trigger = TriggerBuilder.newTrigger().withIdentity(triggerId).withSchedule(scheduleBuilder)
.forJob(jobDetail).build();
scheduler.scheduleJob(jobDetail, trigger);
在 jBPM 商业流程中有一个 ProcessEventListener ,可以用来回调流程的执行过程,但是这个 Listener 的执行顺序非常奇怪。
首先我们先看看这个 interface
public interface ProcessEventListener {
void beforeProcessStarted( ProcessStartedEvent event );
void afterProcessStarted( ProcessStartedEvent event );
void beforeProcessCompleted( ProcessCompletedEvent event );
void afterProcessCompleted( ProcessCompletedEvent event );
void beforeNodeTriggered( ProcessNodeTriggeredEvent event );
void afterNodeTriggered( ProcessNodeTriggeredEvent event );
void beforeNodeLeft( ProcessNodeLeftEvent event );
void afterNodeLeft( ProcessNodeLeftEvent event );
void beforeVariableChanged(ProcessVariableChangedEvent event);
void afterVariableChanged(ProcessVariableChangedEvent event);
}
我相信大多数人看到这些方法回调大致可以猜测 afterProcessStarted 应该是在流程开始之后被调用,然而实际的调用顺序是这样的:
- beforeProcessStarted
- beforeNodeTriggered
- beforeNodeLeft
- beforeNodeTriggered
- beforeVariableChanged
afterVariableChanged
- beforeNodeLeft
- beforeNodeTriggered
- beforeNodeLeft
- beforeNodeTriggered
afterNodeTriggered
afterNodeLeft
- beforeNodeLeft
beforeNodeTriggered
afterNodeTriggered
afterNodeLeft
afterNodeTriggered
afterNodeLeft
afterNodeTriggered
afterNodeLeft
afterNodeTriggered
afterProcessStarted
afterProcessStarted
会在流程结束时被调用。有人提过 bug 但是官方认为这是程序设计,所以使用文档的形式 将这种方式说明了。
查看源代码可以在 RuleExecutor 中可以看到:
假设有如下图的流程
那么打印所有的日志可以观察到:
- DefaultRuleContainer beforeVariableChanged ==>[ProcessVariableChanged(id=age; instanceId=age; oldValue=null; newValue=18; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterVariableChanged ==>[ProcessVariableChanged(id=age; instanceId=age; oldValue=null; newValue=18; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeProcessStarted ==>[ProcessStarted(name=BPTest; id=FlowTest.BPTest)]
- event ==>[ProcessStarted(name=BPTest; id=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeTriggered ==>[ProcessNodeTriggered(nodeId=4; id=0; nodeName=StartPoint; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeLeft ==>[ProcessNodeLeft(nodeId=4; id=0; nodeName=StartPoint; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeTriggered ==>[ProcessNodeTriggered(nodeId=7; id=1; nodeName= 年龄是否大于 18; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeLeft ==>[ProcessNodeLeft(nodeId=7; id=1; nodeName= 年龄是否大于 18; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeTriggered ==>[ProcessNodeTriggered(nodeId=2; id=2; nodeName=A1Task; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeLeft ==>[ProcessNodeLeft(nodeId=2; id=2; nodeName=A1Task; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeTriggered ==>[ProcessNodeTriggered(nodeId=6; id=3; nodeName=A2Task; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeLeft ==>[ProcessNodeLeft(nodeId=6; id=3; nodeName=A2Task; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeTriggered ==>[ProcessNodeTriggered(nodeId=3; id=4; nodeName=End; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeNodeLeft ==>[ProcessNodeLeft(nodeId=3; id=4; nodeName=End; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer beforeProcessCompleted ==>[ProcessCompleted(name=BPTest; id=FlowTest.BPTest)]
- DefaultRuleContainer afterProcessCompleted ==>[ProcessCompleted(name=BPTest; id=FlowTest.BPTest)]
- event ==>[ProcessCompleted(name=BPTest; id=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeLeft ==>[ProcessNodeLeft(nodeId=3; id=4; nodeName=End; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeTriggered ==>[ProcessNodeTriggered(nodeId=3; id=4; nodeName=End; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeLeft ==>[ProcessNodeLeft(nodeId=6; id=3; nodeName=A2Task; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeTriggered ==>[ProcessNodeTriggered(nodeId=6; id=3; nodeName=A2Task; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeLeft ==>[ProcessNodeLeft(nodeId=2; id=2; nodeName=A1Task; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeTriggered ==>[ProcessNodeTriggered(nodeId=2; id=2; nodeName=A1Task; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeLeft ==>[ProcessNodeLeft(nodeId=7; id=1; nodeName= 年龄是否大于 18; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeTriggered ==>[ProcessNodeTriggered(nodeId=7; id=1; nodeName= 年龄是否大于 18; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeLeft ==>[ProcessNodeLeft(nodeId=4; id=0; nodeName=StartPoint; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterNodeTriggered ==>[ProcessNodeTriggered(nodeId=4; id=0; nodeName=StartPoint; processName=BPTest; processId=FlowTest.BPTest)]
- DefaultRuleContainer afterProcessStarted ==>[ProcessStarted(name=BPTest; id=FlowTest.BPTest)]
Drools 是一个 Java 的商业过程实现,这是 Bob McWhirter 所编写的一个开源项目,由 JBoss 和 Red Hat Inc 支持。 Drools 提供一个核心的 Business Rules Engine(BRE) 和一个网页编写规则的管理系统(Drools Workbench)和 一个 Eclipse IDE 的插件,一同构成完整的 Drools 生态。
而这篇文章则主要侧重于 Drools Workbench。
org.guvnor.m2repo.dir
The workbench stores its data, by default in the directory $WORKING_DIRECTORY/.niogit, for example wildfly-8.0.0.Final/bin/.niogit, but it can be overridden with the system property -Dorg.uberfire.nio.git.dir.
Note In production, make sure to back up the workbench data directory.
18.1.3. System properties Here’s a list of all system properties:
org.uberfire.nio.git.dir: Location of the directory .niogit. Default: working directory
org.uberfire.nio.git.daemon.enabled: Enables/disables git daemon. Default: true
org.uberfire.nio.git.daemon.host: If git daemon enabled, uses this property as local host identifier. Default: localhost
org.uberfire.nio.git.daemon.port: If git daemon enabled, uses this property as port number. Default: 9418
org.uberfire.nio.git.ssh.enabled: Enables/disables ssh daemon. Default: true
org.uberfire.nio.git.ssh.host: If ssh daemon enabled, uses this property as local host identifier. Default: localhost
org.uberfire.nio.git.ssh.port: If ssh daemon enabled, uses this property as port number. Default: 8001
org.uberfire.nio.git.ssh.cert.dir: Location of the directory .security where local certificates will be stored. Default: working directory
org.uberfire.nio.git.ssh.passphrase: Passphrase to access your Operating Systems public keystore when cloning git repositories with scp style URLs; e.g. git@github.com:user/repository.git.
org.uberfire.metadata.index.dir: Place where Lucene .index folder will be stored. Default: working directory
org.uberfire.cluster.id: Name of the helix cluster, for example: kie-cluster
org.uberfire.cluster.zk: Connection string to zookeeper. This is of the form host1:port1,host2:port2,host3:port3, for example: localhost:2188
org.uberfire.cluster.local.id: Unique id of the helix cluster node, note that ‘:’ is replaced with ‘_’, for example: node1_12345
org.uberfire.cluster.vfs.lock: Name of the resource defined on helix cluster, for example: kie-vfs
org.uberfire.cluster.autostart: Delays VFS clustering until the application is fully initialized to avoid conflicts when all cluster members create local clones. Default: false
org.uberfire.sys.repo.monitor.disabled: Disable configuration monitor (do not disable unless you know what you’re doing). Default: false
org.uberfire.secure.key: Secret password used by password encryption. Default: org.uberfire.admin
org.uberfire.secure.alg: Crypto algorithm used by password encryption. Default: PBEWithMD5AndDES
org.uberfire.domain: security-domain name used by uberfire. Default: ApplicationRealm
org.guvnor.m2repo.dir: Place where Maven repository folder will be stored. Default: working-directory/repositories/kie
org.guvnor.project.gav.check.disabled: Disable GAV checks. Default: false
org.kie.example.repositories: Folder from where demo repositories will be cloned. The demo repositories need to have been obtained and placed in this folder. Demo repositories can be obtained from the kie-wb-6.2.0-SNAPSHOT-example-repositories.zip artifact. This System Property takes precedence over org.kie.demo and org.kie.example. Default: Not used.
org.kie.demo: Enables external clone of a demo application from GitHub. This System Property takes precedence over org.kie.example. Default: true
org.kie.example: Enables example structure composed by Repository, Organization Unit and Project. Default: false
org.kie.build.disable-project-explorer: Disable automatic build of selected Project in Project Explorer. Default: false
To change one of these system properties in a WildFly or JBoss EAP cluster:
Edit the file $JBOSS_HOME/domain/configuration/host.xml.
Locate the XML elements server that belong to the main-server-group and add a system property, for example:
Entware-ng 是一个适用于嵌入式系统的软件包库,使用 opkg 包管理系统进行管理。之前的路由器刷了 Openwrt 之后直接能用命令行安装相关命令,之后的路由器,NAS 也能安装 Entware-ng 。可以将 Entware-ng 想象成嵌入式设备的一个包管理软件,能方便的用来在嵌入式设备上安装软件,现在在官方的源上已经有超过 2000 个软件包。
相关网址:
在群晖上安装
更具体的可以参考我之前的文章
在 QNAP 上安装
和普通 Linux 下的包管理一样,只要输入命令就能够联网下载相关软件。
opkg update
opkg install git
所有软件包列表可以查看 http://pkg.entware.net/binaries/armv7/Packages.html
通过 opkg 安装的软件启动脚本在 /opt/etc/init.d/ 目录
单个启动命令 /opt/etc/init.d/software_name start
pidstat 是 sysstat 工具包含的一个命令,主要用于监控 Linux Kernel 管理的进程资源占用情况,包括 CPU,IO,内存,线程等等。
The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel.
pidstat 首次运行会显示系统自开机起各项统计,之后运行将显示从上一次运行到该次运行的统计信息。
apt-get install sysstat
pidstat [options] [interval] [times]
常用的参数:
-u
默认参数,显示各个进程的 CPU 统计信息-r
显示各个进程的内存使用情况-d
显示各个进程的 IO 使用-w
显示各个进程的上下文切换-p PID
指定 PID比如常见的每一秒查看 IO 统计,统计 10 次
pidstat -d 1 10
直接运行 pidstat
默认显示所有进程的 CPU 使用信息,等效于 pidstat -u -p ALL
pidstat -u 1 10
pidstat
Result fields:
Following command will display PID memory usage 10 times every 2 seconds:
pidstat -r 2 10
Result fields:
pidstat -d
Result field:
使用 -T [TASK|CHILD|ALL]
来报告打印更详细的信息,默认 pidstat 使用 TASK,表示监控独立的任务信息。
To show CPU, memory, IO:
pidstat -u -p PID
pidstat -r -p PID
pidstat -d -p PID
比如要查看 PID 为 12002 的进程的 CPU 使用情况,并且要查看所有子线程,每隔 1 秒输出一次,输出 10 次,则可以
pidstat -T ALL -u -p 12002 1 10
pidof finds the process id’s(pids) of the names programs.
pidof [name]
pidof chrome
pidof -s chrome
Options:
-s
instructs the program to only return one pid.This post will only list cross-platform softwares I used now. Each software has its own behaviors, and binded with its own shortcut. It takes time to be familiar with it. So I decided to use only cross-platform softwares in daily life in case I have to swith my main System. But it seems fine till now. I am happy with these great softwares.
DescriptionIntelliJ IDEA is a Java integrated development environment for developing computer software. It is developed by JetBrains, and is available as an Apache 2 Licensed community edition, and in a proprietary commercial edition. Both can be used for commercial development.
Open Sources Alternatives:
DescriptionGoogle Chrome is a cross-platform web browser developed by Google. It was first released in 2008 for Microsoft Windows, and was later ported to Linux, macOS, iOS, and Android. The browser is also the main component of Chrome OS, where it serves as the platform for web apps.
Alternatives:
SmartGit is a Git GUI client with support for SVN, GitHub, BitBucket pull requests and comments.
WizNote for Windows/Mac/Linux is a cross-platform cloud based note-taking client.
GoldenDict is an open-source dictionary program that gives translations of words and phrases for different languages. It allows the use of several popular dictionary file formats simultaneously and without conversion. The project aims to create a feature-rich dictionary search program.
TeamViewer is proprietary software for remote control, desktop sharing, online meetings, web conferencing and file transfer between computers.
pCloud is the secure cloud storage, where you can store, share and work on all your files.
VeraCrypt is a source-available freeware utility used for on-the-fly encryption. It can create a virtual encrypted disk within a file or encrypt a partition or the entire storage device with pre-boot authentication. VeraCrypt is a fork of the discontinued TrueCrypt project.
TagSpaces is an open-source data manager and file navigator. It helps organize files on local drives by adding tags to files. Users get the same user interface to manage their files on different platforms. TagSpaces is compatible with Windows, Linux, Mac, Android, iPhone, Firefox and Chrome.
Calibre is a cross-platform open-source suite of e-book software. Calibre supports organizing existing e-books into virtual libraries, displaying, editing, creating and converting e-books, as well as syncing e-books with a variety of e-readers. Editing books is supported for EPUB and AZW3 formats.
Telegram is a cloud-based instant messaging and voice over IP service developed by Telegram Messenger LLP, a privately held company registered in London, United Kingdom, founded by the Russian entrepreneur Pavel Durov and his brother Nikolai.
[[balenaEtcher]] is a powerful OS image flasher built with web technologies to ensure flashing an SDCard or USB drive is a pleasant and safe experience.