Posts

Finding RPMs from a particular day

I ran into problem where a vendor wanted to know all of the patches that installed via RPM to their appliance for a given day. RPM stores that info but I didn't know how to access it easily.  There is probably an easier way to do this, but I put the following command line together and it seems to work: rpm -qai | egrep -3 "Mon 20 Sep|Tue 21 Sep" | egrep "^Name|^Install Date" | sed -e 's/Relocations:.*$//' | sed -e 's/Build Host.*$//' | sed -e 's/   */ /g' | perl -e 'while (defined($line1= )) { $line2 = ; chomp ($line1); chomp ($line2); print "$line1\t\t$line2\n";}' | sort Fun times.

poor man's winblows cygwin sshd

Stuck with winblows on the desktop.  Downloaded an ISO from a vendor and needed to copy to an appliance.  But security is tight except for stuff initiated from the appliance.  Quickest solution was to run SSHD under cygwin: ssh-keygen -t rsa -f /etc/ssh_host_rsa_key ssh-keygen -t dsa -f /etc/ssh_host_dsa_key vi /etc/defaults/etc/sshd_config --- sshd_config.orig    2010-09-02 13:30:23.690702700 -0500 +++ sshd_config 2010-09-02 13:24:02.021270400 -0500 @@ -94,6 +94,7 @@  #TCPKeepAlive yes  #UseLogin no  #UsePrivilegeSeparation yes +UsePrivilegeSeparation no  #PermitUserEnvironment no  #Compression delayed  #ClientAliveInterval 0 /usr/sbin/sshd -f /etc/defaults/etc/sshd_config -d

Fun with Fedora

I've been working at a company for a little over 2 years now that is a microsoft sycophant company.  When it doesn't use microsoft, it uses the biggest, least agile vendor it can find. I didn't realize how much working with microsoft killed my computer interest.  In the past few weeks I've been working on upgrading and redesigning my home systems.  I had a fairly archaic Fedora Core 9 home server which I rarely used except to run Alpine on (to report my spam easily.)  I've decided it is time to go massively virtual. I built a new VirtualBox virtual machine on my laptop.  I migrated the FC9 box from a standalone server to the VM (not that hard really, just some dump/restore actions and voila.) The new task is to create a new FC13 box as the host OS.  Build a couple of VMs under it with different functions.  I should be able to upgrade the host OS and guest OSs on a different schedule and that should make keeping up with updates and new releases ea...

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.