2013年3月16日 星期六
vim的進階用法
http://www.openfoundry.org/en/tech-column/2383-vim--buffers-and-windows
http://c9s.blogspot.tw/2007/07/vim-tips-split-window.html
XenServer Disk Space Reclaiming
coalescing
When snapshots or clones are deleted on LVM-based, Local EXT and NFS SRs, XenServer automatically reclaims disk space by freeing unused data, a process known as coalescing.XenServer coalesces the disk space while Virtual Machines (VMs) remain running (online coalescing).
[指令]
coalesce-leaf <VM-UUID>
參考網址
http://support.citrix.com/article/CTX123400
2013年3月15日 星期五
2013年3月14日 星期四
pull requests
https://help.github.com/articles/using-pull-requests
pull requests
pull有"招致"、"吸引"的意思
pull requests就是讓你告訴參與該專案的其他人你將會改變那些部分然後push回GitHub repo.一旦pull request送出,有興趣的人就可以檢閱有哪些部分有改變過,然後討論是否要進行更進一步的修改。
Pull requests let you tell others about changes you've pushed to a GitHub repository. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.
Reference
http://edwardinaction.blogspot.tw/2012/05/github-pull-requests.html
http://www.worldhello.net/gotgithub/04-work-with-others/010-fork-and-pull.html
http://tw.polydice.com/2012/05/08/github-pull-requests/
Pull requests let you tell others about changes you've pushed to a GitHub repository. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.
一般的協同開發模式( Collaborative Development Models )可以分成兩種:
1. Fork & Pull
-- lets anyone fork an existing repository and push changes to their personal fork without requiring access be granted to the source repository.
-- The changes must then be pulled into the source repository by the project maintainer.
-- This model reduces the amount of friction for new contributors and is popular with open source projects because it allows people to work independently without upfront coordination.
2. Shared Repository Model
-- more prevalent with small teams and organizations collaborating on private projects
-- Everyone is granted push access to a single shared repository and topic branches are used to isolate changes.
-- Everyone is granted push access to a single shared repository and topic branches are used to isolate changes.
Reference
http://edwardinaction.blogspot.tw/2012/05/github-pull-requests.html
http://www.worldhello.net/gotgithub/04-work-with-others/010-fork-and-pull.html
http://tw.polydice.com/2012/05/08/github-pull-requests/
2013年3月11日 星期一
2013年3月10日 星期日
2013年3月9日 星期六
exec
- http://imxfox.appspot.com/?p=118002
- exec家族比較, http://man7.org/linux/man-pages/man3/execl.3.html
- http://tc.itkee.com/os/detail-1bae.html
- http://linux.about.com/od/commands/l/blcmdln_exec.htm
#include <unistd.h>
extern char **environ;
int execl(const char *path, const char *arg, ...);
int execlp(const char *file, const char *arg, ...);
int execle(const char *path, const char *arg,..., char * const envp[]);
int execv(const char *path, char *const argv[]);
int execvp(const char *file, char *const argv[]);
int execvpe(const char *file, char *const argv[], char *const envp[]);
getent - get entries from Name Service Switch libraries
getent - get entries from Name Service Switch libraries
getent database [key ...]
The getent command displays entries from databases supported by the Name Service Switch libraries, which are configured in /etc/nsswitch.conf. If one or more key arguments are provided, then only the entries that match the supplied keys will be displayed.Otherwise, if no key is provided, all entries will be displayed (unless the database does not support enumeration).
2013年3月8日 星期五
2013年3月7日 星期四
main和_tmain的差別
main是c程式的起始函數
_tmain是main為了支援unicode所使用的main的變形(別名)
_tmain的定義在tchar.h可以找到,如
#define _tmain main
所以要加#include <tchar.h>才能用
不過visual studio的程式會自動加
#include “stdafx.h"
而stdafx.h中會自動加#include <tchar.h>
所以沒問題因此_tmain compile後仍為main
所以都可以執行
另外,wmain也是main的另一個變形,是為了支援二個bytes的語系
———————–
int main( int argc[ , char *argv[ ] [, char *envp[ ] ] ] );
wmain( int argc, wchar_t *argv[ ], wchar_t *envp[ ] )
int _tmain(int argc, _TCHAR* argv[])
———————–
int main( int argc[ , char *argv[ ] [, char *envp[ ] ] ] );
wmain( int argc, wchar_t *argv[ ], wchar_t *envp[ ] )
int _tmain(int argc, _TCHAR* argv[])
http://lex0912.wordpress.com/2006/03/08/_tmain%E8%88%87main%E7%9A%84%E5%8D%80%E5%88%A5/
init
http://caoruntao.iteye.com/blog/666780
http://fanqiang.chinaunix.net/a1/b1/20010828/0900001195_b.html
2013年3月6日 星期三
bash script return value
http://www.linuxjournal.com/content/return-values-bash-functions
1. return a value from a bash function is to just set a global variable to the result.
// the simplest way since all variables in bash are global by default
function myfunc() { myresult='some value' } myfunc echo $myresult
2. command substitution
function myfunc() { local myresult='some value' echo "$myresult" } result=$(myfunc) # or result=`myfunc` echo $result
訂閱:
文章 (Atom)