首先 先選擇一個LINUX 系統 我選了Fedora 15 for Bugzilla 3.6.9 /Fedora 18 for Bugzilla 4.4/Ubuntu9.04 for Bugzilla
1. 先檢查 perl -v
2. 安裝DB, 我選擇 Mysql -v
3. 下載 bugzilla 4.x版本 copy 到 /var/www/html
4. 解壓縮 tar -zxvf bugzilla-4.4.tar.gz
5. 將folder 名子改成bugzilla
6. 檢查modules ./checksetup.pl --check-modules
7. ./checksetup.pl --all
8. 開一個mysql id 'bugs' 並設定密碼
9. /etc/init.d/mysqld restart
10. ./checksetup.pl => 設定bugzilla administrator 帳密
11. 設定
# Allow packets up to 4MB
1. 先檢查 perl -v
2. 安裝DB, 我選擇 Mysql -v
3. 下載 bugzilla 4.x版本 copy 到 /var/www/html
4. 解壓縮 tar -zxvf bugzilla-4.4.tar.gz
5. 將folder 名子改成bugzilla
6. 檢查modules ./checksetup.pl --check-modules
7. ./checksetup.pl --all
8. 開一個mysql id 'bugs' 並設定密碼
9. /etc/init.d/mysqld restart
10. ./checksetup.pl => 設定bugzilla administrator 帳密
11. 設定
# Allow packets up to 4MB
max_allowed_packet=4M
12. 設定 Apache
# grep webserver group localconfig
12. 設定 Apache
# grep webserver group localconfig
$webservergroup = 'apache';
# grep Group /etc/httpd/conf/httpd.conf
Group apache
11. 設定參數, 參考下面設定
12. 最後service httpd restart
13. 開browser 連 http://127.0.0.1/bugzilla
webservergroup = 'www-data';
11. 設定參數, 參考下面設定
12. 最後service httpd restart
13. 開browser 連 http://127.0.0.1/bugzilla
webservergroup = 'www-data';
The directory had rw permissions
:sudo chown -R www-data:www-data /var/www/bugzilla
[Reference]
Bugzilla Configure setting
http://www.bugzilla.org/docs/tip/en/html/parameters.html
Linux command related
Copy folder
http://linux.about.com/od/commands/l/blcmdl1_cp.htm
MySql related
http://www.cyberciti.biz/faq/mysql-change-user-password/
http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html
http://emn178.pixnet.net/blog/post/87659567-mysql%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A2%BC%E8%88%87%E5%BF%98%E8%A8%98%E5%AF%86%E7%A2%BC%E9%87%8D%E8%A8%AD
Apache related
http://www.cyberciti.biz/faq/starting-restarting-stopping-apache-server-on-fedora/
Configure related
http://letitknow.wordpress.com/2012/05/08/bugzilla-install-apache-sizelimit/
PostlfixMail server setup related
http://www.postfix.org/BASIC_CONFIGURATION_README.html
http://ubuntuforums.org/archive/index.php/t-1448858.html
GCC install related
http://stackoverflow.com/questions/15856288/gcc-installation-on-fedora-18-x86-64
Error 500 problem
Use chcon to fix *.cgi permission
http://forums.fedoraforum.org/showthread.php?t=248812
http://www.cnblogs.com/vipsoft/archive/2013/06/06/3121302.html
Bugzilla on Liunx setting up
http://www.thegeekstuff.com/2010/05/install-bugzilla-on-linux/
http://asingh.com.np/blog/how-to-install-bugzilla/
http://kevin-deleon.com/2010/07/tutorial-installing-bugzilla-on-fedora-11-centos-5/
http://ravindrasinghgohil.blogspot.in/2012/02/steps-to-install-bugzilla-42-on-centos.html
http://blog.codylab.com/install-bugzilla-centos-6-3-step-step/
[Reference]
Bugzilla Configure setting
http://www.bugzilla.org/docs/tip/en/html/parameters.html
Linux command related
Copy folder
http://linux.about.com/od/commands/l/blcmdl1_cp.htm
MySql related
http://www.cyberciti.biz/faq/mysql-change-user-password/
http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html
http://emn178.pixnet.net/blog/post/87659567-mysql%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A2%BC%E8%88%87%E5%BF%98%E8%A8%98%E5%AF%86%E7%A2%BC%E9%87%8D%E8%A8%AD
Apache related
http://www.cyberciti.biz/faq/starting-restarting-stopping-apache-server-on-fedora/
Configure related
http://letitknow.wordpress.com/2012/05/08/bugzilla-install-apache-sizelimit/
PostlfixMail server setup related
http://www.postfix.org/BASIC_CONFIGURATION_README.html
http://ubuntuforums.org/archive/index.php/t-1448858.html
GCC install related
http://stackoverflow.com/questions/15856288/gcc-installation-on-fedora-18-x86-64
Error 500 problem
Use chcon to fix *.cgi permission
http://forums.fedoraforum.org/showthread.php?t=248812
http://www.cnblogs.com/vipsoft/archive/2013/06/06/3121302.html
Bugzilla on Liunx setting up
http://www.thegeekstuff.com/2010/05/install-bugzilla-on-linux/
http://asingh.com.np/blog/how-to-install-bugzilla/
http://kevin-deleon.com/2010/07/tutorial-installing-bugzilla-on-fedora-11-centos-5/
http://ravindrasinghgohil.blogspot.in/2012/02/steps-to-install-bugzilla-42-on-centos.html
http://blog.codylab.com/install-bugzilla-centos-6-3-step-step/
最近在研究遠端重開機
找到下面幾個方法:
Command:
http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx
http://www.online-tech-tips.com/computer-tips/remote-shutdown-command/
RPC:
http://www.codeproject.com/Articles/4837/Introduction-to-RPC-Part-1
powershell 看起來挺酷的
找到下面幾個方法:
Command:
http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx
http://www.online-tech-tips.com/computer-tips/remote-shutdown-command/
RPC:
http://www.codeproject.com/Articles/4837/Introduction-to-RPC-Part-1
powershell 看起來挺酷的
帶領健康的小組 讀書心得
談起小組,能說是上帝為我們預備的一件奇妙安排,透過小組的聚會,我們能夠經驗聖經中所說的真理,透過彼此的分享及認罪,它能夠把聖經上說的愛及赦免告訴並教導我們,當生命中遇到許多的困難,例如失戀、失業,家庭中的不愉快等,它能夠陪伴我們走過這段艱難的時光,弟兄姊妹也一起經歷其中,透過彼此同心禱告,一次又一次的尋求神的同在,正如經上說:「無論在那裏,有兩三個人奉我的名聚會,那裏就有我在他們中間。」(馬太福音18:20)
記得小時候很喜歡養魚,剛開始的時候,總是把魚缸弄得漂漂亮亮的,放了多種魚類,也按時餵食飼料給魚兒們吃,但不出幾個禮拜的時間,魚缸居然開始發臭,魚兒也一隻又一隻的被撈起來,埋葬了。後來上網查了資料才明白,原來養魚並不是這麼簡單,其實還需要氧氣,及種些水草,好的燈光及恆溫系統是不可或缺的,更重要的是好的過濾系統。因此,我又再次把魚缸弄得漂漂亮亮的,且比前一次更高級了。而這次比前一次多「撐」了幾個禮拜,魚缸裡的魚兒們又再次去朝見上帝了。所以我又上網查了資料,也去翻了許多書本,才明白除了好的設備及飼料外,也要時常關心魚兒,不然當魚兒生病的時候,那個傳染力是非常強的,果然不出幾周,魚缸又報銷了。這次,我選擇先不養魚,先養水。先把居住的環境弄好,水流跟溫度控制也先弄清楚,還有魚兒的習性及會發生的傳染病有哪些,也都一一弄懂。等到一切安排好之後,先從兩三隻魚兒開始養,果真,這次作足了「功課」,魚兒們漸漸變大,也開始生出小魚,所以,小魚兒們又被分配到新的魚缸,否則大魚會把小魚吃掉,就這樣子,一缸又一缸的生長起來,因此在養魚界有句名言說:「養魚先養水」,就是這個道理。
原來養一缸好魚,需要如此多的經驗及知識,若拿來比喻成帶領小組,餵食飼料就好像按時供應小組員靈糧,但這樣子卻是不夠的,因為必須要先有一個安全的環境,才能讓小組員們敞開心,有安全感地在其中分享及代禱,並且一起經歷上帝,這是需要以恩典及時間作為安全的基礎,當然,最重要的是小組的運行要連結於元首基督,需要好的陽光,恆溫系統及過濾系統,以聖經的真理為基礎,使這個環境能自己行光合作用,控制溫度,將大自然的養分順其自然供應其中,透過組員們間的交流,一次又一次的將環境中不好的雜質過濾掉,小組員們才能安心及健康的在其中成長。小組的帶領者就如同牧養這缸魚的主人,無非是需要愛心及耐心,長時間的呵護,一一了解組員們的習性及小組處理會發生的狀況(如:窮乏、不積極、不順服等),這並不是一件短時間能完成的工作,也不是件容易的事。剛開始時,可從兩三個人開始,奉耶穌的名聚集,透過聚會,聚集同類型的人一起分享,透過共同的話題,彼此的互動也會更加頻繁,「聚會是為了散會而預備的」,倘若小組的運作及經營只是一周的兩到三個小時,那麼一定會出問題的,如同剛開始養魚的經驗一樣,魚兒不是生病就是奄奄一息,那付出的人力及時間就要更多了。
一個健康的生命,能夠影響更多的生命,永遠不會忘記,當大魚生出小魚的那種喜悅感,一個健康的小組也會生出更多健康的小組,這是上帝給我們的律,也是上帝給我們的愛與使命,「 神就賜福給他們、又對他們說、要生養眾多、遍滿地面、治理這地.也要管理海裏的魚、空中的鳥.和地上各樣行動的活物。」(創世紀1:28)。然而,罪是攔阻小組成長的一個關鍵,但當我們能以基督的心為心,用 神給我們的愛去包容身旁的弟兄姊妹,即使他們的過去不堪回首,慘不忍睹,但愛能遮掩一切的過錯,因者 神的恩典,更多感受到上帝的更新及大能。因為上帝掌管這個世界,也是小組裡的頭。盼望自己在未來也能夠成為一個健康的帶領者,透過小組,使每個組員們都能夠回轉到上帝的面前,過一個敬虔及得勝的基督徒生活。
JERSEY SU
20130628
20130628
[Original Link]
http://www.codeproject.com/Articles/593751/Code-Review-Checklist-and-Guidelines-for-Csharp-De
Code Review Checklist and Guidelines for C# Developers
Introduction
This is a General Code Review checklist and guidelines for C# Developers, which will be served as a reference point while development. This is to ensure that most of the General coding guidelines have been taken care of, while coding. Especially, it will be very helpful for entry-level and less experienced developers (0 to 3 years exp.) to refer this checklist until it becomes a habitual practice for them.
Checklist
- Make sure that there shouldn't be any project warnings.
- It will be much better if Code Analysis is performed on a project (with all Microsoft Rules enabled) and then remove the warnings.
- All unused
usings need to be removed. Code cleanup for unnecessary code is always a good practice.Refer: http://msdn.microsoft.com/en-us/magazine/ee335722.aspx. - 'null' check need to be performed wherever applicable to avoid the Null Reference Exception at runtime.
- Naming conventions to be followed always. Generally for variables/parameters follow Camel casing and for method names and class names follow Pascal casing.Refer: http://msdn.microsoft.com/en-us/library/ms229043.aspx.
- Make sure that you are aware of SOLID principles.Definition from Wikipedia: In computer programming, SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the "first five principles" identified by Robert C. Martin[1][2] in the early 2000s[3] that stands for five basic principles of object-oriented programming and design. The principles when applied together intend to make it more likely that a programmer will create a system that is easy to maintain and extend over time.[3] The principles of SOLID are guidelines that can be applied while working on software to remove code smells by causing the programmer to refactor the software's source code until it is both legible and extensible. It is typically used with test-driven development, and is part of an overall strategy of agile and adaptive programming.
Refer: http://en.wikipedia.org/wiki/SOLID_(object-oriented_design) - Code Reusability: Extract a method if same piece of code is being used more than once or you expect it to be used in future. Make some generic methods for repetitive task and put them in a related class so that other developers start using them once you intimate them. Develop user controls for common functionality so that they can be reused across the project.Refer: http://msdn.microsoft.com/en-us/library/office/aa140806(v=office.10).aspx
http://blogs.msdn.com/b/frice/archive/2004/06/11/153709.aspx - Code Consistency: Let's say that an
Int32type is coded asintandStringtype is coded asstringthen they should be coded in that same fashion across the application. But not like sometimesintand sometimes asInt32. - Code Readability: Should be maintained so that other developers understand your code easily.Refer: http://msdn.microsoft.com/en-IN/library/aa291591(v=vs.100).aspx
- Disposing of Unmanaged Resources like File I/O, Network resources, etc. They have to be disposed of once their usage is completed. Use
usings block for unmanaged code if you want to automatically handle the disposing of objects once they are out of scope.Refer: http://msdn.microsoft.com/en-us/library/498928w2.aspx - Proper implementation of Exception Handling (try/catch and finally blocks) and logging of exceptions.Refer: http://msdn.microsoft.com/en-us/library/vstudio/ms229005(v=vs.100).aspx
- Making sure that methods are having less number of lines of code. Not more than 30 to 40 lines.
- Timely check-in/check-out of files/pages at source control (like TFS).Refer: http://www.codeproject.com/Tips/593014/Steps-Check-in-Check-Out-Mechanism-for-TFS-To-avoi
- Peer code reviews. Swap your code files/pages with your colleagues to perform internal code reviews.
- Unit Testing. Write developer test cases and perform unit testing to make sure that basic level of testing is done before it goes to QA testing.Refer: http://msdn.microsoft.com/en-us/magazine/cc163665.aspx
- Avoid nested for/foreach loops and nested if conditions as much as possible.
- Use anonymous types if code is going to be used only once.Refer: http://msdn.microsoft.com/en-us/library/vstudio/bb397696.aspx
- Try using LINQ queries and Lambda expressions to improve Readability.Refer: http://msdn.microsoft.com/en-us/library/bb308959.aspx
- Proper usage of
var,object, anddynamickeywords. They have some similarities due to which most of the developers have confusions or don’t know much about them and hence they use them interchangeably, which shouldn't be the case.Refer: http://blogs.msdn.com/b/csharpfaq/archive/2010/01/25/what-is-the-difference-between-dynamic-and-object-keywords.aspx - Use access specifiers (private, public, protected, internal, protected internal) as per the scope need of a method, a class, or a variable. Let's say if a class is meant to be used only within the assembly then it is enough to mark the class as internal only.Refer: http://msdn.microsoft.com/en-us/library/kktasw36.aspx
- Use interfaces wherever needed to maintain decoupling. Some design patterns came into existence due to the usage of interfaces.Refer: http://msdn.microsoft.com/en-IN/library/3b5b8ezk(v=vs.100).aspx
- Mark a class as sealed or static or abstract as per its usage and your need.Refer: http://msdn.microsoft.com/en-us/library/ms173150(v=vs.100).aspx
- Use a
Stringbuilderinstead ofstringif multiple concatenations required, to save heap memory. - Check whether any unreachable code exists and modify the code if it exists.
- Write comments on top of all methods to describe their usage and expected input types and return type information.
- Use a tool like Silverlight Spy to check and manipulate rendered XAML in Runtime of a Silverlightapplication to improve productivity. This saves lot of back & forth time between Design & Run views of the XAML.
- Use fiddler tool to check the HTTP/network traffic and bandwidth information to trace the performance of web application and services.
- Use WCFTestClient.exe tool if you want to verify the service methods out of the visual studio or by attaching its process to visual studio for debugging purpose.
- Use constants and readonly wherever applicable.Refer:
- Avoid type casting and type conversions as much as possible; because it is a performance penalty.Refer: http://msdn.microsoft.com/en-us/library/ms173105.aspx
- Override
ToString(fromObjectclass) method for the types which you want to provide with custom information.Refer: http://msdn.microsoft.com/en-us/library/ms173154(v=vs.100).aspx - Avoid straightaway copy/pasting of code from other sources. It is always recommended to hand written the code even though if you are referring the code from some sources. By this you will get good practice of writing yourself the code and also you will understand the proper usage of that code; finally you never forget it.
- Always make it a practice to read books/articles, upgrade and follow the Best Practices and Guidelines by industry experts like Microsoft experts and well-known authors like Martin Fowler, Kent Beck, Jeffrey Ritcher, Ward Cunningham, Scott Hanselman, Scott Guthrie, Donald E Knuth.
- Verify whether your code have any memory leakages. If yes, make sure that have been fixed.Refer: http://blogs.msdn.com/b/davidklinems/archive/2005/11/16/493580.aspx
- Try attending technical seminars by experts to be in touch with the latest software trends and technologies and best practices.
- Understand thoroughly the OOPs concepts and try implementing it in your code.
- Get to know about your project design and architecture to better understand the flow of your application as a whole.
- Take necessary steps to block and avoid any cross scripting attacks, SQL injection, and other security holes.
- Always encrypt (by using good encryption algorithms) secret/sensitive information like passwords while saving to database and connection strings stored in web.config file(s) to avoid manipulation by unauthorized users.
- Avoid using
defaultkeyword for the known types (primitive types) likeint,decimal,bool, etc. Most of the times it should be used in case of Generic types (T) as we may not be sure whether the type is a value type or reference type.Refer: http://msdn.microsoft.com/en-us/library/xwth0h0d(v=vs.100).aspx
Another article reference on review guidelines
Today, I came across another article related to Code review guidelines on Code project and I find it very interesting. The author has given a perfect explanation about what is code review and what needs to be taken care of being a Developer or being a Reviewer, the importance of code reviews, tips for developers and reviewers, and review checklist. I recommend my article readers to go through it once.
Conclusion
I welcome feedbacks, queries, and suggestions from the readers so that I can improve it further and developers should get some benefit out of it. My aim is to gradually make it a complete Code review guidelines especially for C# developers and in next version I'm planning to add supporting code examples and screenshots for much better understanding purpose.
Disclaimer: This document does not guarantee that all the mentioned guidelines and practices are applicable as of today. Therefore it is always recommended to check yourself MSDN, discuss with experts and check other portals for the current and modified guidelines and practices. Also, note that some of the provided reference links might not work.
這個蠻威的 先存檔再來看
Interesting topic
https://medium.com/tech-talk/d5f8051afce2
https://medium.com/tech-talk/d5f8051afce2
