Skip to main content.
April 29th, 2008

How to upgrade to PHP 5 on Centos 4.6

I have a VMWare Virtual machine that I use for testing and I needed to upgrade to PHP 5
this can be accomplished this way.

To upgrade to PHP5
edit /etc/yum.repos.d/CentOS-Base.repo
Enable CentOSPlus
Then do yum update php

basically the REPO will look like this after you enable it.

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1

[root@localhost ~]# yum update php
Setting up Update Process
Setting up repositories
centosplus 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 82 kB 00:00
centosplus: ################################################## 274/274
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for php to pack into transaction set.
php-5.1.6-3.el4s1.8.i386. 100% |=========================| 17 kB 00:00
—> Package php.i386 0:5.1.6-3.el4s1.8 set to be updated
–> Running transaction check
–> Processing Dependency: php = 4.3.9-3.22.9 for package: php-ldap
–> Processing Dependency: php-cli = 5.1.6-3.el4s1.8 for package: php
–> Processing Dependency: php = 4.3.9-3.22.9 for package: php-pear
–> Processing Dependency: php-common = 5.1.6-3.el4s1.8 for package: php
–> Restarting Dependency Resolution with new changes.
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for php-common to pack into transaction set.
php-common-5.1.6-3.el4s1. 100% |=========================| 19 kB 00:00
—> Package php-common.i386 0:5.1.6-3.el4s1.8 set to be updated
—> Downloading header for php-ldap to pack into transaction set.
php-ldap-5.1.6-3.el4s1.8. 100% |=========================| 16 kB 00:00
—> Package php-ldap.i386 0:5.1.6-3.el4s1.8 set to be updated
—> Downloading header for php-pear to pack into transaction set.
php-pear-1.4.11-1.el4s1.1 100% |=========================| 20 kB 00:00
—> Package php-pear.noarch 1:1.4.11-1.el4s1.1 set to be updated
—> Downloading header for php-cli to pack into transaction set.
php-cli-5.1.6-3.el4s1.8.i 100% |=========================| 17 kB 00:00
—> Package php-cli.i386 0:5.1.6-3.el4s1.8 set to be updated
–> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Updating:
php i386 5.1.6-3.el4s1.8 centosplus 1.1 M
Installing for dependencies:
php-cli i386 5.1.6-3.el4s1.8 centosplus 2.0 M
php-common i386 5.1.6-3.el4s1.8 centosplus 136 k
Updating for dependencies:
php-ldap i386 5.1.6-3.el4s1.8 centosplus 31 k
php-pear noarch 1:1.4.11-1.el4s1.1 centosplus 345 k

Transaction Summary
=============================================================================
Install 2 Package(s)
Update 3 Package(s)
Remove 0 Package(s)
Total download size: 3.7 M
Is this ok [y/N]:
Read the rest of this entry »

Posted by tepezcuintle as LAMP at 8:08 PM EDT

No Comments »

April 16th, 2008

How to setup a Linux server to connect to a NetApp Device

We don’t have any type of Netapp setups at work and I am interested in knowing more how people use Netapp devices to provide disk access to linux servers.

I found this great guide. :) and I am saving this for future reference.
Read the rest of this entry »

Posted by tepezcuintle as General Linux at 3:58 AM EDT

Comments Off

The magic of the lsof command

Problem:

You have a service that cannot bind to a port and the only message you have in log files is ‘port already in use’ or you have a need to find out exactly what processes are currently manipulating your server and what files they are affecting.

Read the rest of this entry »

Posted by tepezcuintle as General Linux at 3:37 AM EDT

Comments Off

April 14th, 2008

How to rename weird files with spaces and strange characters

I found a post on webhosting talk with a question on how to rename strange files that have spaces and weird characters.

for example files like this

Movie_46_(Dark sector brutal59).flv
Movie_46_(Dark sector brutal59).wmv

as you can see there are weird characters like ( ) and spaces.
so here is a quick way to rename those files.

Here is an example i ran on my machine to see it works.

Read the rest of this entry »

Posted by tepezcuintle as Uncategorized at 9:42 PM EDT

Comments Off

April 10th, 2008

Linux system monitoring with Twitter.

Here is a little script I wrote to update twitter with server status infomation.
this is not trying to replace Nagios or more advanced server monitoring tools, but if you want to track your own personal server and want a cool hack you can use this script and tweak it.

Please if you do some cool updates could you email it to imrobotmaker@yahoo.com

Thanks

—cut below here —-

#!/bin/bash
#
# twitter-stats Script to update Twitter with server stats
#
# Author: By Marco Penguin
# Purpose --- See Below
# We will be using curl to send updates to twitter.
# With this example here will send reports for SSH Connections, Disk Space and Server Load
# You can modify this script to send other cool stuff you want to track
#
# Warning: You should protect your updates on twitter unless you want to make this info public
#
# Things you want to change TUSERNAME "Your twitter username" TPASSWD "Your Twitter Password"
# Add this script to your cronjobs or put it on your /etc/cron.hourly to run every hour
# or /etc/cron.daily to run it only once a day.

