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...

SVN Remove Added File From Repository and Keep Local File – Subversion

This is quick SVN (Subversion) tip, howto remove added file from SVN repository without deleting file from local filesystem. [inttf_post_ad1] Remove File From SVN Repository and Keep Local File svn delete --keep-local path/to/file.example Real example: svn delete --keep-local css/test.css [inttf_post_ad2] Real world usage example Adding a whole directory add a file that was not intended to SVN reads, but should be retained locally. svn add css/ A ...

SVN (Subversion) Backup and Restore

This is quick guide, howto Backup (dump) and Restore (load) SVN (Subversion) repository on Linux. This is actually very simple and important task. SVN backup and restore is useful when you want to move your repos to new server or you need to recover your data. I assume here that you have Subversion (SVN) installed and you have existing repositories. If you installed and created testrepo with earlier guide then you can check real examples. [inttf_post_ad1] 1. Backup (dump) SVN...

Solarized Linux

I like very much Ethan Schoonover Solarized color palette. So I decided write a guide, howto get Solarized colors to most commonly used Linux terminals (Gnome-Terminal, Konsole, XFCE Terminal, Mate-Terminal), Text editors (Gedit, Vim) and IDEs (Eclipse, NetBeans). These are not my projects, so the greatest honor belongs, of course, these projects owners and Ethan Schoonover. 1. Install Needed Tools (git, mercurial, 7-zip) 2. Create and Change to Solarized Directory 3. Solarized...

PHP: APC Configuration and Usage Tips and Tricks

PHP APC (Alternative PHP Cache / Opcode Cache) is framework that optimizes PHP intermediate code and caches data and compiled code from the PHP bytecode compiler in shared memory. APC Opcode Cache is quickly becoming the de-facto standard PHP caching mechanism. [inttf_post_ad1] PHP APC installation is very easy, example with Fedora / CentOS / Red Hat (RHEL) you can check following guides to see howto install it: Install Nginx/PHP-FPM on Fedora/CentOS/Red Hat (RHEL) Install...

PHP / PDO / SQLite3 Example

This is a PHP, PDO and SQLite3 example, which demonstrates the SQLite3 databse usage with PHP-PDO. The PHP / PDO / SQLite3 example code demonstrates following things, and their use: Create / Connect SQLite3 databases Use SQLite3 file and memory databases Create tables in SQLite3 database Use SQLite3 db different datetime formats Insert data to SQLite3 database PDO / SQLite3 prepared statements Bind parameters to statement variables Bind values to statement variables Quote a...

PHP Memory Usage Information Class

Sometimes it's nice to know or even very important to know, how much your PHP script is using memory. This is a simple example of a class, which can be used to collect the PHP script memory usage information and to print all information. It's easy to reformat output, if you want to use it example on web page or command line script. Or even do another function for web pages and another for command line scripts. [inttf_post_ad1] Memory Usage Information PHP Class <?php ...

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. [inttf_post_ad1] <?php // Set timezone date_default_timezone_set('UTC'); // Start date $date = '2009-12-06'; // End date $end_date = '2020-12-31'; while (strtotime($date) [inttf_post_ad2] Note: All different PHP strtotime() function syntaxes can be...

PHP CLI Colors – PHP Class Command Line Colors (bash)

PHP Command Line Interface (CLI) has not built-in coloring for script output, like example Perl language has (perldoc.perl.org/Term/ANSIColor.html). So I decided to make own class for adding colors on PHP CLI output. This class works only Bash shells. This class is easy to use. Just create new instance of class and call getColoredString function with string and foreground color and/or background color. [inttf_post_ad1] PHP Class for Coloring PHP Command Line (CLI) Scripts...

Upgrade to CentOS 5.11 from CentOS 5.10 (5.9, 5.8, 5.7, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0)

This is quick guide, howto upgrade to CentOS 5.11 from CentOS 5.10 (5.9, 5.8, 5.7, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0). 1. Change to root User su - ## OR ## sudo -i 2. Backup all important data Backup /etc diretory Backup important logs /var/log Backup web server configs and sites Dump MySQL databases Dump PostgreSQL databases Backup all what you need if something goes wrong [inttf_post_ad1] 3. Check list of packages that are going to be...

Upgrade to CentOS 6.7 from CentOS 6.6/6.5/6.4/6.3/6.2/6.1/6.0

CentOS 6.6 is released. This is quick guide, howto upgrade to CentOS 6.7 from CentOS 6.6/6.5/6.4/6.3/6.2/6.1/6.0. I have tested this method on multiple CentOS 6 (servers / desktops) and everything looks work fine after upgrade. Upgrade to CentOS 6.7 from CentOS 6.6/6.5/6.4/6.3/6.2/6.1/6.0 1. Change to root User su - ## OR ## sudo -i 2. Backup all important data Backup /etc diretory Backup important logs /var/log Backup web server configs and sites Dump MySQL...

