• Home

  • Custom Ecommerce
  • Application Development
  • Database Consulting
  • Cloud Hosting
  • Systems Integration
  • Legacy Business Systems
  • Security & Compliance
  • GIS

  • Expertise

  • About Us
  • Our Team
  • Clients
  • Blog
  • Careers

  • VisionPort

  • Contact
  • Protecting and auditing your secure PostgreSQL data

    Greg Sabino Mullane

    By Greg Sabino Mullane
    January 30, 2012

    PostgreSQL functions can be written in many languages. These languages fall into two categories, ’trusted’ and ‘untrusted’. Trusted languages cannot do things “outside of the database”, such as writing to local files, opening sockets, sending email, connecting to other systems, etc. Two such languages are PL/pgSQL and and PL/Perl. For “untrusted” languages, such as PL/PerlU, all bets are off, and they have no limitations placed on what they can do. Untrusted languages can be very powerful, and sometimes dangerous.

    One of the reasons untrusted languages can be considered dangerous is that they can cause side effects outside of the normal transactional flow that cannot be rolled back. If your function writes to local disk, and the transaction then rolls back, the changes on disk are still there. Working around this is extremely difficult, as there is no way to detect when a transaction has rolled back at the level where you could, for example, undo your local disk changes.

    However, there are times when this effect can be very useful. For example, in an email thread on the PostgreSQL “general” mailing list (aka …


    audit database perl postgres security

    Linux unshare -m for per-process private filesystem mount points

    Jon Jensen

    By Jon Jensen
    January 27, 2012

    Private mount points with unshare

    Linux offers some pretty interesting features that are either new, borrowed, obscure, experimental, or any combination of those qualities. One such feature that is interesting is the unshare() function, which the unshare(2) man page says “allows a process to disassociate parts of its execution context that are currently being shared with other processes. Part of the execution context, such as the mount namespace, is shared implicitly when a new process is created using fork(2) or vfork(2)”.

    I’m going to talk here about one option to unshare: per-process private filesystem mount points, also described as mount namespaces. This Linux kernel feature has been around for a few years and is easily accessible in the userland command unshare(1) in util-linux-ng 2.17 or newer (which is now simply util-linux again without the “ng” distinction because the fork took over mainline development).

    Running unshare -m gives the calling process a private copy of its mount namespace, and also unshares file system attributes so that it no longer shares its root directory, current directory, or umask attributes with any other process.

    Yes, completely private …


    debian linux redhat security sysadmin ubuntu

    Our SoftLayer API tools

    Jon Jensen

    By Jon Jensen
    January 23, 2012

    We do a lot of our hosting at SoftLayer, which seems to be one of the hosts with the most servers in the world – they claim to have over 100,000 servers as of last month. More important for us than sheer size are many other fine attributes that SoftLayer has, in no particular order:

    • a strong track record of reliability
    • responsive support
    • datacenters around the U.S. and some in Europe and Asia
    • solid power backup
    • well-connected redundant networks with multiple 10 Gbps uplinks
    • gigabit Ethernet pipes all the way to the Internet
    • first-class IPv6 support
    • an internal private network with no data transfer charge
    • Red Hat Enterprise Linux offered at no extra charge
    • diverse dedicated server offerings at many price & performance points
    • some disk partitioning options (though more flexibility here would be nice, especially with LVM for the /boot and / filesystems)
    • fully automated provisioning, without salesman & quote hassles for standard offerings
    • 3000 GB data transfer per month included standard with most servers
    • month-to-month contracts
    • reasonable prices (though we can of course always use lower prices, we’ll take quality over cheapness for most of our hosting needs!)
    • no …

    hosting networking open-source sysadmin api

    MySQL replication monitoring on Ubuntu 10.04 with Nagios and NRPE

    Brian Buchalter

    By Brian Buchalter
    January 21, 2012

    If you’re using MySQL replication, then you’re probably counting on it for some fairly important need. Monitoring via something like Nagios is generally considered a best practice. This article assumes you’ve already got your Nagios server setup and your intention is to add a Ubuntu 10.04 NRPE client. This article also assumes the Ubuntu 10.04 NRPE client is your MySQL replication master, not the slave. The OS of the slave does not matter.

    Getting the Nagios NRPE client setup on Ubuntu 10.04

    At first it wasn’t clear what packages would be appropriate packages to install. I was initially misled by the naming of the nrpe package, but I found the correct packages to be:

    sudo apt-get install nagios-nrpe-server nagios-plugins

    The NRPE configuration is stored in /etc/nagios/nrpe.cfg, while the plugins are installed in /usr/lib/nagios/plugins/ (or lib64). The installation of this package will also create a user nagios which does not have login permissions. After the packages are installed the first step is to make sure that /etc/nagios/nrpe.cfg has some basic configuration.

    Make sure you note the server port (defaults to 5666) and open it on any firewalls …


    hosting monitoring mysql ubuntu

    Importing Data with RailsAdmin

    Steph Skardal

    By Steph Skardal
    January 19, 2012

    Update #1: Read an update to this functionality here.

    Update #2: This article was written in January of 2012, and the code related to the RailsAdmin actions no longer applies to the current release. Please make sure to read the RailsAdmin documentation regarding current action implementation.

    I’ve blogged about RailsAdmin a few times lately. I’ve now used it for several projects, and have included it as a based for the Admin interface my recent released Ruby on Rails Ecommerce Engine (Piggybak). One thing that I found lacking in RailsAdmin is the ability to import data. However, it has come up in the RailsAdmin Google Group and it may be examined in the future. One problem with developing import functionality is that it’s tightly coupled to the data and application logic, so building out generic import functionality may need more thought to allow for elegant extensibility.

    For a recent ecommerce project using RailsAdmin and Piggybak, I was required to build out import functionality. The client preferred this method to writing a simple migration to migrate their data from a legacy app to the new app, because this import functionality would be reusable in the …


    ecommerce ruby rails

    Using Disqus and Ruby on Rails

    Brian Buchalter

    By Brian Buchalter
    January 14, 2012

    Recently, I posted about how to import comments from a Ruby on Rails app to Disqus. This is a follow up to that post where I outline the implementation of Disqus in a Ruby on Rails site. Disqus provides what it calls Universal Code which can be added to any site. This universal code is just JavaScript, which asynchronously loads the Disqus thread based on one of two unique identifiers Disqus uses.

    Disqus in a development environment

    Before we get started, I’d recommend that you have two Disqus “sites”; one for development and one for production. This will allow you to see real content and experiment with how things will really behave once you’re in production. Ideally, your development server would be publicly accessible to allow you to fully use the Disqus moderation interface, but it isn’t required. Simply register another Disqus site, and make sure that you have your shortname configured by environment. Feel free to use whatever method you prefer for defining these kinds of application preferences. If you’re looking for an easy way, considering checking out my article on Working with Constants in Ruby. It might look something like this:

    # app/models/article.rb
    
    DISQUS_SHORTNAME …

    javascript rails

    ActiveRecord Callbacks for Order Processing in Ecommerce Applications

    Steph Skardal

    By Steph Skardal
    January 13, 2012

    As I recently blogged about, I introduced a new Ruby on Rails Ecommerce Engine. The gem relies on RailsAdmin, a Ruby on Rails engine that provides a nice interface for managing data. Because the RailsAdmin gem drives order creation on the backend in the context of a standard but configurable CRUD interface, and because I didn’t want to hack at the RailsAdmin controllers, much of the order processing logic leverages ActiveRecord callbacks for processing. In this blog article, I’ll cover the process that happens when an order is saved.

    Order Data Model

    The first thing to note is the data model and the use of nested attributes. Here’s how the order model relates to its associated models:

    class Order < ActiveRecord::Base
      has_many :line_items, :inverse_of => :order
      has_many :payments, :inverse_of => :order
      has_many :shipments, :inverse_of => :order
      has_many :credits, :inverse_of => :order
    
      belongs_to :billing_address, :class_name => "Piggybak::Address"
      belongs_to :shipping_address, :class_name => "Piggybak::Address"
      belongs_to :user
      
      accepts_nested_attributes_for :billing_address, :allow_destroy => true …

    ecommerce open-source piggybak rails

    Interchange loops using DBI Slice

    Richard Templet

    By Richard Templet
    January 13, 2012

    One day I was reading through the documentation on search.cpan.org for the DBI module and ran across an attribute that you can use with selectall_arrayref() that creates the proper data structure to be used with Interchange’s object.mv_results loop attribute. The attribute is called Slice which causes selectall_arrayref() to return an array of hashrefs instead of an array of arrays. To use this you have to be working in global Perl modules as Safe.pm will not let you use the selectall_arrayref() method.

    An example of what you could use this for is an easy way to generate a list of items in the same category. Inside the module, you would do like this:

    my $results = $dbh->selectall_arrayref(
      q{
        SELECT
          sku,
          description,
          price,
          thumb,
          category, 
          prod_group
        FROM
          products
        WHERE
          category = ?},
      { Slice => {} }, 
      $category
    );
    $::Tag->tmpn("product_list", $results);

    In the actual HTML page, you would do this:

    <table cellpadding=0 cellspacing=2 border=1>
    <tr>
      <th>Image</th>
      <th>Description</th>
      <th>Product Group</th>
      <th>Category</th> …

    database interchange perl
    Previous page • Page 154 of 222 • Next page