Apr 29 2008

How to upgrade to PHP 5 on Centos 4.6

Tag:tepezcuintle @ 20:08

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.
Continua”How to upgrade to PHP 5 on Centos 4.6″


Apr 16 2008

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

Tag:tepezcuintle @ 3:58

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.
Continua”How to setup a Linux server to connect to a NetApp Device”


Apr 16 2008

The magic of the lsof command

Tag:tepezcuintle @ 3:37

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.

Continua”The magic of the lsof command”


Apr 14 2008

How to rename weird files with spaces and strange characters

Tag:tepezcuintle @ 21:42

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.

Continua”How to rename weird files with spaces and strange characters”


Apr 10 2008

Linux system monitoring with Twitter.

Tag:tepezcuintle @ 19:58

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