Posts

Cygwin + syslog-ng

Until I can get a real workstation at work and get off this winblows, Cygwin is my friend.  I am working on some OO programming with PERL and really need to be able to log syslog messages locally. After installing syslog-ng, I couldn't figure out how to run it, till I stumbled on a page that mentioned the syslogd-config command. Initially I had some problems because the /etc/passwd and /etc/group files were not world readable (don't know if that is a side effect of the Legato restore of my laptop or just the default behavior) however a quick " chmod a+r /etc/passwd /etc/group " seemed to help. running syslogd-config yielded this output: > syslogd-ng-config Creating default /etc/syslog-ng.conf file Warning: The syslogd service is already installed.  You can not run both, syslogd and syslog-ng in parallel. Do you want to deinstall the syslogd service in favor of syslog-ng? (yes/no) yes Warning: The following function requires administrator privileg...

PERL Array count on Array Reference

PERL has a lot of cool built in operators to find things like number of elements in an array an such ($# ) which are very straight forward when using basic data types. With C I never had a problem with the indirection associated with pointers and dereferencing.  Of course, being the pedantic guy I am, I always used parentheses to excess. Anyway, I was working on some code to retrieve as set of fields back from an Omnibus database and the database function returns a reference to an array of arrays.  I only expect 1 row coming back, but I needed a quick way to tell that.  With a little experimentation I found it was: $#$resultsPTR  Sure it is easy now, but I had to run through a few iterations to figure out just what $# wanted to see. Here is a larger code chunk to put things in perspective, hopefully sanitized enough to  be public: #!/usr/bin/perl # # $Id$ # use strict; use warnings; use diagnostics; use POSIX ":sys_wait_h"; use lib "/packages"; requi...

PERL and IPC with one-way pipes

I have a project that I really need to add some parallelism  to increase the speed.  I poked around on the perl.org and managed to cobble together this little bit of code to show how the children worked. This is non-blocking using waitpid. #!/usr/bin/perl # # $Id$ # use strict; use warnings; use diagnostics; use POSIX ":sys_wait_h"; sub main () {     my ($CHILDNUM);     my ($childFhPTR,$FHx, $cPID);     my ($sleeptime,$keepgoing,$nextkid,$linenum,$nextline);     foreach $CHILDNUM ( 0,1,2,3,4 )     {         if ( !defined($cPID = open ($FHx, "-|")) )         {             die "can not spawn child for some reason maybe ($!)";         }                 if ( $cPID == 0 )    ...

Linux Malware?? Windows and Linux are now equal in security!!!!!!

http://www.zdnet.com/blog/bott/linux-infection-proves-windows-malware-monopoly-is-over/2206?tag=content;feature-roto That is right.  This zdnet guy has once an for all proved that M$ is just as secure as Linux.  That's right you read it here, and I completely agree. I mean everyone knows that the 3rd party package in question is a fundamental piece of Linux.  That this freeware IRC server could be compromised 8 months ago and then installed on a Linux box just shows that software can been modified to have a back door.  And clearly this is the same thing as the vendor provided web browser in Microsoft being poorly designed and integrated into the OS in such a tight knit fashion that simple web surfing exploits own the machine. Now that I know this, I'll be stopping by Best Buy on the way home to purchase Windows 7 to replace my Linux installations and finally have the kind of security that I've always dreamed.

Double underline misspellings in Firefox

 Stolen from: http://lifehacker.com/5557424/make-misspellings-stand-out-even-more-in-firefoxs-spell-check?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+lifehacker%2Ffull+%28Lifehacker%29 Enter About:config in the Firefox address bar. If it pops up an alert, tell it that you know what you're doing and proceed. Search for ui.SpellCheckerUnderlineStyle . If you find anything, skip to step 5. If your system is like mine, you found nothing. That means you have to add this configuration value. Right-click the main portion of the window and select New > Integer . Now, enter ui.SpellCheckerUnderlineStyle to create a setting by this name. Now you can set the value of this setting to one of several options: 0 for no highlighting, 1 for a dotted line, 2 for long dots, 3 for a single straight line, 4 for a double underline (like you see above – that's my pick), and 5 for a squiggly line, which is the default.  Cool.  The double lin...

Linux: locate, filenames with apostrophe, and xargs

I'm working on building my new Fedora 13 laptop (Studio XPS 16 which is awesomely fast) Anyway, in trying to de-duplicate a lot of files that I have spread across my old Fedora server and Mac Mini. The worst offenders are my MP3 files that I've downloaded and in many cases imported into iTunes.  So I've been using locate and xargs to compare file sizes and make sure I have 1 good copy of every MP3. Many songs have special punctuation like "'" in them which causes xargs problems.  But since I'm using locate and not find, I had to replace newlines with NULL (\0). Here's a quick little hack for that. locate -i "ring of fire" | perl -e 'while (<STDIN> ) { chomp $_; print $_ . "\0" }' | xargs -0 -I {} ls -l {}

Fedora 13, Gnome, and Window Focus

Newer versions of Gnome seem to lack a quick link to window control.  Namely, window focus.  Blame too many years of twm and X11, because I love the focus to follow the mouse.  I even run xmouse or whatever under winblows. In fedora 13, I installed gconf-editor with yum and then ran the utility. Under /apps/metacity/general there is an option for focus_mode.  Setting it to "mouse" makes the world just a little bit happier.