Install Chromium on CentOS/Red Hat (RHEL) 6.7

This is huide howto install Chromium Browser on CentOS 6 / Red Hat (RHEL) 6. Move directly to Chromium install guide. It's true Google Says Red Hat Enterprise Linux 6 Is Obsolete and after latest update, Google Chrome won't work anymore on CentOS 6/Red Hat (RHEL) 6. Someone might think that it's time to change Firefox or Opera, but if you have get used to Google Chrome, then it might be hard. Currently it might be possible to compile newer GCC and get Google Chrome working on Enterprise...

Fedora 22 Install Guide

This is guide with screenshots, howto install Fedora 22 (F22) using Live DVD or Live USB. Fedora 22 Installation can be done also with using Fedora NetInstall (Net Install) with gPXE and BFO (boot.fedoraproject.org). 1. Before Fedora 22 Installation 1.1 Download Fedora 22 Live DVD/USB Image Download Fedora 22 here. Select your version, Fedora 22 Workstation, Fedora 22 Server or Fedora 22 Cloud. On this guide I use Fedora 22 Workstation 64-bit. 1.2 Burn Fedora 22 Image to DVD,...

Fedora 22 Upgrade From 21 using FedUp

This is guide, howto upgrade Fedora 21 to Fedora 22 using FedUp. I have tested this method on several machines, but if you have problems, please let me know. Always remember backup, before upgrade! 1. Before Upgrade 1.1 Backup Your Data Before doing anything, do full system backup or backup at least your important data: documents, pictures, videos, config files, log files, databases etc. This is very important, because if something go wrong and you have to do fresh install,...

Fedora 19 nVidia Drivers Install / Uninstall Guide

Looking Fedora 22/21 nVidia Drivers Install Guide? [inttf_post_ad1] This is guide, howto install nVidia proprietary drivers on Fedora 19 "Schrödinger’s Cat" and disable Nouveau driver. This guide works with GeForce 6/7/8/9/200/300/400/500/600/700 series cards. Older GeForce series cards works with 304.xx nVidia drivers and newer 8/9/200/300/400/500/600/700 series cards works with 331.xx nVidia drivers. Fedora 19 nVidia driver installation is not much different from previous...

Fedora 18 nVidia Drivers Install / Uninstall Guide

Looking Fedora 22/21 nVidia Drivers Install Guide? [inttf_post_ad1] This is guide, howto install nVidia proprietary drivers on Fedora 18 "Spherical Cow" and disable Nouveau driver. This guide works with GeForce 8/9/200/300/400/500 series cards (and currently also with GeForce 6/7). Later you might need different version of nVidia drivers if you use GeForce 6/7 card. Fedora 18 nVidia driver installation is not much different from previous Fedora versions. I have tested this...

Fedora 17 nVidia Drivers Install Guide (disable nouveau driver)

Looking Fedora 22/21 nVidia Drivers Install Guide? [inttf_post_ad1] This is guide, howto install nVidia proprietary drivers on Fedora 17 "Beefy Miracle" and disable Nouveau driver. This guide works with GeForce 6/7/8/9/200/300 series cards. Fedora 17 nVidia driver installation is not much different from previous Fedora versions. I have tested this guide with a couple computers, so let me know, if you have some problems. Before nVidia drivers installation Check is your...

Fedora 16 nVidia Drivers Install Guide (disable nouveau driver)

Looking Fedora 22/21 nVidia Drivers Install Guide? [inttf_post_ad1] This is guide, howto install nVidia proprietary drivers on Fedora 16 and disable Nouveau driver. This guide works with GeForce 6/7/8/9/200/300 series cards. Fedora 16 nVidia driver installation is not much different from previous Fedora versions. I have tested this guide with a couple computers, so let me know, if you have some problems. Before nVidia drivers installation Check is your nVidia card...

Fedora 15 nVidia Drivers Install Guide (disable nouveau driver)

Looking Fedora 22/21 nVidia Drivers Install Guide? [inttf_post_ad1] This is guide, howto install nVidia proprietary drivers on Fedora 15 and disable Nouveau driver. This guide works with GeForce 6/7/8/9/200/300 series cards and also with GeForce FX cards. Fedora 15 nVidia driver installation is not much different from previous Fedora versions. I have tested this guide with a couple computers, so let me know, if you have some problems. Install nVidia proprietary drivers...

Fedora 14 nVidia Drivers Install Guide (disable nouveau driver)

Looking Fedora 22/21 nVidia Drivers Install Guide? [inttf_post_ad1] This is guide, howto install nVidia proprietary drivers on Fedora 14 and disable Nouveau driver. I write this guide about two weeks ago, but I Delayed the publication of this guide, because of pyxf86config bug, which cause following livna-config-display errors on boot: Checking for module nvidia.ko: [ OK ] Enabling the nvidia driver: Traceback (most recent call last): File...
1 2 3 4 5 6 7 8 9
Close