### Some Twitter Variables

TUSERNAME="your_twitter__username"
TPASSWD="your_twitter_password"

### Stuff We Want to track #####
SSHNET=$( netstat | grep "ssh" | tr -s ' ' | cut -d: -f2 )
DISKSPACE=$( df -h | tr -s ' ' | grep -e hda -e hdb | cut -d' ' -f1,4 | sed "s/\/dev\//hardrive /g" | sed "s/$/ remaining space/g" )
LOAD=$( uptime | tr -s ' ' | cut -d' ' -f9-14 | sed "s/[:,]//g" )

### Path to Curl #########

CURL="/usr/bin/curl"

######### Update Twitter Information #########

### Send Disk Space Info to twitter ########

$CURL -s -u $TUSERNAME:$TPASSWD -d status="$DISKSPACE" http://twitter.com/statuses/update.xml > /dev/null

##### Send Server Load Status to Twitter ######

$CURL -s -u $TUSERNAME:$TPASSWD -d status="$LOAD" http://twitter.com/statuses/update.xml > /dev/null

### Send Remote SSH connections status ######

$CURL -s -u $TUSERNAME:$TPASSWD -d status="Remote SSH connections $SSHNET" http://twitter.com/statuses/update.xml > /dev/null


—end of code—-

You can download the full script here.

http://penguincares.no-ip.org:9090/twitter-stats.txt

Posted by tepezcuintle as Bash Scripting at 7:58 PM EDT

No Comments »

March 17th, 2008

How to setup Cron.

Newbie: Intro to cron
Date: 30-Dec-99
Author: cogNiTioN <cognition@attrition.org>


Cron

This file is an introduction to cron, it covers the basics of what cron does,
and how to use it.

What is cron?

Cron is the name of program that enables unix users to execute commands or
scripts (groups of commands) automatically at a specified time/date. It is
normally used for sys admin commands, like makewhatis, which builds a
search database for the man -k command, or for running a backup script,
but can be used for anything. A common use for it today is connecting to
the internet and downloading your email.

Read the rest of this entry »

Posted by tepezcuintle as General Linux at 3:02 PM EDT

Comments Off

How to backup PostgreSQL

Howto Backup PostgreSQL Databases Server With pg_dump command
Generally, I like to work with MySQL but some time my work force me to work with PostgreSQL database server.
Recently I had received a request to backup PostgreSQL databases as one of our client want to format and reinstall RHEL server.
PostgreSQL is a one of the robust, open source database server. Like MySQL database server, it provides utilities for creating a backup.
Read the rest of this entry »

Posted by tepezcuintle as Bash Scripting, Databases at 2:46 PM EDT

Comments Off

March 1st, 2008

Learn Bash

 

INTRODUCTION TO BASH SHELL SCRIPTING:
VERSION 1.2

Like all the shells available in Linux, the Bourne Again SHell
is not only an excellent command line shell, but a scripting language in
itself. Shell scripting, allows you to fully utilize the shell’s abilities and
to automate a lot of tasks that would otherwise require a lot of commands to
perform. A lot of programs lying around your Linux box are shell scripts. If
you are interested in learning how they work, or in modifying them, it is
essential that you understand the
bash
syntax and semantics. In addition, by understanding the
bash language, you will be
able to write your own programs to do things exactly the way you want
them done.
Read the rest of this entry »

Posted by tepezcuintle as Bash Scripting at 1:55 AM EST

Comments Off

February 11th, 2008

MySQL Troubleshooting Queries and Processes

Dolphin

Here is are some quick reminders to help troubleshoot mysql connections.

Show a list of active processes:

mysqladmin -u root -p processlist

enter your password and you will get a list of processes running on the server.

mysqladmin can help you do other cool stuff.

Read the rest of this entry »

Posted by tepezcuintle as Databases at 10:29 PM EST

Comments Off

More Sed Tutorials

sed tutorial
• sed introduction
• sed examples #1 • sed commands
• regular expressions
• more sed examples
intro home - top of the page - email

sed - Stream EDitor - works as a filter processing input line by line.
Sed reads one line at a time, chops off the terminating newline, puts what is left into the pattern space (buffer) where the sed script can process it (often using regular expressions), then if there anything to print - sed appends a newline and prints out the result (usually to stdout).
• www.engin.umich.edu/htbin/mangate?manpage=sed - sed

Read the rest of this entry »

Posted by tepezcuintle as Bash Scripting at 9:46 PM EST

Comments Off

« Previous Entries