Articles by Scott Hebert

  1. Empty Strings in Python Are False

    Posted on in Programming

    Recently I was working on some old code. One of my model methods was originally written such that if one parameter was set to the Python None type, a particular set of actions would occur. For some reason, I checked for None like this:

    if parameter is None:
        do something …
  2. The Beauty of Python File-like Objects

    Posted on in Programming

    As I mentioned the other day, I'm building a RADIUS client in Python for sending disconnect messages to Cisco routers.

    One hang-up with the pyrad package is that it requires a dictionary file in order to map RADIUS attribute names to codes and types. In the case of my client …

  3. Cisco Access Registrar: Automatically Clear Old Sessions

    Posted on in System Administration

    While doing some testing with Cisco Access Registrar (CAR) 5.0, I noticed that the test user had hundreds of old sessions hanging around:

    --> query-sessions /r with-User X
    Sessions with-User X for /Radius
      Sessions for /Radius/SessionManagers/session-mgr-1:
        S432 Key: 04000000000CF660, NAS: NAS.slaptijack.com, NAS-Port: 0, User-Name: X, Time …
  4. XenServer 5.6 cdrommon Consumes All CPU Resources

    Posted on in System Administration

    Users of Citrix XenServer 5.6 are experiencing a problem where the cdrommon process begins consuming all CPU resources and affecting virtual machine performance. Using 'top' or 'ps auwx' from dom0 shows that the process is consuming 99% or more CPU resources. Users of Xen Cloud Platform (XCP) 0.5 …

  5. [Python] Remove Whitespace From a String

    Posted on in Programming

    >>> print "".join(" hello   world ".split())
    helloworld
    

    The key to the above is that split() separates the string on any amount of whitespace when no separator is specified.

    python

  6. Engineering Firm Moves Away From VMware

    Posted on in IT Management

    Engineering firm CH2M Hill recently began moving away from VMware ESX to Microsoft's Hyper-V. CH2M Hill has been using VMware technology since 2005, but recently began the push toward Hyper-V in an effort to increase savings through more virtualization. The engineering firm believes it will save over \$280,000 in …

  7. Cisco Access Registrar ODBC Remote Server KeepAliveTimerInterval

    Posted on in Software

    In a test lab, we ran into a situation where the connection between our Cisco Access Registrar (AAA) server and MySQL server was timing out. This forced the server to reconnect and resulted in the following errors:

     name/radius/1 Error Server 0 ODBC client (DataSource 'my_odbc', Connection 8): SQLExecute …
  8. VirtualBox 3.2.8 Released

    Posted on in Software

    VirtualBox LogoOracle's VirtualBox 3.2.8 has been released. This is a maintenance release that mainly focuses on bug fixes rather than new features. Although I don't think the changes in this release are as prolific as the fixes in 3.2.6, it's definitely worth downloading.

    One key feature buried …

  9. MySQL: Query caused different errors on master and slave

    Posted on in System Administration

    We ran across the following error on a MySQL slave server recent:

    mysql> SHOW SLAVE STATUS \G
    <snip>
    Last_Error: Query caused different errors on master and slave. Error on master: 'Deadlock found when trying to get lock; try restarting transaction' (1213), Error on slave: 'no error' (0). Default database: '<database_name …
  10. Listing WordPress Database Queries

    Posted on in Programming

    WordPress Horizontal Logo If you need to debug what queries your WordPress site is making, try adding the following PHP to your theme:

    <?php
      foreach ( $wpdb->queries as $query ) {
        echo "$query[0]<br />";
      }
    ?>
    

    For this code to work, you need to add the following line to wp-config.php:

    define('SAVEQUERIES', true);
    

    After that …

  11. Cisco 7600: Packets Not Reaching SAMI Card

    Posted on in Networking

    The situation: A Cisco 7604 with SAMI card is able to send packets from the individual IOS instances running on the SAMI PPCs, but is unable to receive packets.

    The hardware: The table below describes the hardware involved.

    Part Number Description
    CISCO7604 Cisco 7604 Router
    SUP32-GE-3B Cisco Catalyst 6500 Series …
  12. Gmail Changes Things Up

    Posted on in Software

    Gmail's New Look Notification

    The guys at Google have rolled out a few interface changes for Gmail users. So far, these changes have not been rolled out to Google Apps users.

    New Look

    The Gmail interface has been slimmed down to remove clutter and make it easier to find what you need. The result …

  13. Cisco 7604 with Sup32 and SAMI card

    Posted on in Networking

    Cisco 7604 with Sup32 and SAMI card

    This is a picture (larger) of a Cisco 7604 with Sup32 and SAMI card. The modules you see here are:

    Part Number Description
    CISCO7604 Cisco 7604 Router
    SUP32-GE-3B Cisco Catalyst 6500 Series / Cisco 7600 Series Supervisor Engine 32 with 8 ports Gigabit Ethernet, PFC3B, and MSFC2A
    WS-SVC-SAMI-BB-K9 Cisco …

Slaptijack's Koding Kraken