<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.7.1" -->
<rss version="0.92">
<channel>
	<title>celsobarriga-dot-com</title>
	<link>http://www.celsobarriga.com</link>
	<description>Wasting bandwidth in style!</description>
	<lastBuildDate>Fri, 29 May 2009 15:58:44 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Base64 Encoding and Decoding</title>
		<description>At one time, I needed to encode and decode strings in Base64 but I was on a very old Perl version that does not include the MIME::Base64 core module, nor am I able to install the said module. So, here's the source for encoding and decoding Base64 ripped from the ...</description>
		<link>http://www.celsobarriga.com/2009/05/28/base64-encoding-and-decoding/</link>
			</item>
	<item>
		<title>Skydiving video</title>
		<description>Look what I did last weekend! I went for a tandem skydive at Pepperell, MA on May 24th, 2009. What a rush; it was an awesome experience!

 </description>
		<link>http://www.celsobarriga.com/2009/05/25/skydiving-video/</link>
			</item>
	<item>
		<title>Read string from stdin using fgets</title>
		<description>#include &#60;stdio.h>
#include &#60;string.h>

int main(void)
{
  char str[80];
  int i;

  printf("Enter a string: ");
  fgets(str, 10, stdin);

  /* remove newline, if present */
  i = strlen(str)-1;
  if( str[ i ] == '\n')
      str[i] = '\0';

  printf("This is your string: ...</description>
		<link>http://www.celsobarriga.com/2009/02/26/read-string-from-stdin-using-fgets/</link>
			</item>
	<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:

#!/usr/local/bin/perl

use ExtUtils::Packlist;
use ExtUtils::Installed;

$ARGV[0] or die "Usage: $0 Module::Name\n";

my $mod = $ARGV[0];

my $inst = ExtUtils::Installed->new();

foreach my $item (sort($inst->files($mod))) {
         print "removing $item\n";
         unlink $item;
}

my $packfile = $inst->packlist($mod)->packlist_file();
print "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>
</channel>
</rss>
