Posts

Trick and Tips when bash script dealing date

This is some tricks and tips I found when I searching around google. Getting Yesterdays or Tomorrows day with shell date command. When invoked without arguments, the date command displays the current date and time. Depending on the options specified, date will set the date and time or print it in a user defined way. I’ve seen many people writing a perl script for calculating yesterday or tomorrow. Computer loves numbers but we love relative terms like 2 days ago. Luckily GNU date command is designed to handle relative date calculation. Why use relative date formats? * Ease of use * To write your own scripts * Automate task using cron (example run a job on last day of the month or Nth day of the month or 3rd Friday and so on) First, print today's date: $ date Sun Jun 17 12:17:24 CDT 2007 Now display Yesterday's date: $ date --date="1 days ago" OR try: $ date --date="yesterday" Sat Jun 16 12:17:20 CDT 2007 Now display Tomorrow's date: $ date --...

Repair Openldap database

If you come across this problem like me , this might be able to help you. When ever I restart the openldap daemon at my CentOS server , I received this error : Checking configuration files for slapd: bdb_db_open: unclean shutdown detected; attempting recovery. bdb_db_open: Recovery skipped in read-only mode. Run manual recovery if errors are encountered. If you issue command slapcat , you might be able to start the openldap without any error. But after you stop the openldap daemon , you start the openldap daemon again , you will receive the same error again. Then you might think of this command : slapd_db_recover . If you use this command , you might face the same scenario. How I solve the issue about this openldap error is issue the following command in sequence . slapcat slapd_db_recover -h /var/lib/ldap Then try to start your openldap daemon again , you might find it working. ---

vmware server 2.0.2 and fedora 13

I am trying to install Vmware server 2.0.2 build-203138 into my Fedora 13 with kernel 2.6.33.6-147. Luckily I manage to found this page , otherwise I wouldn't know how to solve all the problem that I am facing while trying to install the Vmware server into the fedora. The detail is in this page. This article describes the process we went through recently to get VMWare Server 2.0.2 to run on the latest kernel in Fedora 13. http://www.bhcblog.com/2010/06/28/howto-vmware-2-0-2-on-2-6-33-5-124-fc13-x86_64-fedora-13/ When you are editing the vmware-config.pl file , make sure there is no dot in front of the word generated for the first line. ---

Reverse Proxy with squid and multiple virtual host

This post is to document down the detail that I did to configure a squid as reverse proxy and also enable LDAP authentication . Not only that , I need the squid reverse proxy able to handle virtual host as well. I did a search at google and didn't find any exact match for my requirement so I did one for my self. I have 3 physical web server but I only have one public ip. Here is my requirement. 1. All three web server have to listen at port 80 and must be able to access from internet. 2. Some web site need authentication and some web site don't need authentication. 3. One of the web server has two virtual host and these two virtual host must be accessible from internet. After combine knowledge from multiple page , these are the lines that I added into the squid.conf . auth_param basic program /usr/lib64/squid/squid_ldap_auth -b "dc=example,dc=com" -f "uid=%s" -h ldap.example.com auth_param basic children 30 auth_param basic realm Please authenticate yourself...

vtiger crm uitype

Official uitype , you can find it here: http://wiki.vtiger.com/index.php/Ui_types But if you are newbie like me , you might need more description about the UI type, then may be you can have a look at this: http://vtigersql.com/weblog.php?w=36 I am looking for text area UI. (* notate required version of uitype) Number 19,20* = Text Area (70x8) Spans 70 chars wide (i.e. across both columns) Number 21,24* = Text Area (30x2) (single column) ---

Microsoft excel macro to compare two column for each row and highlight cell with condition

This Macro was tested with Microsoft Excel 2007. Sub compare() ' Select first line of data. Range("B2").Select ' Set Do loop to stop at empty cell. Do Until IsEmpty(ActiveCell) ' Check active cell for search value. If ActiveCell.Value = Cells(ActiveCell.Row, ActiveCell.Column - 1).Value Then ActiveCell.Interior.ColorIndex = 3 ElseIf ActiveCell.Value > Cells(ActiveCell.Row, ActiveCell.Column - 1).Value Then ActiveCell.Interior.ColorIndex = 4 ElseIf ActiveCell.Value ActiveCell.Interior.ColorIndex = 5 Else ActiveCell.Interior.ColorIndex = 6 End If ' Step down 1 row from present location. ActiveCell.Offset(1, 0).Select Loop End Sub Every time you change a value in the cell , you have to run the macro manually. In order to run it automatically, put the script into the Worksheet_Change function. (This code was not tested , j...

Looking for live chat icon

If you are looking for live chat icon or operator pictures or even Header images for your live chat pop up windows, you can come to this URL : http://www.providesupport.com/product/chat-icons-en.html Here got some nice live chat icon , operator pictures and Header images, it might suite your help. ---