Strict Standards: date() [function.date] Error
I was installing NagVis when I came across this weird message:
Strict Standards: date() [function.date]: It is not safe to rely on the system’s timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘UTC’ for ‘GMT/0.0/no DST’ instead in /usr/local/nagios/nagvis/nagvis/includes/classes/objects/NagVisStatefulObject.php on line 360
It clearly says that I should check the timezone, which I did. But there’s nothing wrong with time or date. ntpd is running and it set the correct timezone so what could be wrong?
If you are reading this then probably you are seeing this error too. To fix this, open your php.ini using your favourite text editor (like vi) and add this line:
date.timezone=UTC
Take note that depending on how you installed php, it could be in /etc/php.ini (RedHat) or /etc/php5/apache2/php.ini (SLES) or if compiled, /usr/local/php5/php.ini.
You need to restart Apache for changes to take effect.
How to Use the alias Command
Let us say you execute the command ‘ls –alh’ every time you need a long listing of files and directories. Now you want a shortcut to do this. Fortunately, you can do so by using the command alias.
The alias command is useful for creating shortcuts for long commands or for correcting typing mistakes.
To create a shortcut for ls, you can do this:
$ alias ls=”ls -alh”
Now, everytime you execute ls command, it will be run as if you are executing the whole ls –alh command. Be reminded that this will replace the existing ls command. You may use a different name for the new shortcut like so:
$ alias ll=”ls -alh”
However, once you exit the current terminal, the alias will not be saved. To make the alias permanent, you may edit the .bashrc file in user’s home directory:
$ vi ~rai/.bashrc
Then insert the alias command after the line that says #system wide functions and aliases. Save and exit.
That should do it!
VIM Trick: How to Comment Multiple Lines
If you need to comment out lines of text inside VIM, you can try this trick:
(Enter command mode in VIM)
:40,105s/^/#/g
This will insert the # character at the beginning of each line starting from line number 40 to line number 105.
If you cannot see the line numbers, do this:
(Enter command mode in VIM)
:set number
To remove the lines:
:set nonumber
This is quite handy if you need to comment out lines of codes in a script.
NASA Uses Linux – A Lot!
Jack Aboutboul writes an insider’s scoop as he unravels the truth behind the urban myth about NASA using Fedora and RHEL for their mission-critical machines.
Jack writes:
 There has been a long standing rumor regarding NASA running Fedora which all of us in the Fedora community have been always intrigued by. Is it true? What are they doing with it there? Why don’t they run RHEL. Fortunately enough, a couple of weeks ago, I got to experience NASA behind the scenes, first hand, and hang out with the coolest members of the Fedora community, and find out the answer to these questions and lots more.
Read more about his trip-to-die-for to NASA including the pictures here.
Howto: Install yum On RHEL 4
There are more than a couple of ways of updating Red Hat Enterprise Linux (RHEL) packages on your machine. One is by using up2date, the default package updater of RHEL systems. Unlike Fedora and CentOS which uses yum, up2date requires you to be registered to Red Hat Network (RHN) to be able to download or update your packages from the RHN repository.
Now, what if you need to install a certain package that is not available in your current repository by up2date? Or what if the package in the repository wreaks havoc in your system? Maybe you should try using yum to install or update rpm packages.
But… but… but how can I install yum in my RHEL machine?, you may ask. It’s actually very simple.
I got this tip from Babar Haq’s Blog with a little modification since I am using RHEL 4.
1. Download yum by using wget
# wget http://linux.duke.edu/projects/yum/download/2.0/yum-2.0.8-1.noarch.rpm
2. Install the rpm
# rpm -ivh yum-2.0.8-1.noarch.rpm
3. Configure /etc/yum.conf to use compatible repository
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
[base]
name=CentOS-$releasever – Base
baseurl=http://mirror.centos.org/centos/4/os/i386/
gpgcheck=1
[updates]
name=Red Hat Linux $releasever – Updates
baseurl=http://mirror.centos.org/centos/4/updates/i386/
gpgcheck=1
4. Download and install the CentOS GPG Key
# wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
# rpm –import RPM-GPG-KEY-CentOS-4
5. Test yum to see if it works (I tested by running full update on my machine)
# yum update
*Note: This will update ALL installed packages in your machine. If you do not want to do this, cancel the process or skip this step.
If you reach step 5 without encountering any errors, it means that yum is successfully updating your machine with the latest versions available in the repo. ![]()
This worked perfectly fine for me. If you experienced any errors, post a message and I will try to help you out ![]()
Search PinoyTux
Subscribe to Email Feeds
Blog Lounge
Popular Posts
Recent Posts
Drop your Card Here
Recent Comments
- Anidich1 on Tip: Add User and Generate Password Script
- Tom S on Cebu Pacific Sucks
- kadersardar on PinoyTux Spreads Some CommentLuv
- Steve on Creative Labs Threatens Third Party Driver Modder
- Barry on Free Laptops with Broadband Connection








