Posts

Install APC for PHP 5.5x in WampServer

Download APCu for PHP 5.5x http://pecl.php.net/package/APCu/4.0.6/windows Extract and copy php_apcu.dll to PHP extension directory C:\wamp\bin\php\php5.5.12\ext Enable APC extension in php.ini extension=php_apcu.dll Restart Wampserver

MySQL Without The Login Prompt

There may be times when you want to use MySQL without the login prompt like when running cron jobs. For that MySQL has something called Option Files wherein you can specify commonly used options so you do not need to enter them in the command line. To use MySQL without the login prompt, create a file in your home directory: touch ~/.my.cnf Modify the file and paste the following configuration: [mysql] user=your_mysql_user password=your_mysql_password You may also specify your configuration for mysqldump so that you can backup files with cron periodically :) [mysqldump] user=my_user password=my_password

Install Sublime Text 2 in Ubuntu

1. Download Sublime Text 2 2. Unzip the downloaded file tar vxjf Sublime\ Text\ 2.0.2.tar.bz2 3. Move the Sublime Text 2 folder in /opt directory sudo mv Sublime\ Text\ 2 /opt/ 4. Create a symbolic link for sublime so that you can execute it anywhere using the terminal sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/sublime Note that /usr/bin must be included in the $PATH variable for the symlink to work. 5. This time, create a desktop file so that sublime can also be executed through a launcher in the Unity . sudo sublime /usr/share/applications/sublime.desktop 6. Copy the following in sublime.desktop [Desktop Entry] Version=1.0 Name=Sublime Text 2 GenericName=Text Editor Exec=sublime Terminal=false Icon=/opt/Sublime Text 2/Icon/48x48/sublime_text.png Type=Application Categories=TextEditor;IDE;Development X-Ayatana-Desktop-Shortcuts=NewWindow [NewWindow Shortcut Group] Name=New Window Exec=sublime -n TargetEnvironment=Unity 7. To set Sublime as the def...

Installing Git in Ubuntu

To install git, run: sudo apt-get install git After installing git, you may setup the following configuration: git config --global user.name "Your Github Name" git config --global user.email "email@example.com" git config --global color.ui true

Git Configuration: Colorize Output

Git has this feature that allows its terminal output to be colorized. There are various options to do that, and one of it is through the color.ui You can choose how you want the terminal coloring but if you want to colorize all git output, set color.ui to true git config --global color.ui true Here are the settings you may use for color.ui : true → set colors to all git terminal output false → never colors the output always → always set colors to the output even when piping git with another command Setting specific colors to git commands git config --global color.branch true git config --global color.diff true git config --global color.status true git config --global color.log true

Installing MySQL in Fedora

Install MySQL yum -y install mysql mysql-server Enable MySQL service: /sbin/chkconfig mysqld on Start the MySQL server: /sbin/service mysqld start Set the MySQL root password: mysqladmin -u root password 'MyNewPassword123'

PHP Pagination with Bootstrap 3

Image
In this guide, I will show you how to create a very simple pagination in PHP using Bootstrap 3. With just a few steps you will be able to create something like this: Before we start, prepare the following files and folders: - bootstrap/ - index.php - pagination.php Step 1: Download Bootstrap 3 and extract its content inside bootstrap directory: - bootstrap/ ├── css/ │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── bootstrap-theme.css │ └── bootstrap-theme.min.css ├── js/ │ ├── bootstrap.js │ └── bootstrap.min.js ├── fonts/ │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff - index.php - pagination.php Step 2: Copy the basic template and paste it in index.php . Step 3: Remove the line: <h1>Hello, world!</h1> And replace with: <div class="container"> <div class="row"> <?php requi...