exit
exit
There are stopped jobs.

原因:有vim后以Ctrl+z退出挂起的任务,运行fg后,直接退出后即可。

来源:https://unix.stackexchange.com/questions/116959/there-are-stopped-jobs-on-bash-exit
Linux下处理JSON的命令行工具:jq---安装:
JSON是前端编程经常用到的格式。Linux下也有处理处理JSON的神器:jq。
       对于JSON格式而言,jq就像sed/awk/grep这些神器一样的方便,而且,jq没有乱七八糟的依赖,只需要一个binary文件jq,就足矣。
       本篇中,我们来看一下jq的安装。
1、执行yum list| grep jq查看是否有jq安装包。
2、若有,直接安装jq,执行命令:yum -y install jq。
安装完毕后,直接在命令行输入:jq,然后回车,看到以下信息说明安装完毕。
3.使用方法:
(1)简单使用: curl "http://127.0.0.1:8001/apis"|jq .
(2)获取显示Json里面的串及值:curl http://127.0.0.1:8001/apis|jq '.data[1].name'    得到返回:apiadmin

参考:http://blog.csdn.net/sunny_much/article/details/50668871

简单使用方式:
1,json文件友好显示
cat jsonfile | path_to_jq/jq .  

2,获取json某key的value
cat jsonfile | path_to_jq/jq ".key"  

3.较为复杂的结构里面的数据访问:
curl "http://127.0.0.1:8001/apis"|jq .data[0].upstream_url
"http://address.v1.service/address"
curl "http://127.0.0.1:8001/apis"|jq .total
1

curl "http://127.0.0.1:8001/apis"|jq .data[0].name
"address-service"

curl "http://127.0.0.1:8001/apis"|jq .data[0].hosts
[
  "address.mydomain.com"
]

curl "http://127.0.0.1:8001/apis"|jq .data[0].hosts[0]
"address.mydomain.com"

整个返回的结构体情况如下所示:
yum remove mysql时出现移除perl-DBD-MySQL的情况原因排查:
根本原因是之前的CentOS6.X里默认安装了mysql-libs,而在CentOS的7.x里,先安装了自己制作的Mysql包,于是出现:
1)CentOS6.X里需要:
rpm -q perl-DBD-MySQL --requires|grep libmysqlclient
libmysqlclient.so.16()(64bit)  
libmysqlclient.so.16(libmysqlclient_16)(64bit)  
2)CentOS7.X里需要:
rpm -q perl-DBD-MySQL --requires|grep libmysqlclient
libmysqlclient.so.18()(64bit)
libmysqlclient.so.18(libmysqlclient_18)(64bit)

而这两个不同版本的MySQL自制的包均分别提供了libmysqlclient.so.16@CentOS6.X和libmysqlclient.so.18@CentOS7.X(7里叫:mariadb-libs),且加入到动态链接库的cat /etc/ld.so.conf.d/mysql.conf,
/usr/local/mysql/lib,并ldconfig生效了,于是这个perl-DBD-MySQL就和它建立起了依赖,导致卸载Mysql@CentOS7.x时,因为perl-DBD-MySQL依赖mysql的libmysqlclient.so.18,于是出现被一同卸载的情况。怎么办@CentOS7.X里装perl-DBD-MySQL,先卸载Mysql一并把perl-DBD-MySQL卸载了,yum remove mysql -y,然后,yumdownloader mysql-libs,它会下载:mariadb-libs-5.5.56-2.el7.x86_64.rpm,rpm -ihv mariadb-libs-5.5.56-2.el7.x86_64.rpm,以解决直接yum install perl-DBD-MySQL时会出现安装:mysql-5.7.12-171123111505的情况,装好后,再安装yum install perl-DBD-MySQL ,也就不会安装mysql-5.7.12-171123111505了,因为链接已经在mariadb-libs-5.5.56有了,不需要mysql-5.7.12-171123111505来补充了。

一)CentOS7上安装perl-DBD-MySQL:
[root@ha_mysql-mha_manager_bj_szq_10_70_36_177 ~]# yum remove mysql
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.7.12-171123111505.el7.centos will be erased
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: perl-DBD-MySQL-4.023-5.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: perl-DBD-MySQL-4.023-5.el7.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.023-5.el7 will be erased
--> Finished Dependency Resolution

