comparison operator between in mysql

mysql between

comparison operator between in mysql General Syntax – mostly used SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2; expr BETWEEN min AND max If expr is greater than or equal to min and expr is less than or equal to max, BETWEEN returns 1, otherwise it returns 0. This is equivalent to the expression (min <= expr AND expr <= … Read more

get the difference between two timestamps in seconds

MySQL Cluster

get the difference between two timestamps in seconds   You could use the TIMEDIFF() and the TIME_TO_SEC() functions as follows: SELECT TIME_TO_SEC(TIMEDIFF(‘2010-08-20 12:01:00’, ‘2010-08-20 12:00:00’)) diff; +——+ | diff | +——+ | 60 | +——+ 1 row in set (0.00 sec) You could also use the UNIX_TIMESTAMP() function. SELECT UNIX_TIMESTAMP(‘2010-08-20 12:01:00’) – UNIX_TIMESTAMP(‘2010-08-20 12:00:00’) diff; +——+ | diff | +——+ | … Read more

Convert decimal seconds time in Excel h:mm:ss format

convert decimal seconds to excel time

Convert decimal seconds time in Excel h:mm:ss format Generic formula =seconds/86400 Explanation To convert seconds in decimal format to a proper Excel time, divide by 86400. In the example shown, the formula in C6 is: =B6/86400 To display the result as time, apply a time format. Column D shows the same result formatted with [h]:mm. … Read more

How to identify server IP address in PHP

php how to example

How to identify server IP address in PHP   or the server ip: $_SERVER[‘SERVER_ADDR’]; and this for the port $_SERVER[‘SERVER_PORT’]; You can use this in CRUL as below: <?php // create a new cURL resource $ch = curl_init (); // set URL and other appropriate options curl_setopt ($ch, CURLOPT_URL, “http://blog.eduguru.in/test”); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt … Read more

Vi – Linux file editor

vi-editor

Vi – Linux file editor If you find that vi is hard to use, there is some good news: RHEL uses a user-friendly version of vi called vim, for “vi improved.” To start vim, just use the vi command. In this section, I will provide you with the bare essentials that are needed to work … Read more

IPTABLES : Introduction to Linux Firewall

firewall

IPTABLES : Introduction to Linux Firewall   Linux is the most-used open source operating system. Managing network traffic is one of the toughest jobs to deal with.  For this, we must configure the firewall in such a way that it meets the system and users requirements without leaving the system vulnerable. The default firewall in most of the Linux distributions is IPTables. IPTables is … Read more

Goto Keyword in c Program

c prgram avoid goto

Goto Keyword in c Program In a difficult programming situation it seems so easy to use a goto to take the control where you want. However, almost always, there is a more elegant way of writing the same program using if, for, while and switch. These constructs are far more logical and easy to understand. … Read more

SIP.conf – General option in SIP.conf

sip configuration asterisk

SIP.conf – General option in SIP.conf SIP Configuration – general The [general] section of sip.conf includes the following variables: allowsubscribe = yes|no : Allow or Ignore Subscribe requests allow = <codec> : Allow codecs in order of preference (Use DISALLOW=ALL first, before allowing other codecs) disallow = all : Disallow all codecs (global configuration) allowexternaldomains = yes|no : Enable/Disable … Read more

download asterisk 13 dahdi and libpri

install asterisk 13

download asterisk 13 dahdi and libpri Asterisk is an open source framework for building communications applications. Asterisk turns an ordinary computer into a communications server. Asterisk powers IP PBX systems, VoIP gateways, conference servers and other custom solutions. It is used by small businesses, large businesses, call centers, carriers and government agencies, worldwide. Asterisk is … Read more