Install Eclipse Mars 4.5 on Fedora 24/23, CentOS/RHEL 7.2/6.8/5.11

This is guide, howto install latest Eclipse Mars.2 4.5.2 on Fedora, CentOS and Red Hat (RHEL). This guide should work with Fedora 24/23/22/21/20/19/18/17/16/15/14/13/12, CentOS 7.2/6.8/5.11 and Red Hat (RHEL) 7.2/6.8/5.11 and even with earlier versions. Latest working version on CentOS/RHEL 5.11 is Eclipse Luna 4.4.2. Eclipse is a multi-language software development environment comprising an integrated development environment (IDE) and an extensible plug-in system. It is written primarily in...

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. [inttf_post_ad1] Function to...

PHP: Remove Last Character from String – substr/substr_replace/rtrim

This is a very common PHP question, how to remove last character from string in PHP? So here are three ways how to delete last character from string in PHP. [inttf_post_ad1] Method 1 - PHP: Remove Last Character from String using substr and mb_substr substr and mb_substr commands usage substr($string, 0, -1); mb_substr($string, 0, -1); substr and mb_substr example: $string = "This is test string.."; echo $string . "\n"; // substr function echo "substr: " ....

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) Function takes three parameter: (bytes mandatory, unit optional, decimals optional) [inttf_post_ad1] PHP byteFormat function for formatting bytes <?php function byteFormat($bytes, $unit = "", $decimals = 2) { $units = array('B' =>...

PHP __DIR__, __FILE__, __FUNCTION__, __CLASS__, __METHOD__, __LINE__, __NAMESPACE__

PHP has large number of predefined constants. This HOWTO will present the seven most important, most practical and most useful PHP Magic Constants. __FILE__ - The full path and filename of the file. __DIR__ - The directory of the file. __FUNCTION__ - The function name. __CLASS__ - The class name. __METHOD__ - The class method name. __LINE__ - The current line number of the file. __NAMESPACE__ - The name of the current namespace This is example PHP script with comments,...

Nginx and PHP-FPM Configuration and Optimizing Tips and Tricks

I wrote before a guide Howto install Nginx/PHP-FPM on Fedora 20/19, CentOS/RHEL 6.5/5.10, but this guide is just installation guide and many cases Nginx and PHP-FPM basic configuration is good enough, but if you want to squeeze all the juice out of your VPS or web server / servers and do your maintenance work little bit easier, then this guide might be useful. These tips are based entirely on my own experience, so they may not be an absolute truth, and in some situations, a completely different...

Fedora 20 nVidia Drivers Install / Uninstall / Restore Plymouth

Looking Fedora 23/22/21 nVidia Drivers Install Guide? [inttf_post_ad1] This is guide, howto install nVidia proprietary drivers on Fedora 20 "Heisenbug" 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 20 nVidia driver installation is not much different from previous Fedora...

Fedora 23 Install Guide

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

Upgrade Fedora 22 to Fedora 23 Using DNF (F22 to F23)

This is guide, howto upgrade Fedora 22 to Fedora 23 using DNF. 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 step, because if something go wrong and you have to do fresh install,...

CentOS 5.11 Netinstall – Network Installation

CentOS 7 is released, check CentOS 7.1 Netinstall guide. CentOS 6 is released, check CentOS 6.7 Netinstall guide. If the purpose is to upgrade from an older version of CentOS to CentOS 5.11 then read following guide: Upgrade to CentOS 5.11 From 5.10 (5.9, 5.8, 5.7, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1, 5.0) guide This is CentOS (The Community ENTerprise Operating System) 5.11 Linux Network installation (NetInstall) step-by-step walkthrough with screenshots....

PHP: Calculate Real Differences Between Two Dates or Timestamps

I was using simple function to calculate difference between two dates and timestamps until I noticed, it's not working correctly in long intervals. It's very easy to calculate difference between two timestamps in seconds, but it's much more complicated print difference in human readable format. The Internet can be found in a wide range of ways to do this thing, but as a rule they use a fixed amount of seconds for the year and the month. So if we calculate year with using 365 or 365.25 days and...

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

cURL Tip: Check that the Apache Compression (gzip, deflate) is Working

This is a quick method with using cURL to check that Apache Compression with mod_gzip and mod_deflate is working. Only the remote server headers are needed. [inttf_post_ad1] Check that the Apache Compression is Working Get headers curl -I -H 'Accept-Encoding: gzip,deflate' http://www.if-not-true-then-false.com -I option which will make just HEAD request to server and get headers. -H option add header for accecpt content-encondig gzip and deflate. Check headers ...

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 ...
1 2 3 4 5 6 7 8 9
Close