原创 C語言中的三目運算符 ?: 的新用法

說明: 該運算符不僅能用在變量之間,竟然還可以用在函數之間,相當於可傳參數的函數調用  1 void show_1(int val)  2 {  3     cout << "function show_1 called! and var

原创 Top Ten Reasons not to use the C shell

不是公司的默認環境是csh的話,真不想花太多時間看csh編程(還是bash正統~~~)  http://www.grymoire.com/Unix/CshTop10.txt

原创 iptc example

轉自:http://wiki.tldp.org/iptc%20library%20HOWTO   now let's see the small example (the working one). We'd like to create

原创 將here doc輸出的內容保存到文件,當文件超過閾值,動態更新文件名

需求: 1. sqlplus查詢結果保存到文件(腳本里我暫用cat代替sqlplus語句),文件名格式  <日期>_ <批號>,批號範圍0000-9999; 2. 當文件大於2M自動替換文件名(批號部分加1),分割時要求保證數據完整性。

原创 Automation UI testing with VNC

If we’d like to test with UI program that needs a display available, this is handy to run an VNC session during the

原创 what is the different between function and method in python

Recently, I’m concentrating on nose plugin development. Some people would be confused with some descriptions in ht

原创 使用自定義用戶登陸Vagrant box

使用過vagrant的人都知道,vagrant up後就可以使用vagrant ssh免密碼登陸box了。 其實vagrant ssh也可以分解成兩步 # save the config to a file vagrant ss

原创 Term::ANSIColor 使用

推薦用法: use Term::ANSIColor qw(:constants); $Term::ANSIColor::AUTORESET = 1; print BOLD BLUE "This text is in

原创 關閉SUSE上的防火牆

最近在搞SCTP測試,發現我的服務器上一直沒有回INIT_ACK,後來發現是因爲SUSE上的防火牆把包都丟了。 於是想屏蔽防火牆,去網上查了一下,都說用chkconfig來永久關閉防火牆。 結果我那服務器上chkconfig --list

原创 歡迎使用CSDN-markdown編輯器

sub getDate { my $DATE = "0"; ($day, $month, $year, $hour, $min, $sec) = (localtime)[3, 4, 5, 2, 1,

原创 使用ssh端口映射

由於最新項目裏需要用到虛擬機,但是我們每次訪問虛擬機都要一臺機器中轉,測試起來就不方便,所以我們用到了ssh端口轉換. A機器: 編譯機器,可以運行tcl腳本做target test,但是不能直接訪問vm B機器:中轉機器,可以同時訪問A

原创 perl 如何將多個map的結果返回給數組

Map的用法想必大家都很熟悉,比如想把數字前面加上一個“num”前綴,然後返回。 my @list = map {"num$_"} (1 .. 10);但是如果我想再增加一個把所有的字母前面加一個“str”前綴,該怎麼寫,這時候,我們可以

原创 Jenkins啓動用戶鑑權

Either Jenkins needs to run as root or User‘jenkins’  needs to belong to group root and ‘chmod g+r /etc/shadow’  needs

原创 如何在Git中撤銷一切

 任何一個版本控制系統中,最有用的特性之一莫過於 “撤銷(undo)”操作。在Git中,“撤銷”有很多種含義。 當你完成了一次新的提交(commit),Git會及時存儲當前時刻倉庫(repository)的快照(snapshot);你

原创 python-ntlm認證

轉自:http://www.cnblogs.com/yd1227/archive/2009/09/29/1576380.html Python library that provides NTLM support, including a