Keeping Time on Linux using ntpdate and hwclock

On December 23, 2009, in How-to, by Cubert aka (Cube Dweller)

If you want a quick way to keep your linux system up to current time then just pop in our little script and your stay on time.

You can also use the following script to run every hour from your cronjob or create a file and copy the following to it. Place file in /etc/cron.hourly
#!/bin/sh
#Quick script to update time and push time to hardware clock
#Created Continue reading

Tagged with:
 

ELGG Plugin:AdBrite -> BritePics patch for TidyPics

On December 17, 2009, in How-to, Projects, Scripting, by Cubert aka (Cube Dweller)

As part of Squidworks community involvement in Open source software we have added another code enhancement to the ELGG community.

This patch adds the BritePics Advertising feature to TidyPics plugin for ELGG.
Now when your images are viewed in full size your Adbrite account will post a quick ad over image. It also helps protect your images as the images is now wrapped in a flash player Continue reading

Tagged with:
 

Hobbit / XYMON undefined reference to `clock_gettime’

On December 8, 2009, in How-to, by Cubert aka (Cube Dweller)

Hobbit / XYMON does not compile on CentOS 5 and complains about clock_gettime issues.

Here is how to fix this issue.
Download Hobbit-4.2.3.tar.gz
#1 make sure pcre-devel is installed (#~yum install pcre-devel)
#2 add xymon user (#~useradd xymon)
#3 set varible for “ltr” (#~LIBRTDEF=-lrt)
#4 export varible (#~export LIBRTDEF)
#5 Configure Hobbit inside hobbit src directory (#~./configure –client)
#6 Compile program (#~make)
#7 Install program (#~make install)
#8 Start Continue reading

Tagged with:
 

Get EPOCH using DATE function on linux

On November 23, 2009, in How-to, Scripting, by Cubert aka (Cube Dweller)

If you need epoch from a shell cmd line on a linux system the date cmd is a great way to do it.
date +%s -d “$a”
This code by will print epoch out at the cmd line in a ssh window or terminal window Continue reading

Tagged with:
 

Howto: MySQL Full Text Search in PHP

On November 6, 2009, in How-to, Scripting, by Cubert aka (Cube Dweller)

This tutorial is intended for Text Searching using MySQL (http://www.MySQL.com/) and PHP (http://www.php.net) and will focus on the Full-text capabilities presented by MySQL.

Synopsis

We run a website that hosts web blogs, we have a database that contains blog posts. We might create a table in our database using a statement like this:

CREATE TABLE blogs (body TEXT, title VARCHAR(250), id INT NOT NULL auto_increment, PRIMARY KEY(id);
 
Tagged with:
 

Remove CRLF from windows PHP files.

On October 20, 2009, in How-to, Scripting, by Cubert aka (Cube Dweller)

I have had a few guys ask me, Shannon I have a Windows guy developing web aps in PHP but I run them on a Linux (LAMP) system. Some times the code seems to fail and I find the files populated with Carrage Return Line Feed or better seen while looking at a windows file on a linux system in a text editor ( ^M ). This has been know Continue reading

Tagged with:
 

How-to : Installing RRDTool on centos 5 using yum

On October 5, 2009, in How-to, by Cubert aka (Cube Dweller)

Yes, I know CentOS 5 does not come with a repository that holds valid redhat style rpm’s for rrdtool. So here is how we fix that. We are going to echo to a new file the repo information you will need to allow yum to install rrdtool.

We create a file called dag.repo in /etc/yum.repos.d/ by running the echo cmd below. Just copy and past it in to your putty Continue reading

Tagged with: