[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
peicheng 發表在 痞客邦 留言(0) 人氣()
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
peicheng 發表在 痞客邦 留言(0) 人氣()
[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
peicheng 發表在 痞客邦 留言(0) 人氣()
[git]git pull 遇到 error: Your local changes to the following files would be overwritten by merge:
有部分程式,更改了但是沒有commit 。
peicheng 發表在 痞客邦 留言(0) 人氣()
$ 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
peicheng 發表在 痞客邦 留言(0) 人氣()
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:~
peicheng 發表在 痞客邦 留言(0) 人氣()
想要重置mysql 內的 AUTO INCREMENT
可以使用 來重置 遞增數值。
ALTER TABLE TABLENAME AUTO_INCREMENT =1
peicheng 發表在 痞客邦 留言(0) 人氣()
在 mac 可以方便使用 divvy 來放大縮小 應用程式 成 grid顯示,
在linux 可以使用 ration 來達到這點。
onyxfish/ration
https://github.com/onyxfish/ration
peicheng 發表在 痞客邦 留言(0) 人氣()
使用 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
peicheng 發表在 痞客邦 留言(0) 人氣()
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
peicheng 發表在 痞客邦 留言(0) 人氣()
若有 剛安裝時的 tsin32 檔案 即可使用diff 比較找出新增詞
new.txt 為 所有的辭典 詞庫
cd .gcin
tsd2a32 -nousecount ~/.gcin/tsin32 > new.txt
diff -u tsin.src new.txt | grep '^+' | sed -e "s/^+//" > diff.txt
peicheng 發表在 痞客邦 留言(0) 人氣()
常常有時候我們在使用git add 後,並不想要真的在這次commit提交這幾個file。
在這個 status內,我們可以使用 git rm --cache ... 去unstage
$ git status
# On branch master
#
# Initial commit
#
peicheng 發表在 痞客邦 留言(0) 人氣()
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 的權限,
peicheng 發表在 痞客邦 留言(0) 人氣()
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.
peicheng 發表在 痞客邦 留言(0) 人氣()
由於要於mac使用同樣的硬碟環境,
選擇使用windows也能讀的exfat 。
apt-add-repository ppa:relan/exfat
apt-get update
apt-get install fuse-exfat
peicheng 發表在 痞客邦 留言(0) 人氣()
postgresql 內怎麼show tables
show tables in postgresql - Stack Overflow
http://stackoverflow.com/questions/769683/show-tables-in-postgresql
使用
\c dbname
\l
就會列出所有的tables
peicheng 發表在 痞客邦 留言(0) 人氣()
[ubuntu]12.04 gcin add icon到 狀態列
1.在狀態列按 win + alt + 右鍵
2.選 加到面板
3.選 程式狀態通知區 加入
peicheng 發表在 痞客邦 留言(0) 人氣()
[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
peicheng 發表在 痞客邦 留言(0) 人氣()
PHP Fatal error: Class 'DOMDocument' not found
yum install php-xml
peicheng 發表在 痞客邦 留言(0) 人氣()
peicheng 發表在 痞客邦 留言(0) 人氣()