How to setup a FastCGI development environment in CentOS 6

Install the development environment Install the C/C++ development tools to your server: yum install gcc gcc-c++ autoconf automake Now, before installing fcgi we need to add the epel repository: rpm -Uvh Once it is installed we can proceed to get the fcgi packages: yum install fcgi-devel spawn-fcgi Let’s see if we can compile a simple file. Create a file named example.c and copy and paste the following code in it:

One-liner to minimize your CSS files

The following one-liner will help you remove comments, spaces, and more from your CSS files. Suggestions are always welcomed. Important: Before running this command, create a copy of your original file. Try the resulting CSS in a test environment before releasing it. cat style.css | sed -e ' s/^[ t]*//g; # leading spaces s/[ t]*$//g; # trailing spaces s/([:{;,]) /1/g; # spaces after a colon, brace, semicolon, or comma s/ {/{/g; # spaces before a brace /^$/d # blank lines ' | sed -e :a -e '$!

Useful vim commands

Even though we have many sophisticated GUI text editors, there is one that has passed all time tests: vi. vi is a text editor created originally for Unix in 1976. Are you kidding? 1976? Why should I even bother to know it exists? Because that is the only text editor you will find for sure in any Unix like command line environment, that includes any Unix flavor, Linux and Macs. Believe me, there are many times when you have no other way to edit files (like webpages, php’s, css’s) but from the command line.

A basic .vimrc configuration file for vim users

.vimrc is the configuration file for vim. Upon execution vim will read the contents of this file setting up a customized environment. You have to save this file in your home directory. It is important to notice that the commands should not include the initial colon (:). Here are some useful commands: syntax on " syntax highlighing set number " show line numbers set ruler " show the cursor position all the time set ignorecase " ignore case when searching set hlsearch " highlight searches set tabstop=4 " number of spaces of tab character set shiftwidth=4 " number of spaces to (auto)indent set autoindent " always set auto indenting on set smartindent " smart indent set cindent " cindent If you are using vi instead of vim, then save your configuration to ~/.

Create a DNS zone file

by FreeBSD.orgAn example master zone file for within /etc/namedb/master/ is as follows: $TTL 3600 ; 1 hour default TTL IN SOA ( 2006051501 ; Serial 10800 ; Refresh 3600 ; Retry 604800 ; Expire 300 ; Negative Response TTL ) ; DNS Servers IN NS IN NS ; MX Records IN MX 10 IN MX 20 IN A ; Machine Names localhost IN A 127.

CentOS useful commands

To get your CentOS version type: cat /etc/redhat-release To update all your CentOS packages at once: yum update To install nslookup, dig and other network utilities: yum install bind-utils -y

Cómo agregar la fecha al nombre de un fichero en linux o mac

Agregar la fecha a un nombre de un fichero desde un script es muy útil, pues te permitirá generar nombres únicos para, por ejemplo, crear una lista de respaldos. Aquí os dejo un script muy sencillo que ejemplifica cómo hacerlo: #!/bin/sh dt=`date +%y%m%d` touch ./archivo-$dt Este es un programa muy sencillo el cual asigna a la variable “dt” el resultado de ejecutar el comando date +%y%m%d, el cual devuelve la fecha en formato año, mes y día.

Installing a PDF print server on Ubuntu Server

This article was originally written for Ubuntu 7, but we now know it works for Ubuntu 10 as well. Thanks Shooda! To start, install the CUPS service and CUPS-PDF files: sudo apt-get install cupsys sudo apt-get install cups-pdf Now configure CUPS to allow remote administration: sudo nano /etc/cups/cupsd.conf Modify the port where CUPS listens from: Listen localhost:631 to: Listen 631 Listen /var/run/cups/cups.sock Listen The 192.

Ubuntu 7.10 Released

Among others, this new release of Ubuntu features: 3D Screen effects enabled by default: This is soooo cool! Plus, right click on your desktop, select Change Desktop Background, select Visual Effects and click on Extra, now go move a Window. Themes, backgrounds, fonts, toolbars and visual effects have all been consolidated into a single form. Desktop search: Quick search all your files, web, email, etc. Pidgin: New name for the Gaim Internet Messenger, it features more icons 😉 and MSN icons are now shown for all your contacts.