Securing SSHD Root access

How To Secure SSH Root Access: originally posted at [sagonet.com)[http://forums.sagonet.com/showthread.php?t=1820] and reposted here for my own archives.

This article describes how to secure root access via SSH. The information in this article applies to both cPanel, and Interworx based server.

<

p> Read the rest of this entry »

Comments

Printing to Windows from Mac OSX 10.4

Everytime I change my network password, I have to reset the printer password when printing to my windows network. Needless to say, I forget the few steps it takes every time. So here’s a reminder for myself:

  1. Open up the printer setup utility and click “ADD”
  2. Hold down the “OPTION” key while clicking the “More printers…” button on the bottom. This is the most important step. Without clicking on the “OPTION” key the “Advanced” option in the next step doesn’t show up and the normal windows printing via network neighborhood doesn’t work for me.
  3. From the top combo-box, choose the “Advanced” option.
  4. Choose “Windows Printer Via SAMBA” from the device pop-up menu.
  5. Enter your device name into the appropriate textbox.
  6. Enter the URI to the device using the syntax “smb://ServerName/ShareName. Note that you may have to add the username and password in the urll as I did. For that, the syntax is “smb://<username>:<password>@domain/<server>/<share>”
  7. Pick the printer model from the printer model pop-up menu

Of course, you’ll need the appropriate drivers, etc.

Comments

Returning a RECORD from PL/pgsql

Been a while since I posted, but here’s a nice tip that I had to figure out the hard way.

Problem - Using a function in INOUT and OUT parameters to pass information back to another function. This is function I needed to return data from.

 CREATE OR REPLACE FUNCTION vx_string.get_next_token(p_delimiter IN varchar,
      p_text INOUT varchar, p_return OUT varchar) RETURNS RECORD AS $BODY$
     DECLARE
          v_position   INTEGER;
    BEGIN
        -- Find position of delimiter.
        v_position := vx_utils.instr(p_text,p_delimiter, 1);
       IF v_position > 0 THEN
           p_return := SUBSTR(p_text, 1, v_position - 1);
           p_text := SUBSTR(p_text, v_position + LENGTH(p_delimiter));
       ELSE
           p_return := p_text;
           p_text := '';
       END IF;
       RETURN p_text, p_return;
    END;
    $BODY$
    LANGUAGE 'plpgsql' VOLATILE;

Solution - In order to return the values I found I needed to SELECT the values INTO specific vars using the SELECT * INTO …. syntax as follows:


    DECLARE
        v_line TEXT;
        v_temp TEXT;
    BEGIN
       -- notice we only pass in the first two vars since they
       -- are IN and INOUT respectfully. They OUT parameter is only used
       -- in the returning record.
       SELECT *
       INTO v_line, v_temp
       FROM
       vx_string.get_next_token(';','0001; My Test Line; My Test Line; My Test Line');
       -- at this point, v_line equals "My Test Line; My Test Line; My Test Line"
       -- and v_temp equals "0001"
       -- Now, I can use v_line and v_temp within this procedure
       v_line_nbr = TO_NUMBER(v_temp,'99999');

Comments

« Previous entries ·