Nurulazrad Blog

RSS

How To: Set Up cPanel & WHM on Amazon Web Services -

this would be handy…

Homebrew/homebrew-php

In case you had issue with latest PHP upgrade (at time of writing is 5.5.16) with error regarding unable to load dynamic library, well you might have forgot to remove ini reference.

In my case, it tried to load intl library which already not needed for my copy of 5.5.16 version. (not sure it the same applied to others)

a quick php --ini, will list all the .ini files included:

Configuration File (php.ini) Path: /usr/local/etc/php/5.5
Loaded Configuration File:         /usr/local/etc/php/5.5/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.5/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.5/conf.d/ext-intl.ini,
/usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini,
/usr/local/etc/php/5.5/conf.d/ext-redis.ini

Removing the file /usr/local/etc/php/5.5/conf.d/ext-intl.ini solved the problem.

Homebrew install specific version of formula? - Stack Overflow

One of our project is running on old Postgresql version 8, so I decided to install the old version on my machine using homebrew (yeah, my favorite tool).

Likewise, before install any new software, I run the following tasks:

  • brew update
  • brew doctor

Now, if you do ‘brew info postgresql’, you’ll get the latest stable version that is 9.3.5 (at the time of this post). But this is not the one I want, right.

It turns out that you can look for other postgresql softwares using this command:

  • brew search postgresql

and returns the following result:

postgresql     postgresql8    postgresql9    postgresql91   postgresql92

Ok, now I see the version 8, so instead just type-in ‘postgresql’, you need to specify ‘postgresql8’ and it will install the latest update for version 8:

  • brew install postgresql8

To switch to version 8, i type in:

  • brew switch postgresql8 8.4.21

Remember to check your local postgresql8 version first, by executing:

  • brew info postgresql8

Also, you might need to update existing links for postgresql:

  • brew unlink postgresql
  • brew link --overwrite postgresql8

and not to forget to create new database. Since the current one is for postgresql ver9, creating new one called postgresql8 like so:

  • initdb /usr/local/var/postgres8

and start postgresql ver8

  • pg_ctl -D /usr/local/var/postgres8 -l logfile start

How to fix issue with DB Storage Engine failure

I have done numerous LAMP stack installation and had no issue with MySQL until recently. Upon checking with the mysqld.log file, it seems my storage engine db init function returned error.

I’m not sure what would caused the issue here, but it seems my findings suggested that the mysql/data files that has something to do with the issue. Reading the log file points that the ib_logfile0 has different size.

So, since the mysqld is already at stopped, I just delete the following files:

  1. ib_logfile0
  2. ib_logfile1
  3. ibdata1

Using the following command to remote the files:

sudo rm /var/lib/mysql/data/ib*

Hope others find the article useful.

Angular, Backbone, or Ember: Which is Best for your Build?

codeschool:

With the release of our Shaping Up With Angular.js course, Code School has now produced a hat trick of courses focused on JavaScript frameworks. In order to choose which framework is right for your build, we’ve asked four important questions of each framework.

image

AngularJS

1. What is…

azrad/Book.php

Since I’m so get used to CakePHP 2+ now, sometimes need to create new site but without using any database — just plain php.

Reason for using CakePHP instead of plain php is because I want to use the extends templates features and in case we need to use database, I can just update my default datasource.

At the moment, I just rely on the PagesController only.

Setup SSH to run on a non-standard port - nixCraft

ok… today I’ve learnt something new regarding accessing non-standard ssh port. Instead of append colon (:) at the end, you need to add ” -p ” option when executing shh command like so:

ssh -p port user@host

eg: ssh -p 1000 user@localhost

well, there’s always first time in everything.

enjoy!

Apr 9

Yum Command Check and Apply Only Security Updates

My Amazon friend just emailed me regarding security vulnerability in OpenSSL. At the moment we are not using it, but may it’s good time to do some updates on my servers.

I’m using the default Amazon Mirror Image (AMI), it’s based on Centos. So in this case, first I will run the following command:

yum --security check-update

#note: if the above command fails, you need to install the security plugin via this command: sudo yum install -y yum-plugin-security

This will lists all the required files to be updated. Next, execute the update command:

sudo yum --security update

#note: you must be a superuser to do this.

Wait for the installations, and you are done.

Enjoy!

Apr 9

How to install PostgreSQL on Mac via Homebrew and gem

Just finished my Surviving Rails API course and downloaded the code from github. Currently, the database is set to use PostgreSQL. Not that I cannot changed to MySQL, but I just like to install stuff… =)

So, I’m on a Mac running Mountain Lion, (Maverick just too heavy for my machine) and got homebrew running — I always see if it can be brewed first, otherwise, you just need to compile it yourself.

First step is to make sure brew is updated by executing the following command:

brew update

brew doctor

Next, is to install the PostgreSQL. At this moment of writing, the stable version is 9.3.4. Executing the following to install

brew install postgresql

Wait till the installation to finished.

I followed Moncef Belyamani tutorial and installed Lunchy via gem.

gem install lunchy

Once the installation finished, you need to restart your terminal (in my case). From the command line, just execute . ~/.zshrc if you’re on ZShell.

Then to start and stop the PostgreSQL is a simple as:

lunchy start postgres

lunchy stop postgres

Hopes that’s help and enjoy!

Twitter / MacHomebrew: We now have a brew cleanup ...

… in case you too busy keeping your local softwares updated using brew upgrade, now is time to do some cleanup via brew cleanup.

how cool is that!