Sponsored Content
The Lounge What is on Your Mind? Temporarily Disabled MySQL Update for Man Pages Post 303040464 by Neo on Wednesday 30th of October 2019 12:46:30 AM
Old 10-30-2019
If anyone (Akshay when back from vacation?) can improve this, please suggest something:

Code:
<?php

function updateDB($os, $section, $query, $text, $raw = '')
{
    global $vbulletin;
    $dateline = time();
    $string = substr($text, 0, 20);
    $snippet = trim(preg_replace('/\s+/', ' ', $string));
    $token = $os . '_' . $section . '_' . $query;
    if (strlen($token) >= 1) {
        $sql = 'INSERT INTO neo_man_page_entry
        (os, section, query, text, formatted,  token, strlen, dateline )
    VALUES
        ("' .
        htmlentities($os, ENT_QUOTES) . '","' .
        htmlentities($section, ENT_QUOTES) . '","' .
        htmlentities($query, ENT_QUOTES) . '","' .
        htmlentities($text, ENT_QUOTES) . '","' .
        htmlentities($raw, ENT_QUOTES) . '","' .
        htmlentities($token, ENT_QUOTES) . '",' .
        strlen($raw) . ',' .
            $dateline . ')
    ON DUPLICATE KEY UPDATE
        dateline = ' . $dateline . ',hits = hits +1';
        $status = $vbulletin->db->query_write($sql);
        return $status;

    } else {
        $file = '/var/log/apache2/debug/neo_update_mandb_entry_error.log';
        $uid = $vbulletin->userinfo['userid'];
        $text = $raw = "unknown";
        error_log(date(DATE_RFC822) . " UID " . $uid . ' token ' . $token . ' len ' . strlen($text) . ' snip ' . $snippet . "\n", 3, $file);
        return -1;
    }

}


and:


Code:
mysql> describe neo_man_page_entry;
+-----------+------------------+------+-----+---------+----------------+
| Field     | Type             | Null | Key | Default | Extra          |
+-----------+------------------+------+-----+---------+----------------+
| manid     | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| token     | varchar(120)     | NO   | UNI | NULL    |                |
| dateline  | int(11) unsigned | NO   |     | NULL    |                |
| os        | varchar(16)      | NO   | MUL | NULL    |                |
| section   | varchar(8)       | NO   |     | NULL    |                |
| query     | varchar(64)      | NO   | MUL | NULL    |                |
| text      | mediumtext       | NO   | MUL | NULL    |                |
| formatted | mediumtext       | NO   |     | NULL    |                |
| strlen    | int(10) unsigned | NO   |     | 0       |                |
| hits      | int(10) unsigned | NO   |     | 1       |                |
+-----------+------------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)

 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Man pages

Hello , I just installed openssh in my system . I actually tried to man sshd but it says no entry , though there is a man directory in the installation which have the man pages for sshd . Can anyone tell me how should i install these man pages . DP (2 Replies)
Discussion started by: DPAI
2 Replies

2. UNIX for Dummies Questions & Answers

man pages

Hi, I've written now a man pages, but I don't knwo how to get 'man' to view them. Where have I to put this files, which directories are allowed?? THX Bensky (3 Replies)
Discussion started by: bensky
3 Replies

3. Programming

Man pages for C API for MySql

Hi, I am on Ubuntu 9.04 tweaking some programs demanding MySql queries. I got the program working by installing following package: sudo apt-get install libmysqlclient-dev and using proper include and library folder However I was unable to access any man pages for these C api's (Strangely... (1 Reply)
Discussion started by: dheerajsuthar
1 Replies

4. HP-UX

Looking for some man pages.

Can anyone supply me with the man pages for: omnidatalist omnibarlist omnisap.exe I prefer the source man pages in nroff format. A clue about the software bundles which supply these man pages is fine as well. OS: HP-UX TIA (11 Replies)
Discussion started by: sb008
11 Replies
vacation(1)							   User Manuals 						       vacation(1)

