• missing xbfish.com image

Category Archives: Software

[Linux] Resolving “PHP Deprecated” error when executing command

A while ago, I was facing the following error when running Facebook Command Line on my Linux:

PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0

To resolve this issue, open mcrypt.ini located at /etc/php5/cli/conf.d

You will see the following code snippet:

# configuration for php MCrypt module
extension=mcrypt.so

Replace the # with ;:

; configuration for php MCrypt module
extension=mcrypt.so

Hope this helps :)

Automatically refresh Mozilla Firefox

The Mozilla Firefox addons, ReloadEvery, is a useful tool for automatically refresh or reload your Firefox.

The function is embedded in the browser context menu and it also comes with custom timing input where you can set the automatic refresh rate:

missing xbfish.com image

This is particularly useful for me especially when adding tutorial slot is instantaneous in CORS.

Installing Ruby on Rails on Windows

Firstly, download the latest Ruby Installer for Windows.

Next, install Ruby using the installer. Check the following 2 boxes during the installation:

missing xbfish.com images

At the same Ruby Installer download page, download Ruby development kit and install it.

By default, Ruby Installer for Windows includes RubyGems. However, it is not the latest version. Go to RubyGems download page to get the latest RubyGems.

Extract the RubyGem package. Open up Windows command prompt and navigate to the extracted directory. Enter the following command:

ruby setup.rb

To check for gem version, enter the following command in the command prompt:

gem -v

After that, enter the following command to install Ruby on Rails:

gem install rails

To check for rails version, enter the following command in the command prompt:

rails -v

[Linux] Completely uninstall MySQL

Open up your Terminal and login as root by entering the following command:

sudo -s

Remove MySQL:

apt-get –purge remove mysql-server
apt-get –purge remove mysql-client
apt-get –purge remove mysql-common
 
apt-get autoremove
apt-get autoclean

Check if there are any MySQL dependencies installed:

apt-cache rdepends mysql-server
apt-cache rdepends mysql-client

Delete the preference files:

rm -rf /etc/mysql

Find all files with “mysql” and delete it:

find / -iname ‘mysql*’ -exec rm -rf {} \;

Reference : http://stuffthatspins.com/2011/01/08/ubuntu-10-x-completely-remove-and-clean-mysql-installation/

[Linux] Enable NO Password login in phpMyAdmin

phpMyAdmin in Linux by default does not allow NO Password login.

missing xbfish.com images

To fix this issue, sudo open the file in /etc/phpmyadmin/config.inc.php

Uncomment the following line:

$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

[Linux] Completely remove apache2 in Ubuntu

Open up your terminal and login with root access:

sudo -s

Enter the following command to list all the installs of apache2:

dpkg --get-selections | grep apache2

Remove all the installs of apache2:

apt-get remove --purge apache2 XXXXXX  XXXXXX

where XXXX are the installs generated from the previous command.

To install apache2 again, you can execute the following command:

apt-get install apache2

[Linux] Gedit highlights for Ruby on Rails

By default, Gedit in Linux only supports Ruby or Ruby on Rails (RoR) syntax highlighting. You will find that RoR tags are not being highlighted even if the highlight mode is set to RubyOnRails.

To support highlighting of RoR tags in .rhtml or .html.erb files, install Gedit plugin called gmate.

Firstly, open up your Terminal and add Ubuntu on Rails PPA:

sudo apt-add-repository ppa:ubuntu-on-rails/ppa
sudo apt-get update

Next, install gedit-gmate package:

sudo apt-get install gedit-gmate

Open a RoR file with Gedit. Go to View -> Highlight Mode -> Markup.

Check RHTML/ERB as the highlight mode.

xbfish.com

gmate plugin also shipped with various theme files for Gedit. For more information, do refer to gmate @ Github

[Linux] Fix phpMyAdmin 404 error

If you encounter a 404 error when accessing localhost/phpmyadmin (after installing apache2, mysql-server, phpmyadmin), you will need to link phpMyadmin-shipped Apache configuration into Apache.

Open up your terminal and enter the following:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
sudo /etc/init.d/apache2 reload

After this is done, try accessing localhost/phpmyadmin and you should be able to login. :)

Install Firefox 8 in Ubuntu 10.04 LTS

Ubuntu 10.04 LTS is shipped with Mozilla Firefox 3.6 by default. In order to upgrade it to Firefox 8 to support HTML5 and CSS3, we will have to add Mozilla Firefox repository.

First, open up your terminal and enter the following:

gksu add-apt-repository ppa:mozillateam/firefox-stable

Next, update the repositories:

sudo apt-get update

Lastly, install Firefox 8:

sudo apt-get install firefox

Autoindent in VIM

To enable autoindent by default in VIM, open _vimrc (Windows) at VIM installation directory or .vimrc (Linux).

Add the following line at the end of the file:

set autoindent

This will autoindent when you write code at the next line.