[linux]kill more than one process use ps aux grep awk
you can use ps aux ,grep find your program name
#ps aux | grep "prog_name"
using awk to parse process id
#ps aux | grep "prog_name" | awk '{print $2}'
kill all process
公告版位
目前分類:linux (29)
- Dec 06 Fri 2013 16:37
[linux]kill more than one process use ps aux grep awk
- Dec 05 Thu 2013 17:14
[linux] 引數列項目過長 argument list too long
buffer 的大小是 MAX_ARG_PAGES * "page 大小" --- 一般而言是 32 * 4k = 128k。
On Linux prior to kernel 2.6.23, the memory used to store the
environment and argument strings was limited to 32 pages
(defined by the kernel constant MAX_ARG_PAGES). On
architectures with a 4-kB page size, this yields a maximum size
of 128 kB.
- Dec 05 Thu 2013 16:53
[linux]system argv maximum length
[linux]system argv maximum length
如何得知 system command line 的 argv 最大長度,
可以使用 getconf 去取得。
root@renode2[/var/log]{14:52}# getconf ARG_MAX
2621440
查看Linux的系统配置-参数长度最大限制(_SC_ARG_MAX)_百度知道
http://zhidao.baidu.com/question/596291318.html
python sys.argv limitations? - Stack Overflow
- Dec 05 Thu 2013 15:23
[git]git pull 遇到 error: Your local changes to the following files would be overwritten by merge:
[git]git pull 遇到 error: Your local changes to the following files would be overwritten by merge:
有部分程式,更改了但是沒有commit 。
- Oct 02 Wed 2013 17:00
[eclipse][ubuntu] eclipse cant not start java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
$ cat 1380704328894.log
!SESSION 2013-10-02 16:58:48.757 -----------------------------------------------
eclipse.buildId=I20110613-1736
java.version=1.6.0_34
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=zh_TW
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2013-10-02 16:58:50.031
!MESSAGE Application error
- Sep 17 Tue 2013 17:33
[linux]settup passwordliess login
peicheng@TW-PCLIAO:~
$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@renode2
Warning: the RSA host key for 'renode2' differs from the key for the IP address '10.1.191.177'
Offending key for IP in /home/peicheng/.ssh/known_hosts:28
Matching host key in /home/peicheng/.ssh/known_hosts:78
Are you sure you want to continue connecting (yes/no)? yes
peicheng@TW-PCLIAO:~
- Sep 04 Wed 2013 18:17
[mysql] primary key AUTO_INCREMENT reset
想要重置mysql 內的 AUTO INCREMENT
可以使用 來重置 遞增數值。
ALTER TABLE TABLENAME AUTO_INCREMENT =1
- Aug 27 Tue 2013 18:29
[linux] mac divvy like on linux
在 mac 可以方便使用 divvy 來放大縮小 應用程式 成 grid顯示,
在linux 可以使用 ration 來達到這點。
onyxfish/ration
https://github.com/onyxfish/ration
- Aug 19 Mon 2013 15:40
[linux][puppet] puppet local mode
使用 puppet local mode 只需要
- sync your pp file
- puppet apply ppfile
可以減少網路溝通與Master slave 間的問題。
hortonworks HDP , 與 apache ambari hadoop management tools 就是採用這種方式管理 hadoop cluster
puppet apply Manual Page — Documentation — Puppet Labs
http://docs.puppetlabs.com/man/apply.html
- Aug 13 Tue 2013 11:23
[linux] easy_install Python.h error
in centos
try
yum install python-devel
root@reservice[/tmp/pymmseg-cpp]{11:20}# python setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.6
creating build/lib.linux-x86_64-2.6/mmseg
- Aug 02 Fri 2013 11:09
[linux][gcin] 導出 gcin 詞庫 字典
若有 剛安裝時的 tsin32 檔案 即可使用diff 比較找出新增詞
new.txt 為 所有的辭典 詞庫
cd .gcin
tsd2a32 -nousecount ~/.gcin/tsin32 > new.txt
diff -u tsin.src new.txt | grep '^+' | sed -e "s/^+//" > diff.txt
- May 16 Thu 2013 10:31
[git]取消 git add 之後 的 file / remove add file(stage) to unstage
常常有時候我們在使用git add 後,並不想要真的在這次commit提交這幾個file。
在這個 status內,我們可以使用 git rm --cache ... 去unstage
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
- Apr 30 Tue 2013 18:36
[linux]ssh passwordless login authorized_keys permission
root@am1[~]{18:23}# ssh-copy-id -i ~/.ssh/id_rsa.pub am3
root@am3's password:
Now try logging into the machine, with "ssh 'am3'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
因為之前有更改,am3上的 /root 的權限,
所以只要改回把 .ssh 與 .ssh/authorized_keys 改回正確的權限,
- Mar 26 Tue 2013 01:35
[git] ! [rejected] master -> master (non-fast-forward)
root@hct1[~/linux-work-env]{01:32}(0)# git push -u origin master
Password:
To https://peicheng@github.com/peicheng/linux-work-env.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://peicheng@github.com/peicheng/linux-work-env.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
- Mar 25 Mon 2013 20:49
[ubuntu] ubuntu 12.04 read exfat
由於要於mac使用同樣的硬碟環境,
選擇使用windows也能讀的exfat 。
apt-add-repository ppa:relan/exfat
apt-get update
apt-get install fuse-exfat
- Mar 06 Wed 2013 10:48
[db]show tables in postgresql
postgresql 內怎麼show tables
show tables in postgresql - Stack Overflow
http://stackoverflow.com/questions/769683/show-tables-in-postgresql
使用
\c dbname
\l
就會列出所有的tables
- Jan 02 Wed 2013 14:17
[ubuntu]12.04 gcin add icon到 狀態列
[ubuntu]12.04 gcin add icon到 狀態列
1.在狀態列按 win + alt + 右鍵
2.選 加到面板
3.選 程式狀態通知區 加入
- Jan 02 Wed 2013 14:11
[ubuntu]Add public key behind a firewall in Ubuntu
[ubuntu]Add public key behind a firewall in Ubuntu
from
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key E084DAB9
to
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80/ --recv-key E084DAB9
- Dec 22 Sat 2012 23:42
[linux]PHP Fatal error: Class 'DOMDocument' not found
PHP Fatal error: Class 'DOMDocument' not found
yum install php-xml
- Dec 11 Tue 2012 23:15
[puppet]如何使用 Example42 的 Puppet 模块 | vpsee.com http://www.vpsee.com/2012/05/using-puppet-modules-from-example42/
如何使用 Example42 的 Puppet 模块 | vpsee.com
http://www.vpsee.com/2012/05/using-puppet-modules-from-example42/