Dec 03 2009

HOW TO UPGRADE TO PHP 5.3 ON A CENTOS 5 DISTRO

Tag:tepezcuintle @ 18:36

Centos
HOW TO UPGRADE TO PHP 5.3 ON A CENTOS 5 DISTRO

I am trying to install cahoots a StackOverflow clone but I am running Centos 5 and by default
it comes with php 5.1.6 and I needed to install the Zend Framework. If you tried to install the Zend
framework you will realize that you need PHP 5.2 in order to use it.

I know there are ways to install a new version of PHP on Centos 5, I would not recommend this steps
on a production system at work because you will be using repos that are not supported by Redhat or Centos
so if the maintainer of the repo decides to you are stuck with a version of PHP that is not maintained
by anyone and if there are bugs or security risks you are stuck with a machine that is not supported anymore.
Continua”HOW TO UPGRADE TO PHP 5.3 ON A CENTOS 5 DISTRO”


Oct 02 2009

MySQL Backup Table Schema Structure and Backup only Data

Tag:tepezcuintle @ 16:50

Dolphin

This is a reminder of how to backup the schema of a complete database

mysqldump –no-data -h localhost -u root -ppassword mydatabase > mydatabase_backup

This is if you want to only backup certain tables schema.

mysqldump –no-data -h localhost -u root -ppassword mydatabase table1 table2 > mydatabase_backup.sql

Continua”MySQL Backup Table Schema Structure and Backup only Data”


Oct 02 2009

The Most Common OpenSSL Commands

Tag:tepezcuintle @ 16:36

Hackers

The Most Common OpenSSL Commands

One of the most versatile SSL tools is OpenSSL which is an open source implementation of the SSL protocol. There are versions of OpenSSL for nearly every platform, including Windows, Linux, and Mac OS X. OpenSSL is commonly used to create the CSR and private key for many different platforms, including Apache. However, it also has hundreds of different functions that allow you to view the details of a CSR or certificate, compare an MD5 hash of the certificate and private key (to make sure they match), verify that a certificate is installed properly on any website, and convert the certificate to a different format.

Continua”The Most Common OpenSSL Commands”


Oct 02 2009

Useful OpenSSL Tricks

Tag:tepezcuintle @ 16:31

Gif

Introduction

OpenSSL deserves a lot of credit. It is an extremely useful, valuable Open Source project. When
people talk about how successful Apache is, rock-solid crypto toolkits like OpenSSL and OpenSSH should
also be mentioned. Here are a few (of the many) functions that I have found useful, along with examples of
how to use them:

Continua”Useful OpenSSL Tricks”


Aug 17 2009

Search and Replace String MySQL

Tag:tepezcuintle @ 15:25

A day will eventually come when your need to find and replace a string of text in your database. You don’t know which row, or which column, or which table. Heck, you may not even know which database. Your options are: spend the rest of the summer hunting down the elusive table cells, or use the weapon of mass replacement described below. Naturally and as usual, you absolutely must back up your database (or databases) before attempting any far-reaching scripted mumbo jumbo.
Continua”Search and Replace String MySQL”


Aug 14 2009

Create your own PGP Public Key

Tag:tepezcuintle @ 17:30


Linux create your own GnuPG private and public key
GNU gpg is encryption and signing tool.

The GNU Privacy Guard (GnuPG or GPG) is a free software replacement for the PGP suite of cryptographic software.

GnuPG encrypts messages using asymmetric keypairs individually generated by GnuPG users. The resulting public keys can be exchanged with other users in a variety of ways, such as Internet key servers. They must always be exchanged carefully to prevent identity spoofing by corrupting public key ? 'owner' identity correspondences. It is also possible to add a cryptographic digital signature to a message, so the message integrity and sender can be verified, if a particular correspondence relied upon has not been corrupted.

Continua”Create your own PGP Public Key”


Aug 13 2009

How to Drop all Tables on a MySQL database

Tag:tepezcuintle @ 19:17

Shark

Let’s say you need to drop all tables in a mysql database. How do you do that?

You could use a gui, but that’s not fun.

You’re a shell jockey so you want a commandline:

mysql -u uname dbname -e "show tables" | grep -v Tables_in | grep -v "+" | \
gawk '{print "drop table " $1 ";"}' | mysql -u uname dbname

(that’s all one line, but if I do it as a line then it screws up my theme - go figure).

This assumes that you are running in passwordless mode. See “man mysql” for tips on how to pass in passwords in another manner.

What this does is

1.connect to a specific mysql database and execute the command for showing tables
2.find lines that match “Tables_in” and not show them
3.find lines that match the + character and not show them
4.use gawk to print out the words “drop table” followed by the table name (which is in $1) and then a semicolon
5.pipe all of that back to the database you got the list from to drop those tables
Fun stuff and very handy!


May 01 2009

A Simple Monitoring Script to monitor devices or hosts

Tag:tepezcuintle @ 21:38

Monitor
At work we have a few routers, switches and servers that if they go down we want to know right away. The last thing we want is the CEO coming to our desk asking why the mail server is down or why the webserver it not responding.

I wrote a little script a very simple one that given a list of hosts and IP addresses will ping a host and if it is detected as down it will send you an email right away.

########## Instructions on how to use this monitor script ############

Make a directory called scripts
mkdir /scripts then inside create using your favorite text editor the following script


#!/bin/bash
# Ping Alert Monitor by Marco Maldonado V 1.0
# Create a hosts file and save it somewhere on your server
# specify a path and an email address where you want to send alerts
#
# Note: Your hosts file should have the IP address of the host followed by a space and the name
# of the server: Example Below
#
# 69.147.76.15 www.yahoo.com
# 209.85.165.147 wwww.google.com
#

# Path to your hosts file

HOSTS="/scripts/hosts"

# Email address where to send alerts, you can add more addresses followed by a comma

EMAIL="yourname@yourdomain,someaddres@gmail.com"

### Do not edit anything below ############

for myHost in `cat $HOSTS | cut -d' ' -f1` ; do
ping -c 1 $myHost > /dev/null
if [ $? -ne 0 ] ; then
echo “Server `grep $myHost $HOSTS` is down reported down at `date`” | mail -s “Ping Alert Server `grep $myHost $HOSTS` might be down” $EMAIL
fi ;
done

Continua”A Simple Monitoring Script to monitor devices or hosts”


Apr 27 2009

Your File System became read only. What gives?

Tag:tepezcuintle @ 13:38

If your system abruptly loses power, or if a RAID card is beginning to fail, you might see an ominous message like this within your logs:

EXT3-fs error (device hda3) in start_transaction: Journal has aborted

Basically, the system is telling you that it’s detected a filesystem/journal mismatch, and it can’t utilize the journal any longer. When this situation pops up, the filesystem gets mounted read-only almost immediately. To fix the situation, you can remount the partition as ext2 (if it isn’t your active root partition), or you can commence the repair operations.

Continua”Your File System became read only. What gives?”


Apr 21 2009

Configure Postfix with smart host

Tag:tepezcuintle @ 16:45

Postfix mouseAt work i setup a programming environment for developers. The server is on a natted IP address range and could not send email to our internal mail server because of some weird firewall issues.

All email going to external sites was working fine but to send to our internal domain it wouldn’t work so i had to figure out how to get emails out. I am running postfix on the server so what I did i had postfix relay the mail to my ISP’s mail server. I had done this in the past using sendmail but with postfix I had to do the following.

Continua”Configure Postfix with smart host”


Next Page »