libmysqlclient.so.18被perl-DBD-MySQL需要:
ls -lart /usr/local/mysql/lib/libmysqlclient.so.18
/usr/local/mysql/lib/libmysqlclient.so.18 -> /usr/local/mysql/lib/libmysqlclient.so.18.1.0
rpm -qf /usr/local/mysql/lib/libmysqlclient.so.18.1.0
mysql-5.7.12-171123111505.el7.centos.x86_64

ldconfig -p|grep libmysqlclient.so.18
        libmysqlclient.so.18 (libc6,x86-64) => /usr/local/mysql/lib/libmysqlclient.so.18

验证,如果没有咱自己打的包的情况,理论上perl-DBD-MySQL也是和CentOS6.x一样需要这个mysql-libs的:
yumdownloader mysql-libs
rpm -qpl  mariadb-libs-5.5.56-2.el7.x86_64.rpm|grep libmysqlclient.so
/usr/lib64/mysql/libmysqlclient.so.18            #得证!!
/usr/lib64/mysql/libmysqlclient.so.18.0.0  


二)CentOS6.x Ver:
ldconfig -p|grep libmysqlclient.so
        libmysqlclient.so.16 (libc6,x86-64) => /usr/lib64/mysql/libmysqlclient.so.16
rpm -qf /usr/lib64/mysql/libmysqlclient.so.16
mysql-libs-5.1.73-7.el6.x86_64

[root@ha_mysql-mha-manager_bj_sjs_10_71_182_246 ~]验证依赖:
yum remove mysql-libs
perl-DBD-MySQL  x86_64  4.013-3.el6  @CentOS-Base
背景:有时操作一些命令出现问题,后来才发现,而如果把屏幕缓冲区设置大小变大,能够回看,有可能是一些”证据“,比如:挂载的NAS硬盘好的,一会 就不行了,这个会话的缓冲区大小设置大点能助于反查问题。

在使用SecureCRT操作设备时,默认的回滚行数为500行。可以通过打开[选项]->[会话选项]->[Terminal]->[Emulation]-[Scrollback],默认为500行,可以最大调整到128000行。
设置所有呢?
在Option->Global Option->General->Default Session->Edit Default Settings...->Session Options - Default->Terminal->Emulation->Scrollback :Scrollback Buffer:128000 ,点Ok后,如果你的那个 服务器太多,得卡住没有响应,等一会就好了,全部修改了。

