ValpoLinux or Valparaíso Chile Linux Users Group

Valpo Linux or Valparaíso Chile Linux Users Group had a meeting on January 21st 2012 to discuss FISOL in a few months. Gringo Malvado requested a montly meeting. We will try having meetings on the second Thursday of every month at Torito's in Vina Del Mar, Chile at 7 Norte and Av. San Martin.

Delete files older than X number of days

The Find Utilitiy

Recent versions of "find" include a feature to delete the files that are found. This can be dangerous so always test when you know you have good backups.

A simple example to locate files older than three days and delete them without using pipes.

find /directory/* -mtime +3 -delete

You can replace the 3 with what ever you like. Read more about this and other features in the manual.

Tags:

Installing a recent version of Fabric on Debian

Introduction

Some new features like parallel are handy but require an updated version of fabric. Here is a safe and clean way of installing Fabric in a more Pyhonic fashion. This should also work just fine on other distros that use aptitude or apt-get and this can be an exercise to the reader to figure out how to do this with yum or urpmi.

Tags:

A Fabric File Part 1

Fabric

Fabric is a Python library that allows you to deploy servers over SSH connections. Lets start with a look at the fabfile.py and how to use it. This tool can be used for administration and deployment both big and small.

Tags:

Using Dnsmasq for DHCP DNS and TFTP

Introduction

Dnsmasq is a lightweight server for DHCP, DNS and TFTP. For DHCP and DNS there are simple to advanced features needed in an embeded or small system like a consumer router. The TFTP features are few but functional. Knowing about Dnsmasq and how to use it is a great skill. Look, Learn, and Play!

Learning About VoIP Communications

This is a work in progress and will be updated. Contact me lathama@lathama.com for updates and questions.

Introduction

This is a summary used in talks about VoIP at events and schools. This list of talking points will continue to develop.

Downgrading or rolling back or just setting package versions with aptitude

In Linux distributions there are times when packages need to be set a static version. Here is a quick summary and example. The item of note is that this is called "setting the package version" and not downgrade, rollback or revert.

aptitude versions thepackage
aptitude install thepackage=theversion

Lets set the version of PHP5.

PS:~# aptitude versions php5
p   5.3.3-7+squeeze1   stable   500 
i   5.3.3-7+squeeze3   stable   500

and the command

PS:~# aptitude install php5=5.3.3-7+squeeze1

Tags:

Learning to install Virt-Manager from sources

Introduction & Problem

This is the process to install updated or newer version of virt-manager. Many times you will find that you need a feature that is just not available in the distribution supplied version of virt-manager. Here is a quick install process.

Add BASH aliases for IPTABLES

Its good to have tools. Here is a quick addition to any /root/.bashrc file. This will add commands for blocking connections from IP addresses and methods of removing the bans. Use with care.

alias ban='iptables -I INPUT -j DROP -s'
alias unban='iptables -D INPUT -j DROP -s'
alias banin='iptables -I INPUT -j DROP -s'
alias unbanin='iptables -D INPUT -j DROP -s'
alias banout='iptables -I OUTPUT -j DROP -s'
alias unbanout='iptables -D OUTPUT -j DROP -s'
alias listbans='iptables -L -v -n | grep -e Chain -e DROP'

After adding them, always source it.

Recursively deleting Microsoft end of line characters

Simple one liner to remove all ^M line returns from files in a directory. I use this on an Open Source project I work on mainly for PHP files. Type "CTRL v" then "CTRL m" to get the system ^M char. The character will not copy and paste. The filter for SVN is optional.

grep -IUrl "^M" * | grep -v svn | xargs sed -i 's/^M$//'

Easy! Search the directory recursively. Filter out the SVN files. Run SED against the files in the list.

Tags:

Pages

Subscribe to lathama.net RSS