Archive for the 'Sys Admin' Category

ldap_add: Invalid syntax (21) – fix

Thursday, January 21st, 2010

This error was driving me nuts:

ldap_add: Invalid syntax (21)
additional info: objectClass: value #0 invalid per syntax

despite looking at my ldif a hundred times, until I relized my perl script added white space at the end of the line ….

print "objectClass: top\n";
print "objectClass: person \n";
print "objectClass: organizationalPerson \n";
print "objectClass: inetOrgPerson \n";
print "objectClass: mozillaOrgPerson \n";
print "objectClass: evolutionPerson \n";
print "objectClass: simpleSecurityObject \n";

once changed to :

print "objectClass: top\n";
print "objectClass: person\n";
print "objectClass: organizationalPerson\n";
print "objectClass: inetOrgPerson\n";
print "objectClass: mozillaOrgPerson\n";
print "objectClass: evolutionPerson\n";
print "objectClass: simpleSecurityObject\n";

The ldap gods were smiling again, hope this saves someone some time.

Parse a csv file using perl

Thursday, January 21st, 2010

While parsing and converting some CSV files to ldif’s I needed a perl script, the Test::CSV module is helpful :

#!/usr/bin/perl
use strict;
use warnings;
use Text::CSV;

my $file = ‘prospects.csv’;

my $csv = Text::CSV->new();

open (CSV, “< ", $file) or die $!;

while () {
if ($csv->parse($_)) {
my @columns = $csv->fields();
print “@columns\n”;
} else {
my $err = $csv->error_input;
print “Failed to parse line: $err”;
}
}
close CSV;

Centos : permission denied when mounting nfs share from client

Thursday, January 21st, 2010

one thing to check is that /proc/nfs is there, if not , mount it.
mount -t nfsd nodev /proc/fs/nfsd

MAC – Change default umask in Snow Leopard

Tuesday, December 22nd, 2009

echo "umask 002" >> /etc/launchd-user.conf.

reboot

Read more about it here: apple kb

CentOS 5.4 – install oracle client

Thursday, October 22nd, 2009

oracle install will need :

yum install xorg-x11-deprecated-libs