Archive for February, 2007

Diff and Patch Notes

February 28th, 2007

Useful diff and patch commands:

Create a patch with 3 lines of context and amount of blank lines. I want to see other whitespace difference – it might expose a typo.

diff -u 3 oldfile newfile > patchfile

Use CVS diff to create a patch comparing the local file (newer) with the repository version.

cvs diff -up file > patchfile


Patch a file and create an orig copy (from http://gentoo-wiki.com/MAN_patch_1 ). The -B option allows the prefix for a file – in this case I’ll save it somewhere else as a patched file.

patch -b < patchfile
patch -B /home/user/patched < patchfile

Patch a file you specify

patch file_to_be_patched patchfile

Diff notes
<

# diff -h
usage: man [-c|-f|-k|-w|-tZT device] [-i|-I] [-adlhu7V] [-Mpath] [-Ppager]
           [-Cfile] [-Slist] [-msystem] [-pstring] [-Llocale] [-eextension]
           [section] page ...
-a, --all                   find all matching manual pages.
-d, --debug                 emit debugging messages.
-e, --extension             limit search to extension type `extension'.
-f, --whatis                equivalent to whatis.
-k, --apropos               equivalent to apropos.
-w, --where, --location     print physical location of man page(s).
-W, --where-cat,
    --location-cat          print physical location of cat file(s).
-l, --local-file            interpret `page' argument(s) as local filename(s).
-u, --update                force a cache consistency check.
-i, --ignore-case           look for pages case-insensitively (default).
-I, --match-case            look for pages case-sensitively.
-r, --prompt string         provide the `less' pager with a prompt
-c, --catman                used by catman to reformat out of date cat pages.
-7, --ascii                 display ASCII translation of certain latin1 chars.
-E, --encoding encoding     use the selected nroff device and display in pager.
-t, --troff                 use groff to format pages.
-T, --troff-device device   use groff with selected device.
-H, --html                  use lynx or argument to display html output.
-Z, --ditroff               use groff and force it to produce ditroff.
-X, --gxditview             use groff and display through gditview (X11):
                            -X = -TX75, -X100 = -TX100, -X100-12 = -TX100-12.
-D, --default               reset all options to their default values.
-C, --config-file file      use this user configuration file.
-M, --manpath path          set search path for manual pages to `path'.
-P, --pager pager           use program 'pager' to display output.
-S, --sections list         use colon separated section list.
-m, --systems system        search for man pages from other unix system(s).
-L, --locale locale         define the locale for this particular man search.
-p, --preprocessor string   string indicates which preprocessors to run.
                             e - [n]eqn   p - pic    t - tbl
                             g - grap     r - refer  v - vgrind
-V, --version               show version.
-h, --help                  show this usage message.

Configure Microsoft Outlook for access from home, work, Treo and a laptop

February 21st, 2007

Microsoft outlook is widely used and though it has some caveats, works well with Treo’s and Blackberry’s.

This tutorial will detail the set-up I use with my email and I believe works well. I access and send email from 3 different computers (desktop at home+work, laptop, + Treo 600). The standard Outlook configuration had to be tweaked – and thus this tutorial. Some may have a better way to configure all this – feel free to comment below.

1. Decide on which computer will be the “main” computer. I work primarily as a loan officer, so leaving sensitive docs on an email server for months scares me (as is the case with IMAP).

The main computer:

  • Has Outlook 2000/2003/Latest version installed and working
  • Most emails are sent from this computer.
  • Saved emails are on this computer
  • This is the only computer that can delete emails from my inbox – more on this later.

Once you have chosen the main computer, the rest (including your Treo/Blackberry) will be configured as “client” computers.

2. The other computers, AKA “clients” will be configured to read and send email, but not delete. Its best to have one computer that can do any deletions, this ensures an email is not accidentally deleted or stuck on another computer.

3. Main computer configuration:

  1. Outlook: Tools – E-mail Accounts – Add new email account

  2. Account type: select POP3

    New email account

  3. Enter your account information. The login will be your complete email address, and password is CaSe seNSiTiVe.

    Select server type

  4. Configure your outgoing mail server – if you are on SBC/AT&T DSL, you must use their email server to send email.

    Configure outgoing mail server

  5. This part is what makes the difference – in the “delivery section”, set the radio buttons as shown. This will keep messages on the server until they are deleted or moved to another folder besides “inbox” in Outlook.

    Configure outgoing mail server


4. Client computers – including hand-helds.

There are two methods of retreiving email: POP3 and IMAP.

POP3: Connect, download new messages from the mail server to the computer, then delete the copy on the server (typical setup), then disconnect – do this every 15 minutes or so ” This is old and established way to do email. It is what allows for people to read messages offline since copies of the entire message were downloaded.


IMAP:
Connect and stay connected, get message subject list from the server every few minutes, only view entire message and attachments when its read. Nothing is really downloaded – the message and other email boxes typically stay on the server – like browsing the internet except its your email. Must be connected to read any email. All messages are kept on the server – easier cause its only one inbox to deal with.

These will be configured for either POP3 or IMAP. POP3 settings are the same as above in step 4 except leave the checkbox “remove messages from server when deleted from “deleted items” un-checked.

To configure for IMAP:

  1. Outlook: Tools – E-mail Accounts – Add new email account

  2. Account type: select IMAP

    Select IMAP

  3. Fill in email information – note login is complete email address, and password is CaSe seNSiTiVe

    Select IMAP

  4. in More settings – Advanced tab – not much here, but here it is.

    More settings - IMAP


Follow the IMAP or POP3 set-up for each client. Configuration for Thunderbird, Eudora, Treo email, and other mail programs is similar and here’s what is now set-up:

  • The main computer: check all email and leave a copy on the server
  • The main computer can filter spam and delete messages. When the “deleted items” in Outlook folder is emptied, those emails are removed from the server.
  • Clients and Treo’s – can check and send email, since all mail remains on the server, it can be accessed.
  • If traveling, the messages remain in the inbox, and there is a copy on the main computer (if it was left running). Later, at home boot the main computer, Outlook will upload all messages, and they can be sorted from there. No messages lost – or has happended to me – having the only copy of a message with an attachment stuck on a Treo 600 that can’t send attachments. :(

I have used this set-up for a year and it’s worked well to keep in contact and for a little more work to set-up, saved a lot of trips to the office just to read email.

vtiger – custom webforms with drop down and custom fields

February 7th, 2007

1. create a custom field, say “Loan Purpose” in the Leads module. In my forms, I’ll call this “loanpurpose”
2. Using phpmyadmin, browse to the Table: vtiger_leadscf
3. Look at the custom field name for the field in question – mine was called cf_453 This is the field name to be used in webforms.php
4. The name cf_453 only needs to be used in webforms.php, for the other files, call it something friendly – here I used loanpurpose.
5. assign like this:

index.php: add the field name loanpurpose to the line starting with: function create_lead_from_webform
In my implementation, used a drop down list in the form like this:

<tr><th>Loan Purpose:</th>
     <td><select name="loanpurpose">
     <option value="Purchase">Purchase</option>
     <option value="Refi - Rate,Term">Refi - Rate,Term</option>
     <option value="Refi - Cash-out">Refi - Cash-out</option>
     <option value="Second">Second</option>
     <option value="Other">Other</option>
     </select></td>
     </tr>

send_data.php: add the line(s) for the new field

'loanpurpose'=>"$loanpurpose"

webforms.php: Add in both places:

if($_REQUEST['create'] == 'lead') function:
     $loanpurpose = $_POST['loanpurpose'];

and at

$params = array(
     $focus->column_fields['cf_453'] = $loanpurpose; *<-- this is where the new form value gets mapped to the custom field ID.*

Any errors encountered will be from typo's, missing "." or "," after the new field entries, wrong field names or a missing addition - look for where the other fields are passed and that is the best start for troubleshooting.


Mochabomb is Digg proof thanks to caching by WP Super Cache