Voterbox

Ruby: Get rid of "warning: peer certificate won't be verified in this SSL session"



Anyone who has written ruby cli apps that utilize SSL know that you get the following, most annoying message:

warning: peer certificate won't be verified in this SSL session



The work around is quite simple... just add the following the the top of one of the file you're loading:

class Net::HTTP
  alias_method :old_initialize, :initialize
  def initialize(*args)
    old_initialize(*args)
    @ssl_context = OpenSSL::SSL::SSLContext.new
    @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
  end
end



Done.



Rip Audio From Quicktime without Quicktime Pro

So I came across a Quicktime video today that I really wanted to use the audio track from. However, I came to find out that getting the audio track from a .mov isn't an easy task if you do not have Quicktime Pro.

If you do have Quicktime Pro... then you can simply just export the audio track. However, without it you can't... and here is how I got around the issue:

Ruby: rb-parseconfig 0.4.2 Available!

Check out the latest version of rb-parseconfig, a Ruby library that allows you to easily work with standard *nix style config files!

Release Name: 0.4.2

Notes:

This update is a bugfix only release.

The latest version of rb-parseconfig-0.4.2 fixes two significant bugs in the way config values are parsed. It is recommended to upgrade to the latest release due to the potential for inconsistent results in previous versions.

Changes:

Thu Feb 28, 2008 - v0.4.2

Puppet: Distributed System Administration

Puppet is a system for automating system administration tasks. To learn more about Puppet, please go to their site:

http://reductivelabs.com/trac/puppet



This article will be an outline of the installation and basic configuration of Puppet for both server and clients.



Project Updates

There have been a few release updates for some of the projects I work on:

pLsearch - Version 0.1.9
- No longer require Getopt::Long.
- Check file type, and skip opening of binary files. (Currently a bit buggy as it considers empty files as binary).
- Cleaned up options just a tad.

Python Dual Output / Logging

Summary

This article talks about setting up the Python Logger to easily provide dual output logging to console and a log file. In many ways, this is very much like the Ruby Dual Output / Logging article I wrote not long ago.

Python logging is not a difficult process, however it did take some digging around to get it to work the way I really wanted it to.

Perl: Command Line Options Without GetOpt::Std

Summary:

At times you may need to write a script that needs to be completely portable. Meaning, you can't rely on modules that may not be included stock with the operating system.

On Redhat, GetOpt::Std is not included in the stock installation (at least not where I work). Therefore, I needed just a quick and simple way to parse command line options into the script.

The following is an example 'test.pl' of how I did this:


#!/usr/bin/perl -w

use strict;

my $ip_address;
my $mac_address;
my $hostname;
my $debug = 0;

# Sort the options

VMWare 64bit - Can not obtain DHCP Lease on reboot

The issue arises on a 64bit VMWare guest, using the e1000 NIC that on a soft reboot you are unable to obtain a DHCP Lease and PXE boot.

The following fixes the issue in the virtual machines .vmx file:

ethernet0.allow64bitVlance="TRUE"
ethernet0.virtualDev = "vlance"

Thank you, come again.

NoLoveFromGoogle: PHP exif_read_data Returns a Single Character with WINXP Array

Interesting issue this week. Using the exif methods to read WINXP data returns unexpected results unless both exif and mbstring are compiled statically.

The exif_read_data function with WINXP data from a Jpeg image only returns a single character for each item in the array. Digging around on bugs.php.net came up with several instances of the bug over the last 5 years. Please reference the following bug reports:

Bug #31980
Bug #23105

Ruby Dual Output / Logging

Summary:

Logging in Ruby is a fairly straight forward process, however I came across an interesting issue. I found that I was constantly doing both a 'log' statement, as well as a 'puts' statement to output to console. Well, this clutters code especially once your script turns into a multi-layered application. Additionally, most of the time what I am logging is the same thing I want to output to console.

In walks Log4r.

Syndicate content

All content generally available under the GPL unless otherwise noted.
5dollarwhitebox.org is not responsible in anyway for actions performed based on information found on this site.

Powered by Drupal - Design by Artinet