Google search from Linux and UNIX command line
Today I started thinking that how cool is do some Google searches straight from command line. First I try to find some ready tricks from the Internet, but I couldn’t find quickly anything good. So I decide do a simple Bash function that can take Google search as parameter and open Firefox Browser (tab) with Google search. Sounds easy… :)
First we need Google search URL without search parameter and it looks like this:
Add date and time to Linux terminal title (Gnome Terminal, xterm, urxvt, rxvt)
Here is easy way add date and time to Linux terminal title. This trick works at least following terminals Gnome Terminal, xterm, urxvt, rxvt.
Simply type the following command line:
while sleep 1 ; do echo -ne '\033]2;'`date`'\007'; done &
Fedora 12 Constantine is released
Fedora team promises to bring to you the latest and greatest release of Fedora ever, Fedora 12! Many things are really changed and improved. Fedora 12 also brings lots of new packages.
Here is some highlights from Fedora 12 new stuff Optimized performance – 32-bit architecture software packages have been compiled with special optimization for the Intel Atom processors without losing compatibility with the overwhelming majority of CPUs. Smaller and faster updates – Fedora 12 uses yum-presto plugin as default. So update manager download only changes for packages. Improvements for graphics support – Introduces experimental 3D support for AMD Radeon HD 2400 and later graphics cards. To try it out, install the mesa-dri-drivers-experimental package. Better support for systems with multiple monitors. Bluetooth on-demand – Bluetooth services are automatically started when needed and stopped 30 seconds after last device use, reducing initial startup time and resource use when Bluetooth is not in active use. Better webcam support – Fedora 12 you can expect even better video quality, especially for less expensive webcams. Next-generation (Ogg) Theora video – Theora videos now deliver much better quality primarily via enhancements in the encoder without any change in the format Automatic reporting of crashes and SELinux issues – Abrt, a tool to help non-power users report crashes to Bugzilla with a few mouse clicks, is now enabled by default. And some higlights of new programs and packages on Fedora 12 Gnome 2.28 – Latest Gnome desktop release KDE 4.3 – Latest KDE desktop release Abrt – Tool for easy bug reporting Empathy – Default IM client Fedora Studio – Classify multimedia applications into subgroups for easy access NetBeans 6.7 – Latest NetBeans IDE Eclipse Galileo – Latest Eclipse Galileo Perl 6 PHP 5.3 Open Shared Root – Provides abilities to boot multiple linux systems with the same root filesystem GFS2 Clustered Samba – Support for clustered samba (including active/active configuration) over GFS2 using CTDB Here is Fedora 12 full release notes.
Howto upgrade Fedora 11 to Fedora 12 with Preupgrade
I think the most easiest way to upgrade Fedora 11 to Fedora 12 is program called preupgrade, which download needed packages from the server and then just reboot to installer and after install boot the new system. Of course it’s important backup your important files before upgrading.
Commands and screenshots of whole upgrading process First start with updating all Fedora 11 packages with following command as root yum update Install preupgrade as root yum install preupgrade Start preupgrade as root preupgrade Preupgrade information window
Hide Apache ServerSignature / ServerTokens / PHP X-Powered-By
By default almost all Apache installation shows sensitive server information with Apache version number, server operating system details, installed Apache modules, PHP-version and so on. Attackers can use this information when performing attacks.
Some examples howto check server information that Apache sends Error page Use lynx $ lynx -head -mime_header http://www.ubuntu.com HTTP/1.0 200 OK Date: Fri, 20 Nov 2009 09:25:46 GMT Server: Apache/2.2.8 (Ubuntu) mod_python/3.3.1 Python/2.5.2 PHP/5.2.4-2ubuntu5.7 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g X-Powered-By: PHP/5.2.4-2ubuntu5.7 Content-Type: text/html; charset=utf-8 Age: 13 Content-Length: 0 X-Cache: HIT from avocado.canonical.com X-Cache-Lookup: HIT from avocado.canonical.com:80 Via: 1.0 avocado.canonical.com:80 (squid/2.6.STABLE18) Connection: close $ Use Mozilla Firebug plugin
Fedora 13 nVidia Drivers Install Guide (disable the nouveau driver)
Looking Fedora 22/21 nVidia Drivers Install Guide?
I’ve tried this method in few Fedora 12 and Fedora 13 machine, and looks like it is working. Nouveau has been enabled by default starting from Fedora 11 and looks like nouveau cause some problems on Fedora 12 and Fedora 13, when try to use nVidia proprietary driver.
Note: nVidia proprietary drivers on Fedora 12 and Fedora 13 does not support older cards than GeForce 6 cards (except for some exceptions, check this comment).
Partitioning PostgreSQL Tables - Handle Millions of Rows Efficiently
PostgreSQL table partitioning means splitting one large database table into smaller logical pieces. PostgreSQL table partitioning will be worthwhile only when a table would be very large.
Here are a few benefits of what can be achieved with partitioning:
Large tables query performance can be improved dramatically Reducing index size and making it more likely that the heavily-used parts of the indexes fit in memory Rarely used data can be moved to slower and cheaper storage media This topic is divided into three parts, which are as follows and published in the following order: Part 1. Howto create PostgreSQL table partitioning
Create PostgreSQL Table Partitioning (Part 1)
PostgreSQL supports partitioning via table inheritance. So the partitioning is made in such a way that every child table inherits single parent table. Parent table is empty and it exists just to describe the whole data set.
PostgreSQL partitioning can be implemented in range partitioning or list partitioning.
Range partitioning can be done for example by ID ranges (like 0-100 000, 100 001-200 000, 200 001-300 000…) or Date ranges (like 2009-11-01 – 2009-11-30, 2009-12-01 – 2009-12-31…). List partitioning can be done for example by list of cities (like New York, Los Angeles, Chicago, Houston, Philadelphia…) or list of categories (like Programming, Home, Food…). It’s important to ensure that there is no overlap between the key values permitted in different partitions.
PHP Script to Generate PostgreSQL Table Partitioning (Part 2)
As Part 1 (Howto create PostgreSQL table partitioning) shows, making of PostgreSQL partitioning needs a lot of SQL commands. So this Part 2 explains how SQL commands for PostgreSQL partitioning can be made with a simple PHP script. This example script make SQL for child tables, indexes, trigger function and parent table trigger. This example script can make PostgreSQL table partitioning with using Date ranges. Script can be configured with following configuration section:
PHP: Loop through dates (from date to date) with strtotime() function
This is very easy way loop through dates (from date to date) with PHP strtotime() function. This example only echo dates, but of course this model can be used more complicated situations.
<?php // Set timezone date_default_timezone_set('UTC'); // Start date $date = '2009-12-06'; // End date $end_date = '2020-12-31'; while (strtotime($date) <= strtotime($end_date)) { echo "$date\n"; $date = date ("Y-m-d", strtotime("+1 day", strtotime($date))); } Note: All different PHP strtotime() function syntaxes can be used.
PostgreSQL: Partitioned Table vs Non Partitioned Table (Part 3)
This article compares the speed and performance of queries between partitioned and non partitioned PostgreSQL tables. However, it is important to remember that the PostgreSQL tables partitioning has also another benefits, than the better performance on queries. More information about other benefits from the first part ‘Howto create PostgreSQL table partitioning (Part 1)‘.
This is comparision between partitioned and non partitioned PostgreSQL tables. The same tests were carried out with and without indices, because using the indices, it is no longer very meaningful example on table, which has one billion rows of data (if the table is not partitioned). This comparison is used an example of an existing table, which looks like this:
Format bytes with PHP – B, KB, MB, GB, TB, PB, EB, ZB, YB converter
Simple PHP function that formats the bytes to the desired form. Possible unit options are:
Byte (B) Kilobyte (KB) Megabyte (MB) Gigabyte (GB) Terabyte (TB) Petabyte (PB) Exabyte (EB) Zettabyte (ZB) Yottabyte (YB) PHP byteFormat function for formatting bytes Function takes three parameter: (bytes mandatory, unit optional, decimals optional)
<?php function byteFormat($bytes, $unit = "", $decimals = 2) { $units = array('B' => 0, 'KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4, 'PB' => 5, 'EB' => 6, 'ZB' => 7, 'YB' => 8); $value = 0; if ($bytes > 0) { // Generate automatic prefix by bytes // If wrong prefix given if (!array_key_exists($unit, $units)) { $pow = floor(log($bytes)/log(1024)); $unit = array_search($pow, $units); } // Calculate byte value by prefix $value = ($bytes/pow(1024,floor($units[$unit]))); } // If decimals is not numeric or decimals is less than 0 // then set default value if (!is_numeric($decimals) || $decimals < 0) { $decimals = 2; } // Format output return sprintf('%.' . $decimals . 'f '.$unit, $value); } Example usage echo byteFormat(4096, "B"); echo byteFormat(8, "B", 2); echo byteFormat(1, "KB", 5); echo byteFormat(1073741824, "B", 0); echo byteFormat(1073741824, "KB", 0); echo byteFormat(1073741824, "MB"); echo byteFormat(1073741824); echo byteFormat(1073741824, "TB", 10); echo byteFormat(1099511627776, "PB", 6); Output
Delete files permanently with shred command in Linux – Remove absolutely
Sometimes we need to delete files which content should disappear absolutely, completely and safely. Linux command rm just remove file and it’s still possible to dig out from the disk. Fortunately for Linux can be found in shred program that removes the files permanently. Shred command is easy and quickly to use cases when files need to deleted forever.
Shred command usage Create test file: echo "testing testing" > /tmp/test.txt Delete file with shred command: shred -v -n 25 -u -z /tmp/test.txt Output:
Twitter Hacked by Iranian Cyber Army
Twitter site is hacked by Iranian Cyber Army. Here is some screenshots and full info about page.
Screenshots Server info and full html content lynx -mime_header http://twitter.com HTTP/1.1 200 OK Date: Fri, 18 Dec 2009 06:42:08 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635 Last-Modified: Fri, 18 Dec 2009 06:21:13 GMT ETag: "90c06a-717-47afabf13c840" Accept-Ranges: bytes Content-Length: 1815 Connection: close Content-Type: text/html <meta content="en-us" http-equiv="Content-Language"></meta> <meta content="text/html; charset=windows-1252" http-equiv="Content-Type"></meta> <title>..:: This Web Site Has Been Hacked By Iranian Cyber Army ::.. </title> <p align="center"> </p> <p align="center"><img border="0" src="index.6.gif"></img><img border="0" src="index.2.gif"></img><img border="0" src="index.7.gif"></img></p> <p align="center"><img border="0" src="index.8.gif"></img></p> <p align="center"> <a href="mailto:[email protected]?subject=Mowjcamp"> <img border="0" src="index.5.gif"></img></a></p> <p align="center"><img border="0" height="106%" loading="lazy" src="index.3.jpg" width="43%"></img></p> <p align="center"><font face="Tahoma" size="2"><b> </b></font></p> <p align="center"><b><font color="#FFFFFF" face="Tahoma" size="2"> بنام خدا<br></br> به عنوان یک ایرانی در پاسخ به دخالت های شیطنت آمیز این سرویس دهنده به دستور مقامات آمریکایی در امور داخلی کشورم ) <br></br> این سایت به عنوان هشدار هک می شود <br></br> </font></b></p>
Twitter hacked? Not really, only Twitter DNS records compromised
I before post ‘Twitter Hacked by Iranian Cyber Army’, but actually just Twitter DNS records was hacked. I think even twitter.com server headers and tracepath to servers simply prove this, because they are completely different normally when hacked.
Hacked twitter.com headers: HTTP/1.1 200 OK Date: Fri, 18 Dec 2009 06:42:08 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635 Last-Modified: Fri, 18 Dec 2009 06:21:13 GMT ETag: "90c06a-717-47afabf13c840" Accept-Ranges: bytes Content-Length: 1815 Connection: close Content-Type: text/html Original twitter.com headers: HTTP/1.1 200 OK Date: Fri, 18 Dec 2009 08:25:54 GMT Server: hi X-Transaction: 1261124754-68110-699 Status: 200 OK ETag: "592480ad9f6feea20711b47bc5e64dbb" Last-Modified: Fri, 18 Dec 2009 08:25:54 GMT X-Runtime: 0.02009 Content-Type: text/html; charset=utf-8 Pragma: no-cache Content-Length: 20957 Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0 Expires: Tue, 31 Mar 1981 05:00:00 GMT X-Revision: DEV Set-Cookie: auth_token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: param_q=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: param_page=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: param_status=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: param_in_reply_to_status_id=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: param_in_reply_to=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: param_source=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: param_user=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: param_id=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: dispatch_action=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: _twitter_sess=BAh7CToRdHJhbnNfcHJvbXB0MDoMY3NyZl9pZCIlNzVhYTY3YTZlNjMxNTky%250AMjk5NzkzNGZiMTIxNDg0ZWQ6B2lkIiVkOGE0MzJkYTFjZWQzNGUzMWM1ZThk%250AMThlMTUwN2VlOCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%250AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%253D%253D--379506ebd11ed1403680db265ae97bf4c3768b7b; domain=.twitter.com; path=/ Vary: Accept-Encoding Connection: close Hacked twitter.com tracepath tracepath http://www.twitter.com ... 7: lax009-phx007-832-cr1.phx007.internap.net (66.79.147.182) 40.415ms asymm 8 8: cr2-cr1.phx007.internap.net (66.79.147.174) 46.740ms asymm 9 9: dal005-phx007-833-cr1.dal005.internap.net (66.79.147.177) 54.298ms asymm 7 10: dal005-tor003-1160-cr1.tor003.pnap.internap.net (66.79.147.230) 86.102ms asymm 7 11: tor001-tor003-769-core1.tor001.internap.net (66.79.153.34) 98.458ms asymm 9 12: border1.te9-1-bbnet2.tor001.pnap.net (70.42.24.196) 94.665ms asymm 9 13: netfirms-1.border1.tor001.pnap.net (70.42.26.54) 104.351ms asymm 10 Working twitter.com tracepath tracepath twitter.com ... 7: ae-2.r22.londen03.uk.bb.gin.ntt.net (129.250.2.77) 33.762ms asymm 12 8: as-0.r20.nycmny01.us.bb.gin.ntt.net (129.250.3.254) 105.484ms asymm 12 9: ae-0.r21.nycmny01.us.bb.gin.ntt.net (129.250.2.26) 105.688ms asymm 12 10: as-0.r20.chcgil09.us.bb.gin.ntt.net (129.250.6.13) 124.634ms asymm 12 11: ae-0.r21.chcgil09.us.bb.gin.ntt.net (129.250.3.98) 122.439ms asymm 12 12: as-5.r20.snjsca04.us.bb.gin.ntt.net (129.250.3.77) 185.225ms 13: xe-1-1-0.r20.mlpsca01.us.bb.gin.ntt.net (129.250.5.61) 186.349ms asymm 14 14: mg-1.c20.mlpsca01.us.da.verio.net (129.250.28.81) 189.346ms 15: 128.241.122.101 (128.241.122.101) 189.184ms 16: 128.241.122.101 (128.241.122.101) 189.468ms !H
Delete files securely on Linux – Journaled file systems
Few days ago I write about shred, which work fine for old systems, like EXT2, but not so nice with journaled file systems. Modern file systems need something more robust, like dd and srm (a secure replacement for rm). Unlike the standard rm, srm overwrites and rename the files before unlinking them. This makes it very hard to recovery of the data.
Create test file: echo "secure content" > /tmp/secure.txt dd and srm command usage Fill free space with zeroes (Use very carefully): dd if=/dev/zero of=/tmp/secure.txt Write buffered data from the memory out to disk sync Delete file with srm: # Basic example srm /tmp/secure.txt # US Dod compliant 7-pass overwrite. srm -D /tmp/secure.txt # US DoE compliant 3-pass overwrite. # Twice with a random pattern, finally with the bytes "DoE". # See http://cio.energy.gov/CS-11_Clearing_and_Media_Sanitization_Guidance.pdf for details. srm -E /tmp/secure.txt # OpenBSD compatible rm. Files are overwritten three times, first with the byte pattern # 0xff, then 0x00, and then 0xff again, before they are deleted. # Files with multiple links will be unlinked but not overwritten. srm -P /tmp/secure.txt Delete directory: srm -r /tmp/secure-directory Write buffered data from the memory out to disk sync Conclusion of commands # Create echo "secure content" > /tmp/secure.txt # Remove dd if=/dev/zero of=/tmp/secure.txt sync srm -D /tmp/secure.txt sync More info about options with commands:
BitLy (bit.ly) PHP Class – Shorten and Expand URLs (and Hashes) with BitLy API
BitLy (bit.ly) is a service which allows users to shorten, expand, share and track URLs (links). bit.ly can be accessed through bit.ly website and a robust and open API.
Example:
Shorten http://www.if-not-true-then-false.com/ url -> http://bit.ly/8cZ1fb
Expand http://bit.ly/8cZ1fb url -> http://www.if-not-true-then-false.com/
This post deals with bit.ly API usage with a simple PHP Class. This PHP class allows to shorten normal urls, expand bit.ly urls and expand bit.ly hashes.
BitLy PHP Class <?php class BitLy { private $break; private $api_version; private $format; private $login; private $apikey; // Constructor for BitLy class public function __construct($login, $apikey) { // Browser output then use "<br></br>" // Command line output use "\n" $this->break = "\n"; $this->api_version = "2.0.1"; $this->format = "json"; $this->login = $login; $this->apikey = $apikey; } // Shorten given url and returns shortened url public function shortenUrl($url) { $shortened_url = ""; $encoded_url = urlencode($url); $bitly_url = "http://api.bit.ly/shorten?" . "version=" . $this->api_version . "&format=" . $this->format . "&longUrl=" . $encoded_url . "&login=" . $this->login . "&apiKey=" . $this->apikey; $content = file_get_contents($bitly_url); try { $shortened_url = $this->parseContent($content, $url); } catch (Exception $e) { echo "Caught exception: " . $e->getMessage() . $this->break; exit; } return $shortened_url; } // Expand given url and returns expanded url public function expandUrlByUrl($url) { $expanded_url = ""; $hash = $this->parseBitlyUrl($url); $expanded_url = $this->expandUrlByHash($hash); return $expanded_url; } // Expand given hash and returns expanded url public function expandUrlByHash($hash) { $expanded_url = ""; $bitly_url = "http://api.bit.ly/expand?" . "version=" . $this->api_version . "&format=" . $this->format . "&hash=" . $hash . "&login=" . $this->login . "&apiKey=" . $this->apikey; $content = file_get_contents($bitly_url); try { $expanded_url = $this->parseContent($content, $hash); } catch (Exception $e) { echo "Caught exception: " . $e->getMessage() . $this->break; exit; } return $expanded_url; } // Parse Bitly url returns bitly hash private function parseBitlyUrl($url) { $parsed_url = parse_url($url); return trim($parsed_url['path'], "/"); } // Parse Content from Bitly API private function parseContent($content, $key) { // Decode json to array $content = json_decode($content, true); // Check errors if ($content['errorCode'] != 0 || $content['statusCode'] != "OK") { throw new Exception($content['statusCode'] . ": " . $content['errorCode'] . " " . $content['errorMessage']); } // Return right url or throw exception if not set if (isset($content['results'][$key]['longUrl'])) { return $content['results'][$key]['longUrl']; } else if (isset($content['results'][$key]['shortUrl'])) { return $content['results'][$key]['shortUrl']; } else { throw new Exception("ERROR. URL not found: " . $key); } } } BitLy PHP Class usage <?php require_once("BitLy.php"); $bitly = new BitLy("bitlyapidemo", "R_0da49e0a9118ff35f52f629d2d71bf07"); $url = "http://www.if-not-true-then-false.com/"; $short_url = $bitly->shortenUrl($url); echo "Shorten " . $url . " url -> " . $short_url . "\n"; echo "Expand " . $short_url . " url -> " . $bitly->expandUrlByUrl($short_url) . "\n"; echo "Expand 8cZ1fb hash -> " . $bitly->expandUrlByHash("8cZ1fb") . "\n"; Output $ php test_bitly_class.php Shorten http://www.if-not-true-then-false.com/ url -> http://bit.ly/8cZ1fb Expand http://bit.ly/8cZ1fb url -> http://www.if-not-true-then-false.com/ Expand 8cZ1fb hash -> http://www.if-not-true-then-false.com/
nginx, PHP 5.3 and FastCGI on CentOS 5.5, Fedora 13, Red Hat RHEL 5.5/6
This is guide howto install nginx, PHP 5.3 and FastCGI webserver with MySQL and/or PostgreSQL and Memcache support on Fedora 12 and Fedora 13, CentOS 5.5, Red Hat (RHEL) 5.5/6.
nginx (engine x) is a robust, small and high performance http server, reverse proxy server and also mail proxy server.
1. Add and enable needed repositories: Updated 19.3.2010 Use following repositories to install nginx 0.8.xx version (currently 0.8.36 version)
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm rpm -Uvh http://yum.chrislea.com/centos/5/i386/chl-release-5-3.noarch.rpm rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CHL Just Epel repository is now obsolete, since there can be found only nginx 0.6.xx branch (currenlty version 0.6.39) Check this comment for more info.
PHP stdClass to Array and Array to stdClass – stdClass Object
I think every PHP coders have come accross Arrays and stdClass Objects (belongs to PHP Predefined Classes). Sometimes it’s very useful convert Objects to Arrays and Arrays to Objects. This is easy if arrays and objects are one-dimensional, but might be little tricky if using multidimensional arrays and objects.
This post defines two ultra simple recursive function to convert multidimensional Objects to Arrays and multidimensional Arrays to Objects.
Function to Convert stdClass Objects to Multidimensional Arrays <?php function objectToArray($d) { if (is_object($d)) { // Gets the properties of the given object // with get_object_vars function $d = get_object_vars($d); } if (is_array($d)) { /* * Return array converted to object * Using __FUNCTION__ (Magic constant) * for recursive call */ return array_map(__FUNCTION__, $d); } else { // Return array return $d; } } Function to Convert Multidimensional Arrays to stdClass Objects <?php function arrayToObject($d) { if (is_array($d)) { /* * Return array converted to object * Using __FUNCTION__ (Magic constant) * for recursive call */ return (object) array_map(__FUNCTION__, $d); } else { // Return object return $d; } } Function usage // Create new stdClass Object $init = new stdClass; // Add some test data $init->foo = "Test data"; $init->bar = new stdClass; $init->bar->baaz = "Testing"; $init->bar->fooz = new stdClass; $init->bar->fooz->baz = "Testing again"; $init->foox = "Just test"; // Convert array to object and then object back to array $array = objectToArray($init); $object = arrayToObject($array); // Print objects and array print_r($init); echo "\n"; print_r($array); echo "\n"; print_r($object); Test output:
PHP - Measure Scripts Execution Time and Page Generation Time
In many cases, it is really useful to know the exact time for how long a PHP script is running or how long will take PHP web page load. On the other hand it is also useful to know that how long a particular script operation or part of page load will take.
Following PHP Timing class is very simple to use, only create class and start timing and stop timing. Elapsed time function can be used also (elapsed time is calculated from script start time). Statistics can be displayed in print-functions and the same information without any formatting can also get with get-functions.