Tag Archives: bash

PHPUnit require_once(PHP/CodeCoverage… Error on Ubuntu

When trying to install PHPUnit on Ubuntu 11.10, I received the following error: PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38 PHP Fatal error: require_once(): Failed opening required ‘PHP/CodeCoverage/Filter.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in … Continue reading

Posted in PHP | Tagged , , , , , | Leave a comment

Linux test network connection

Lately I have begun to suspect on of my servers is losing its network connection under certain circumstances. Naturally I started with basic connectivity test such as ping: However, I also wanted to put it under a little strain so … Continue reading

Posted in Linux, System Administration | Tagged , , , , , , | Leave a comment

Bash: Saving output from commands

Often I want a bash script to run a command and then save the output of the command to a variable. For example, lets say I want to a file for a version number and then check in my script … Continue reading

Posted in Linux, System Administration | Tagged , , | Leave a comment

Linux Bash Scripts: colored text

Often I have wondered how scripts like grep output colored text to the terminal. It turns out it is fairly easy. The following code will output red text (depending on profile settings) to the terminal from a bash script: $(tput … Continue reading

Posted in Linux, System Administration | Tagged , , , | 1 Comment

Linux bash scripts: check if root user

On occasion, my job requires writing bash scripts on an Ubuntu server. One thing I often wish to do in my scripts is check if the script is running with root privileges. Thankfully this task is quite simple: Remember that … Continue reading

Posted in Linux, System Administration | Tagged , , , , | 1 Comment