<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.5.1" -->
<rss version="0.92">
<channel>
	<title>celsobarriga-dot-com</title>
	<link>http://www.celsobarriga.com</link>
	<description>Wasting bandwidth in style!</description>
	<lastBuildDate>Mon, 28 Jul 2008 06:21:25 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>How to determine DST time changes</title>
		<description>Here's how to determine the dates when the Daylight Savings Time changes for a given year (I keep forgetting how to do this.):


zdump -v /etc/localtime&#124;grep 2008

/etc/localtime  Sun Mar  9 06:59:59 2008 UTC =
    Sun Mar 9 01:59:59 2008 EST isdst=0 gmtoff=-18000
/etc/localtime  Sun Mar  ...</description>
		<link>http://www.celsobarriga.com/2008/02/01/how-to-determine-dst-time-changes/</link>
			</item>
	<item>
		<title>Uninstall Perl Module</title>
		<description>Here&#39;s how to cleanly uninstall any Perl module:


#!&#47;usr&#47;local&#47;bin&#47;perl

use ExtUtils::Packlist;
use ExtUtils::Installed;

$ARGV&#91;0&#93; or die &#34;Usage: $0 Module::Name\n&#34;;

my $mod = $ARGV&#91;0&#93;;

my $inst = ExtUtils::Installed-&#62;new();

foreach my $item (sort($inst-&#62;files($mod))) {
         print &#34;removing $item\n&#34;;
         unlink $item;
}

my $packfile = $inst-&#62;packlist($mod)-&#62;packlist_file();
print &#34;removing ...</description>
		<link>http://www.celsobarriga.com/2008/01/10/uninstall-perl-module/</link>
			</item>
	<item>
		<title>Find Out the Top 10 CPU Hogs</title>
		<description>I found this command useful in finding out which top 10 processes are hogging my CPU resources. Note that this command is specific to the Red Hat flavor of Linux. See the man page for ps for the correct output format to use for your specific platform:

ps -eo pcpu,pid,user,args &#124; ...</description>
		<link>http://www.celsobarriga.com/2007/08/29/find-out-the-top-10-cpu-hogs/</link>
			</item>
	<item>
		<title>Bourne Shell Logging Routine</title>
		<description>Here's another logging routine, this one is written in Bourne shell:


#!/bin/sh

log_message() {
    echo `date "+%m/%d/%y %H:%M:%S %Z"` "$1" &#124; tee -a aaa.out
}

log_message "Hello there"
log_message "Goodbye"


Sample output:

08/28/07 23:16:13 EDT Hello there
08/28/07 23:16:13 EDT Goodbye
 </description>
		<link>http://www.celsobarriga.com/2007/08/28/bourne-shell-logging-routine/</link>
			</item>
	<item>
		<title>Setting MySQL Password</title>
		<description>To set up root password the first time:

$ mysqladmin -u root password NeWPasSwORd

To change an existing root password:

$ mysqladmin -u root -p oldpassword newpass
Enter password:


To change a normal user password:

$ mysqladmin -u dbuser-p oldpassword newpass </description>
		<link>http://www.celsobarriga.com/2006/08/23/setting-mysql-password/</link>
			</item>
	<item>
		<title>Sorting IP Addresses</title>
		<description>The following will sort an array of IP addresses in @in and the sorted IP addresses will be in @out.



@out = sort {
    pack('C4' => $a =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/)
    cmp
    pack('C4' => $b =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/)
} @in;



What this does is it forms a ...</description>
		<link>http://www.celsobarriga.com/2006/07/13/sorting-ip-addresses/</link>
			</item>
	<item>
		<title>Determining the External IP Address</title>
		<description>Here's how to find out your external IP address courtesy of this hint:
http://www.macosxhints.com/article.php?story=20060602180942480



curl --silent http://checkip.dyndns.org
    &#124; awk '{print $6}' &#124; cut -f 1 -d " </description>
		<link>http://www.celsobarriga.com/2006/06/07/find-external-ip-address/</link>
			</item>
	<item>
		<title>Write a Daemon in Perl</title>
		<description>The code below is a template for a daemon written in Perl. Use the code below as a starting point when you have to write a program that has to persist in the background to do its things and without a gui.


use POSIX qw(setsid);

chdir '/' or die "Can't chdir to ...</description>
		<link>http://www.celsobarriga.com/2006/05/24/write-a-daemon-in-perl/</link>
			</item>
	<item>
		<title>Line Terminations</title>
		<description>Line terminations for different operating systems:


unix0x0aLF
Classic Mac0x0dCR
Windows0x0d 0x0aCR LF


To convert a text file with DOS line termination to UNIX line termination:

tr -d '\015' < winfile.txt > unixfile.txt


or


sed s/.$// winfile.txt > unixfile.txt


To convert a unix file to a DOS file:

sed s/$/\x0d/ unixfile.txt > winfile.txt
 </description>
		<link>http://www.celsobarriga.com/2006/04/13/line-terminations/</link>
			</item>
	<item>
		<title>Run Periodic Maintenance Scripts Manually</title>
		<description>Mac OS X has to run some maintenance scripts in the middle of the night to do some important housekeeping tasks. If you have a Mac that sleeps in the middle of the night, as you do, you need to run these manually by running this from the shell:


sudo periodic ...</description>
		<link>http://www.celsobarriga.com/2006/02/11/run-periodic-maintenance-scripts-manually/</link>
			</item>
</channel>
</rss>
