Pick our brains...

Archive for November 2015

How to use WP-CLI

I wanted to write some quick notes regarding the feedback that we got from our developers about how to export and import databases using WP-CLI. What a wonderful tool it is! WP-CLI stands for “WordPress Command Line Interface”. There are a bunch of commands you can use to manage WordPress . . . Read more

Install Grunt & SASS (plus dependencies) for an account/site on shared hosting

This is needed when Grunt and SASS plus all dependencies are not installed on a Shared host. This is pretty typical for LiquidWeb shared hosting. Start by using SSH to log-in to the server as the relevant account. Example: ssh [email protected] Install RubyGems + SASS Issue these commands to download . . . Read more

Install GIT on shared hosting

This is needed when you need GIT and the server you are using is a shared host that does not already have GIT installed globally (eg. in /etc/bin or /usr/local/bin) Step-by-step guide First run gcc –version to make sure the compiler is installed and supports the installation. Edit the .bashrc . . . Read more

How to Use Rsync, a Very Beautiful File Transfer & Synchronization Tool

Rsync is an amazing tool for direct server-to-server data transfers.  Very speedy, and very smart! You can use rsync to do synchronizations between source and destination, comparing them, and copying only what’s changed.  What’s especially amazing is that rsync only transfers the “parts” of files that are different.  This works . . . Read more

Install Git on Centos

We sure would love it if git were installed on our server.  So let’s do that!   [[email protected] /var/cpanel/easy/apache/profile]# yum install git Loaded plugins: fastestmirror, priorities, security Loading mirror speeds from cached hostfile stable-arch | 951 B 00:00 stable-generic | 951 B 00:00 stable-noarch | 951 B 00:00 system-base | . . . Read more

How to Recursively Change Permissions, Only Files / Directories, Chmod

Sometimes we have the need to recursively change the permissions, but only for either files or directories.  Here’s a handy way to do this, from the command line. *Note:  Being recursive, these are powerful commands, and can change a whole bunch of things, in a very short amount of time.  Please do . . . Read more

How to Tune SpamAssassin Server-Side Spam Filters

The SpamAssassin server-side spam email filter employs Bayesian statistical algorithms to tell the difference between spam and ham.  As such, these filters do their best when they’re “learned”.  Here are some examples from a sample account. Let’s assume we’re working with a cpanel account called “oicom”, and we want to . . . Read more

Where the Frack is php.ini on a WHM/Cpanel Server?

On a WHM/Cpanel server, the main php.ini file is located thusly: /usr/local/lib/php.ini   See also: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/PhpIni Related articles Page: Install Git on Centos Page: EasyApache & Recompiling Apache / PHP (Easy Apache) Page: How to Recursively Change Permissions, Only Files / Directories, Chmod Page: How To Restart Various Server Services . . . Read more

Server Load & Loadwatch

Note: These notes pertain to PM servers.  Other servers may vary… Loadwatch Logs Located In: /root/loadwatch   To Summarize a Particular Logfile: (when in the “/root/loadwatch” directory, as root) /scripts/loadparse <filename_of_logfile>   Cumulative Log of Loads: /root/loadwatch/checklog   See also: http://linux.about.com/cs/linux101/g/loadwatch.htm http://www.xaprb.com/blog/2006/06/08/how-to-monitor-server-load-on-gnulinux/ Related articles Page: Install GIT on shared hosting . . . Read more

Mysql Database Backup & Import From the Command Line

Let’s say you’ve got root privileges, and you’re working along, and you want to quickly backup a database for USERNAME on the PM servers… cd /home/USERNAME/_back mysqldump  -uroot  DATABASENAME  >  DATABASENAME_YYYYMMDD_shortDescription.sql (Check the size of the backup file, always a good idea) ls  -lah  DATABASENAME_YYYYMMDD_shortDescription.sql (Change the owner and group . . . Read more

Linux Disk Free / Disk Usage, Per Directory ~ “du”

Disk Free, human readable df -h Disk Usage, summary, human readable (I think this include DOES include hidden files / directories) du -sh Disk Usage, per directory, human readable (does NOT include hidden files / directories) du -sh * Disk Usage, per directory, human readable (INCLUDES hidden files & directories) du -sh . . . Read more

How To Use & Understand Git for Beginners

For non-programmers or other knowledge workers like designers or copy writers – here are some resources for understanding what the hell “git” is and how and why we should use it. I’m still learning… but these resources really helped me reach a new understanding and eased some of my intimidation… . . . Read more

How to Backup a Codebase, Server Side, Well & Good

Make a Copy of an Entire Codebase: Very useful for preparing for a major version update. Let’s say you’ve got a codebase, living at: /home/USERNAME/public_html/   You can make a copy of the whole gosh dern thing, while watching the files stream before your eyes with: cp -Rv  /home/USERNAME/public_html/ /home/USERNAME/public_html_YYYYMMDD_bak/ . . . Read more