来自:http://blog.csdn.net/imxiangzi/article/details/7457703
背景:MHA里面有的LVS有兄弟用这样一句,也不会LVS,好像是用来检测Mysql的进程否还活着的Shell,vrrp_script chk_mysqld { script "killall -0 mysqld && exit 0 || exit 1"。这句是否完备,实践发现如果对于多进程模型,可能并不完备,如下实践。

后台服务需要不间断运行,意外退出后,需要将其重新拉起。常常可以通过向进程发送信号0,然后根据返回值来判断一个进程是否存在。比如进程名字为A,那么
exsit="killall -0 A;echo $?"
exsit为0就表示进程A存在,否则表示不存在。
然而,当有多个进程名字都是A的时候,只有在全部名字为A的进程都退出后,exsit才非0,所以这种监控方法并不太适合多进程环境(为了负载均衡,服务器常常采用多进程)。

我们来看例子。
testbin.c

make testbin
g++     testbin.cpp   -o testbin

然后我们运行他。
     1.启动父子总共5个进程。
./testbin
Start.....
summer 42187 start.......
summer 42186 start.......
summer 42185 start.......
summer 42184 start.......

2.发送killall -0
killall -0 testbin && echo 0 || echo 1          
0

发现有进程接收了信号

3..杀掉一个子进程
ps aux|grep testbin
root     45125  0.0  0.1  11880  1048 pts/0    S+   10:52   0:00 ./testbin
root     45126  0.0  0.0  11748   392 pts/0    S+   10:52   0:00 ./testbin
root     45127  0.0  0.0  11880   400 pts/0    S+   10:52   0:00 ./testbin
root     45128  0.0  0.0  11880   400 pts/0    S+   10:52   0:00 ./testbin
root     45129  0.0  0.0  11880   400 pts/0    S+   10:52   0:00 ./testbin

kill -s 9 PID
----------------
kill -s 9 45125
kill -s 9 45126

kill -s 9 45129
killall -0 testbin && echo 0 || echo 1
0

killall -0 testbin && echo 0 || echo 1
0

最后还剩下一个进程了:
ps aux|grep testbin                    
root     45128  0.0  0.0  11880   400 pts/0    S    10:52   0:00 ./testbin
killall -0 testbin && echo 0 || echo 1
0


注意此时这个子进程成了僵尸进程。虽然现在只有4个进程,但是killall -0发出的信号仍然被接收,所以返回0.再杀一个,只剩3个所以仍然又能进程接收相关信号,返回0.

4..killall杀掉所有的父子进程
kill -s 9 45128

此时没有进程接收信号,返回1.
killall -0 testbin && echo 0 || echo 1
testbin: no process killed
1


实践源来自:http://blog.csdn.net/wjj547670933/article/details/44535761
http://m.blog.csdn.net/shen_gan/article/details/8167715
FreeBSD11.1好像不是这样的,清空/root/.bash_history没有用:在 /root/.history里,不是.bash_history。
  1000  1:10    mysql -S /tmp/mysql.sock
  1002  1:26    vi /root/.bash_history

history命令的記錄如何刪除?

1、修改/etc/profile將HISTSIZE=1000改成0或1

清除用戶home路徑下.bash_history

2、立即清空裏的history當前曆史命令的記錄

history -c

3、bash執行命令時不是馬上把命令名稱寫入history文件的,而是存放在內部的buffer中,等bash退出時會一並寫入。

不過,可以調用'history -w'命令要求bash立即更新history文件。

history -w
Linux/FreeBSD 终端/ssh登录前后的欢迎信息修改,均无问题,实践Ok,操作如下:
cat /etc/motd
Welcome to jackxiang's Compute Service !


From:http://xoyabc.blog.51cto.com/7401264/1679402
解决办法:
vi ~/.vimrc


=================================================
'titleold' 選項。替換固定的字符串 "Thanks for flying Vim",用來在退出時設置標題。
let &titleold=getcwd()
From:http://vim.wikia.com/wiki/Show_a_useful_title_on_exit_in_an_xterm

My current ~/.vimrc contains (in part)
set title
set titleold=""
set titlestring=VIM:\ %F

From:https://github.com/lazywei/vim-doc-tw/blob/master/doc/version5.twx
cd /usr/ports/devel/strace/ && make install clean
A package is not available for ports marked as: Forbidden / Broken / Ignore / Restricted
PKGNAME: strace
ONLY_FOR_ARCHS: i386 #不支持AMD.
distinfo:
SHA256 (strace-4.5.18.tar.bz2) = 95e7b7470e04f22c3ec8dc6d0b1fdd8944306cb5313c84c4545cd83abada26d0
SIZE (strace-4.5.18.tar.bz2) = 480973

Install strace

First update FreeBSD ports collection and install strace from /usr/ports/devel/strace:
# portsnap fetch update
# cd /usr/ports/devel/strace
# make install clean

From:https://www.cyberciti.biz/faq/howto-installl-strace-under-freebsd/
人脸识别项目的开源测试程序及代码: https://github.com/Insightzen/autocrop ,要Python2.7以上,得选CentOS7,6的版本低,得编译,还需要python2-pip,得找一个源,epll默认没有,得找一个扩展源,如下:
CentOS7的默认Python版本:Python 2.7.5 ,而autocrop需要装:python2-pip ,
得找一个源,CentOS7下面用Fedora的源,放到,/etc/yum.repos.d,如下:
第一个问题,FreeBSD 10 之後的版本改用unbound 代替了bind
所以已經沒有 nslookup , dig 等指令
可以改用host , drill 等指令
但如果還是習慣 nslookup的話
可以安裝bind-tools 套件

#cd /usr/ports/dns/bind-tools
#make install

安裝完後看看是否真的出現
# which nslookup
/usr/local/bin/nslookup

From:http://blog.sina.com.tw/helloworld/article.php?entryid=651089

cd /usr/ports/devel/git/ && make install clean
nc FreeBSD自带,而netcat需要自己安装,如下:
cd /usr/ports/net/netcat/ && make install clean

第二个问题,关于CentOS如何只知道命令不知道哪个包,而通过YUM的provides命令反查nslookup所在的软件包的?

32:bind-utils-9.9.4-51.el7.x86_64 : Utilities for querying DNS name servers
源    :updates
匹配来源:
文件名    :/usr/bin/nslookup

yum provides *bin/nslookup

32:bind-utils-9.9.4-38.el7_3.3.x86_64 : Utilities for querying DNS name servers
源    :@updates
匹配来源:
文件名    :/usr/bin/nslookup

================================================

nslookup這個指令對於網路除錯來說,應該是很多人都很習慣的工具
如果發現安裝好的Linux系統少了這個指令

[root@example ~]# nslookup myip.pass.tw
-bash: nslookup: command not found

[root@example ~]# which nslookup
/usr/bin/which: no nslookup in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

直接安裝看看咧? 找不到這個套件名稱
[root@example ~]# yum -y install nslookup
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.linode.com
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirrors.linode.com
* updates: mirrors.linode.com
No package nslookup available.
Error: Nothing to do

試試 yum provides 看看nslookup 是包含在哪個套件中
[root@example ~]# yum provides nslookup
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.linode.com
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirrors.linode.com
* updates: mirrors.linode.com
Warning: 3.0.x versions of yum would erroneously match against filenames.
You can use "*/nslookup" and/or "*bin/nslookup" to get that behaviour
No Matches found

依提示再搜尋一下,可以發現包含在bind-utils 套件中
[root@example ~]# yum provides */nslookup
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.linode.com
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirrors.linode.com
* updates: mirrors.linode.com
base/filelists_db                                                                                                                                                                                                     | 6.4 MB     00:00
epel/filelists_db                                                                                                                                                                                                     | 7.7 MB     00:01
extras/filelists_db                                                                                                                                                                                                   |  25 kB     00:00
updates/filelists_db                                                                                                                                                                                                  | 1.5 MB     00:00
zsh-4.3.11-4.el6.centos.2.x86_64 : A powerful interactive shell
Repo        : base
Matched from:
Filename    : /usr/share/zsh/4.3.11/functions/nslookup

32:bind-utils-9.8.2-0.62.rc1.el6.x86_64 : Utilities for querying DNS name servers
Repo        : base
Matched from:
Filename    : /usr/bin/nslookup

32:bind-utils-9.8.2-0.62.rc1.el6_9.2.x86_64 : Utilities for querying DNS name servers
Repo        : updates
Matched from:
Filename    : /usr/bin/nslookup

32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64 : Utilities for querying DNS name servers
Repo        : updates
Matched from:
Filename    : /usr/bin/nslookup

32:bind-utils-9.8.2-0.62.rc1.el6_9.1.x86_64 : Utilities for querying DNS name servers
Repo        : updates
Matched from:
Filename    : /usr/bin/nslookup

[root@example ~]# yum provides *bin/nslookup
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.linode.com
* epel: mirrors.kernel.org
* extras: mirrors.linode.com
* updates: mirrors.linode.com
32:bind-utils-9.8.2-0.62.rc1.el6.x86_64 : Utilities for querying DNS name servers
Repo        : base
Matched from:
Filename    : /usr/bin/nslookup

32:bind-utils-9.8.2-0.62.rc1.el6_9.2.x86_64 : Utilities for querying DNS name servers
Repo        : updates
Matched from:
Filename    : /usr/bin/nslookup

32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64 : Utilities for querying DNS name servers
Repo        : updates
Matched from:
Filename    : /usr/bin/nslookup

32:bind-utils-9.8.2-0.62.rc1.el6_9.1.x86_64 : Utilities for querying DNS name servers
Repo        : updates
Matched from:
Filename    : /usr/bin/nslookup

安裝 bind-utils
[root@example ~]# yum -y install bind-utils
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.linode.com
* epel: mirrors.kernel.org
* extras: mirrors.linode.com
* updates: mirrors.linode.com
Resolving Dependencies
--> Running transaction check
---> Package bind-utils.x86_64 32:9.8.2-0.62.rc1.el6_9.4 will be installed
--> Processing Dependency: bind-libs = 32:9.8.2-0.62.rc1.el6_9.4 for package: 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64
--> Processing Dependency: liblwres.so.80()(64bit) for package: 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64
--> Processing Dependency: libisccfg.so.82()(64bit) for package: 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64
--> Processing Dependency: libisccc.so.80()(64bit) for package: 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64
--> Processing Dependency: libisc.so.83()(64bit) for package: 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64
--> Processing Dependency: libdns.so.81()(64bit) for package: 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64
--> Processing Dependency: libbind9.so.80()(64bit) for package: 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64
--> Running transaction check
---> Package bind-libs.x86_64 32:9.8.2-0.62.rc1.el6_9.4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
Package                                                Arch                                               Version                                                                 Repository                                           Size
=============================================================================================================================================================================================================================================
Installing:
bind-utils                                             x86_64                                             32:9.8.2-0.62.rc1.el6_9.4                                               updates                                             189 k
Installing for dependencies:
bind-libs                                              x86_64                                             32:9.8.2-0.62.rc1.el6_9.4                                               updates                                             892 k

Transaction Summary
=============================================================================================================================================================================================================================================
Install       2 Package(s)

Total download size: 1.1 M
Installed size: 2.7 M
Downloading Packages:
(1/2): bind-libs-9.8.2-0.62.rc1.el6_9.4.x86_64.rpm                                                                                                                                                                    | 892 kB     00:00
(2/2): bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64.rpm                                                                                                                                                                   | 189 kB     00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                         44 MB/s | 1.1 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 32:bind-libs-9.8.2-0.62.rc1.el6_9.4.x86_64                                                                                                                                                                                1/2
  Installing : 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64                                                                                                                                                                               2/2
  Verifying  : 32:bind-libs-9.8.2-0.62.rc1.el6_9.4.x86_64                                                                                                                                                                                1/2
  Verifying  : 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64                                                                                                                                                                               2/2

Installed:
  bind-utils.x86_64 32:9.8.2-0.62.rc1.el6_9.4

Dependency Installed:
  bind-libs.x86_64 32:9.8.2-0.62.rc1.el6_9.4

Complete!

来自:http://blog.sina.com.tw/helloworld/article.php?pbgid=170996&entryid=657249
在CentOS下面打Rpm包时用 make install DESTDIR=%{buildroot} ,而在FreeBSD下用make PREFIX=/usr/local/redis install 好像也成:

cd /usr/ports/databases/redis
make PREFIX=/usr/local/redis install

/usr/local/redis/bin/redis-server
/usr/local/redis/bin/redis-cli
/usr/local/redis/bin/redis-check-rdb
/usr/local/redis/bin/redis-benchmark
/usr/local/redis/bin/redis-sentinel

From:https://www.iyunv.com/thread-51148-1-1.html
进程启动时指定CPU
命令taskset -c 1 ./redis-server ../redis.conf

taskset
taskset是LINUX提供的一个命令(ubuntu系统可能需要自行安装,schedutils package)。他可以让某个程序运行在某个(或)某些CPU上。


指定进程运行在某个特定的CPU上

命令taskset -pc 3 21184

显示结果:

pid 21184's current affinity list: 0-23
pid 21184's new affinity list: 3

注:3表示CPU将只会运行在第4个CPU上(从0开始计数)。


来自:http://blog.csdn.net/xluren/article/details/43202201
http://www.361way.com/linux-context-switch/5131.html
5  8781  0.0 /usr/lib64/sa/sadc -F -L -S DISK 1 1 -
  5   879  0.0 [kauditd]
  5  8950  0.0 CROND
  5  8951  0.0 /usr/lib64/sa/sadc -F -L -S DISK 1 1 -
  5  9116  0.0 CROND
  5  9117  0.0 /usr/lib64/sa/sadc -F -L -S DISK 1 1 -
  5  9286  0.0 CROND
  5  9287  0.0 /usr/lib64/sa/sadc -F -L -S DISK 1 1 -
  5   930  0.0 CROND
  5   931  0.0 /usr/lib64/sa/sadc -F -L -S DISK 1 1 -
  5    94  0.0 [md_misc/5]
  5  9489  0.0 CROND
  5  9490  0.0 /usr/lib64/sa/sadc -F -L -S DISK 1 1 -
  5  9659  0.0 CROND
  5  9660  0.0 /usr/lib64/sa/sadc -F -L -S DISK 1 1 -
  5  9829  0.0 CROND
  5  9830  0.0 /usr/lib64/sa/sadc -F -L -S DISK 1 1 -

首先需要安装一个包
# rpm -qa sysstat
sysstat-7.0.2-3.el5
这个包安装了一些很有用的文件
# rpm -ql sysstat
/usr/lib/sa/sadc
rpm -qa|grep sysstat
rpm -ql sysstat|grep sadc
/usr/lib64/sa/sadc

=====================================================
要启动SAR,必须通过cron工具以周期性的间隔启动。
安装sysstat包后,默认创建一个/etc/cron.d/sysstat文件,其默认内容为:
# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib/sa/sa2 -A
这里用到了两个命令
/usr/lib/sa/sa1
/usr/lib/sa/sa2
sa1:是调用sadc(二进制文件),将数据收集到二进制日志文件的一个Shell脚本。sa1命令还确保每天使用不同的文件。每隔十分钟运行一次该命令,最好不要改这个值,这是对一般系统折中的值。二进制日志文件存放在/var/log/sa/目录下,命名为sa${DATE}。
sa2:是将当日二进制日志文件中所有的数据转储到文本文件(sar)的另一个Shell脚本,然后它将清除七天之前的所有日志文件。参数-A指定了从二进制文件中提取哪些数据转储到文本文件中。转储的文件存放在/var/log/sa/目录下,命名为sar${DATE}。
这两个命令要配合着使用。
(强烈建议看一下这两个命令的脚本)


查看一下/usr/lib/sa/sa1脚本,里面执行这样一句命令:
/usr/lib/sa/sadc -F -L 1 1 -
-F:强制指定一个储存文件,如果文件已存在,就将其转换成sa的二进制文件形式。
-L:给sa文件加互斥锁,不能让两个sadc进程同时写一个sa文件。


跟据sa1脚本中的命令,我们也可以手动的创建sa二进制文件,使用/usr/lib/sa/sadc命令,
# /usr/lib/sa/sadc 1 10 /tmp/jaylin_sa
上述命令的作用是:每隔1s写一条记录,写10条,存放到二进制文件/tmp/jaylin_sa中。


查看一下/usr/lib/sa/sa2脚本,里面执行这样一句命令:
/usr/bin/sar -A -f /var/log/sa/sa${DATE} > /var/log/sa/sar${DATE}
-A:列出所有存储在/var/log/sa/sa${DATE}里的统计信息。
-f:指定将要转储的sa文件,默认的参数值为/var/log/sa/sa${DATE}。

From:
http://linuxguest.blog.51cto.com/195664/541178/
/usr/local/bin/lrx
/usr/local/bin/lrz
/usr/local/bin/lsb
/usr/local/bin/lrb
/usr/local/bin/lsx
/usr/local/bin/lsz


Cause

This problem may be caused by improper handling of escape sequences embedded in the files being uploaded.

Resolution

Use the -e or --escape option on lrz, which escapes control characters (Z). For example, type, lrz -e. Some Zmodem clients expect escaping, while others do not.
Notes

Note, some installations of lrzsz do not have the "sz" or "rz" commands, only "lsz" and "lrz". You can edit your .login file and add lines like "alias sz lsz" and "alias rz lrz -e". This way, when you type "sz" or "rz", it will automatically execute the right program with the right options.

lrzsz is part of the FreeBSD ports collection. It contains a set of shell commands for sending and receiving files via the X/Y/ZMODEM protocols. Your SSH or Telnet client must support them for transfers to work.

阅读全文
用处:strings命令主要用来做查看二进制的编译文件里面某个.c/.cpp文件编译到那个.so库中去了,或查看它调用了哪些库文件.
strings命令很简单, 看起来好像没什么, 但实际有很多用途。 下面, 我来举一个例子。  在大型的软件开发中, 假设有100个.c/.cpp文件, 这个.cpp文件最终生成10个.so库, 那么怎样才能快速知道某个.c/.cpp文件编译到那个.so库中去了呢? 当然, 你可能要说, 看makefile不就知道了。 对, 看makefile肯定可以, 但如下方法更好, 直接用命令:
      strings -f "*.so" | grep "xxxxxx"




/usr/local/node/bin/node


来自:http://blog.csdn.net/stpeace/article/details/46641069
二、Node编译高版本涉及Gcc相关的编译安装过程Url:
http://www.cnblogs.com/dee0912/p/5272149.html

关于编译Node的GCC版本升级:
1)linux下升级gcc的方法 – 亲测可用:https://www.cppfans.org/1719.html
2)编译安装 gcc 4.9并验证使用:http://blog.csdn.net/hzhxxx/article/details/28634893
http://winmerge.org/
使用 CMAKE_INSTALL_PREFIX 来指定。
方法1:
[plain] view plain copy print?
cmake -DCMAKE_INSTALL_PREFIX=/usr ..  

方法二:
修改cmake文件,加入:
SET(CMAKE_INSTALL_PREFIX < install_path >)  

要加在 PROJECT(< project_name>) 之后。


摘录:
Default Build and Installation:

Installing vidstab library:

cd path/to/vid.stab/dir/
cmake .
make
sudo make install
默认会安装到:
1).h文件:
/usr/local/include/vid.stab
2).so文件:
/usr/local/lib/libvidstab.so


于是,想安装到指定目录,经rpmbuild打包修改成:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ffmpeg



来自:http://blog.csdn.net/caspiansea/article/details/53526725
分页: 1/23 第一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 下页 最后页 [ 显示模式: 摘要 | 列表 ]