NAME
vacation - reply to mail automatically SYNOPSIS
vacation [ -I | -i | -l ] [ -F ] vacation [ -j ] [ -a alias ] [ -f file ] [ -tN ] [ -r ] [ -? ] username DESCRIPTION
vacation automatically replies to incoming mail. The reply is contained in the file .vacation.msg in your home directory. The vacation program run interactively will create and/or edit a .vacation.msg file in your home directory. The old .vacation.msg will be backed up to .vacation.old file. Type vacation with no arguments. (See USAGE below.) For example, the message created by vacation is: Subject: away from my mail From: smith (via the vacation program) I will not be reading my mail for a while. Your mail regarding "$SUBJECT" will be read when I return. The .vacation.msg file should include a header with at least a `Subject:' line (it should not contain a `To:' line and need not contain a `From:' line, since these are generated automatically). The fields `From', `From:' and `Reply-To:' are evaluated in the following order: If there is a `Reply-To:', and the option -r is given, then its entry is accepted. Otherwise, the entry of the `From:' field is taken. Should this entry lack a complete domain address (e.g. user@site instead of user@site.domain), vacation evaluates the `From' field, converting the contained UUCP bang path into a domain style address. If this fails too, vacation gives up. If the string $SUBJECT appears in the .vacation.msg file, it is replaced with the subject of the original message when the reply is sent. No message is sent if the `To:' or the `Cc:' line does not list the user to whom the original message was sent or one of a number of aliases for them, if the initial From line includes one of the strings -request@, postmaster, uucp, mailer-daemon, mailer or -relay or if a `Precedence: bulk' or `Precedence: junk' or `Precedence: list' line is included in the header. The search for special senders is made case- independant. OPTIONS
-I Or -i initialize the .vacation.db file and start vacation. This should only be used on the command line, not in the .forward file. -F Force creation of .vacation.db even if the $HOME directory is identified as a NFS file system. Please note that the used data base is not portable between 32bit and 64bit architectures and also not portable between little and big endianess architectures even same bit-wide is used for. Therefore the initial creation of the .vacation.db should always happen on the server used for receiving mails for the specific user. -l List the content of the vacation database file including the address and the associated time of the last auto-response to that address. This should only be used on the command line, not in the .forward file. If the -I, -i or -l flag is not specified, and a user argument is given, vacation reads the first line from the standard input (for a `From:' line, no colon). If absent, it produces an error message. The following options may be specified: -a alias Indicate that alias is one of the valid aliases for the user running vacation, so that mail addressed to that alias generates a reply. -j Do not check whether the recipient appears in the `To:' or the `Cc:' line. Reply always. -tN Change the interval between repeat replies to the same sender. N is the number of days between replies. Default is one week. -r If there is a `Reply-To:' header, send the automatic reply to the address given there. Otherwise, use the `From:' entry. -f <file> use a different message file than the default, .vacation.msg . The path to this file is relative to the home directory of the user. -? issue short usage line. USAGE
The vacation, create a .forward file in your home directory containing a line of the form: username, "|/usr/bin/vacation username" where username is your login name. The original .forward will be backed up to .forward.old file. Then type in the command: vacation -I To stop vacation, remove the .forward file, or move it to a new name. If vacation is run with no arguments, it will create a new .vacation.msg file for you, using the editor specified by the VISUAL or EDITOR environment variable, or vi(1) if neither of those environment variables are set. If a .forward file is not present in your home direc- tory, it creates it for you, and automatically performs a `vacation -I' function, turning on vacation. FILES
$HOME/.forward $HOME/.vacation.msg A list of senders is kept in the file .vacation.db in your home directory. SEE ALSO
vi(1), sendmail(8) AUTHOR
vacation is Copyright (c) 1983 by Eric P. Allman, University of Berkeley, California, and Copyright (c) 1993 by Harald Milz (hm@seneca.ix.de). Tiny patches 1998 by Mark Seuffert (moak@pirate.de). Now maintained by Sean Rima (thecivvie@softhome.net) 3rd Berkeley Distribution March 2000 vacation(1)
All times are GMT -4. The time now is 04:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy