Setting Up Kubernetes Cluster on CentOS Servers.

So I’ve been running some of our development components on Docker in the company but it was never significant to the level that we rely on them for Development and Production, due to some major changes in our DataCenter I had to setup some database clusters and services from scratch to migrate our old data into.

So I saw this as an opportunity to convert some of our classic VMs into docker containers for a easier production and development experience.

Continue reading “Setting Up Kubernetes Cluster on CentOS Servers.”

Change Primary Domain Documentroot in cPanel

Usually the default document root for each cPanel account is “public_html”, this is mostly fine with most of scripts but when it comes to times that you are using a framework which is suppose not to expose the main files in it’s public document root, it gets complicated.

Unfortunately there is no way to change the document root for the primary account of cPanel within the control panel itself, and the only way to do it is to have root access.

If you do have root access on your server then it will be easy to achieve that.

To change the document root simply edit the config file for the account you wish to modify, its located at:

/var/cpanel/userdata/{username}/{domainname.com}

look for the config documentroot and change it to the way you want it.

documentroot: /home/{username}/newlocation

if you got ssl installed on your domain you will need to do the same change for another file at:

/var/cpanel/userdata/{username}/{domainname.com}_SSL

once done run the following cPanel scripts to rebuild the user data cache as well as rebuild the httpd configurations.

/scripts/updateuserdatacache
/scripts/rebuildhttpdconf

Lastly restart the apache by running:

service httpd restart

Search and Replace string with SED

sed (Stream Editor) is a tiny cool tool shipped in most linux distros. most of the times I use sed to lookup for pieces of strings in my projects and replace them in cases that I’m moving them from one environment to another.

 to run sed for search and replace purpose on a single file you can do:

sed -i 's/oldstring/newstring/g' /some/path/file.txt

The above command will look up the file.txt in and search all occurances of ‘oldstring’ to ‘newstring’.

To do this in a recursive mode and all the files in a directory you can mix it up with find command.

find . -type f -exec sed -i 's/oldstring/newstring/g' {} \;

note I’ve passed “.” as the target directory to find, means I should be in the directory that I wish to run the search in. you can also replace “.” with the path of the directory you wish to do your search and replace in.

Install oci8 Extension on CentOS 7 cPanel Server

Today I had to assist a client on setting up his cpanel server to be able to connect to their oracle instance, so I had to get oci8 up and running.

We need to download basic and sdk instant client packages first. Download them from here (if the link doesn’t work due to the article being outdated please Google them) then install them by running:

rpm -Uvh oracle-instantclient11.2-basic-version.x86_64.rpm 
rpm -Uvh oracle-instantclient11.2-devel-version.x86_64.rpm

once that is done we can install oci8 using pecl. if you are using easyapache 4 it means you probably have multiphp enabled. so there is a pecl in each of the php versions bin directory.

install the oci8 using pecl in your desired php version by running :

/usr/bin/ea-php71-pecl install oci8

you can change php71 to php70.

Enable your iCloud Backup right now cause the iTunes Backup Suck!

I tweeted a short video few days ago expressing my anger towards apple update which made the touch screen not responsive in the welcome or “hello” screen. So here is the complete story.

I’ve always hated how apple thinks, although for the past 2 years I’ve been using apple devices daily specially Macbook Pro as my daily driver but it never took away a bit of my disagreement with the way they control how customers use their device.

Last Thursday my boss seeked my help to assist him to migrate his everything from his old iPhone 6s to his newly purchased iPhone X. Well this shouldn’t have been an issue at all because I’ve done that many times without issue but ever-since iOS 11 there were many weird instability bugs doing all these. The older iPhone was running iOS 10, typically I used to be able to make a full backup using iTunes and restore it while setting up the new device. This has been always working out for me but this time I was out of luck.

Continue reading “Enable your iCloud Backup right now cause the iTunes Backup Suck!”