CHANGED: does no more use the external touch command to create a new

file, use perls open() instead.
CHANGED:        excluded some of the help texts from the usage message and the
                interactive help command to a manpage.
ADDED:          new commandline flag "--encrypt" which one can use to encrypt
                the mysql database password. This will be decrypted before
                connecting to the db. There is also a new config file option
                "encrypt_passwd" which indicates an encrypted db-password.
ADDED:          another new config option "ShortCd", which can be set to "yes"
                or 1 and if set, then a command like "cd 13" would jump
                directly to the topic of the note with the number 13.
ADDED:          now you can at any time cd back to the "root" of the
                topic-structure using the command "cd /".
CHANGED:        mysql.pm does now only do a table-lock on single write
                accesses, no more on the whole session. This allows one to
                access the same db twice or more.
FIXED:          Changed README and Changelog for readability on 80 by 25
                displays. And changed indentation of the note script itself.
ADDED:          NOTEDB.pm - a generic module, which holds some methods, which
                are used by binary.pm, mysql.pm and dbm.pm.
ADDED:          NOTEDB.pm generate_search(), which allows one to
                use AND, OR and various combinations of them using ( and ).
ADDED:          a search does now return the 2nd line of a note if a matching
                note's first line is a topic.
CHANGED:        use "unshift" instead of push to add $libpath to @INC.
ADDED:          a new feature, Caching of notes. supported by binary.pm and
                mysql.pm. To turn it on, one need to set "Cache" in the config
                to a true value.
This commit is contained in:
TLINDEN
2012-02-10 20:22:49 +01:00
parent 788902c69d
commit 9cf564ffe4
67 changed files with 6310 additions and 1604 deletions

191
README
View File

@@ -1,4 +1,4 @@
note 1.0.8 by Thomas Linden, 11/07/2000
note 1.0.9 by Thomas Linden, 08/08/2000
=======================================
Introduction
@@ -72,8 +72,11 @@ Features
stdin as well es duming to stdout instead a file. Additional, there
is an option --raw available, which prints everything out completely
without formatting.
o for better performance, note can cache the database for listings
or searching.
o It can be installed without root-privileges.
o Last, a while ago a user stated: "... it simply does, what it says ..."
o Last, a while ago a user stated: "... it simply does, what it
says ..."
@@ -189,6 +192,18 @@ Usage
note will search the whole note database case insensitive for
an occurence of this string and tell you the number and first-
line it have.
You can extend the searchstring using B<AND>, B<OR> ( and ) and
shell-like wildcards:
$ note -s "moses AND lenin"
or:
$ note -s "(mike OR arnold) AND (jackson OR schwarzenegger)"
If note finds a note, which first line is a topic, then it will
display it's second line.
These rules apply for the interactive search too.
Instead of using note from the commandline you can use the
interactive mode. Run note with "note -i". If you need assistance
@@ -212,10 +227,10 @@ Usage
o "note -D -" creates a note-database dump and prints it out
to stantdard output.
o "|" this is the shell's pipe command. It takes the output
of the left program and gives it to the right program as standard
input.
o "note -o -I -" imports a note-database dump from standard input
and overwrites an existing database.
of the left program and gives it to the right program as
standard input.
o "note -o -I -" imports a note-database dump from standard
input and overwrites an existing database.
Before you use the "-o" switch, I consider yuo to make a backup!
@@ -229,8 +244,9 @@ Topics
field for the topic. Instead the topic will be stored right in the
note.
If the first line of your note contains some text bordered by slashes
(or whatever you prefer, set "TopicSeparator" in your config! default is slash),
then note will consider it as the topic of this certain note. For examle:
(or whatever you prefer, set "TopicSeparator" in your config! default
is slash), then note will consider it as the topic of this certain
note. For examle:
/TodoList/
If you are using topics, no data after the topic is allowed, if there
is any text, note will consider it as a subtopic! Therefore, don't for-
@@ -239,17 +255,24 @@ Topics
If you are in interactive mode, you can "cd" to a different note simply
by typing it's name at the command-prompt, or you can use the well-known
syntax "cd topic".
The list-command will only show you notes under this topic. If you create
a new note, it will automagically inserted under the current topic (note
will prepend the string "/topicname/" to the text of your note).
The list-command will only show you notes under this topic. If you
create a new note, it will automagically inserted under the current
topic (note will prepend the string "/topicname/" to the text of your
note).
You can use some enhanced capabilities of the cd command. If you turn on
the "ShortCd" parameter in your configuration, then you can cd to a
note number (and thus - to it's topic) i.e. "cd 13" jumps to the topic
of the note number 13. You can always go one level up using the "cd .."
command and you can go to the top-level topic using "cd /".
You can create at any time from any point a new topic. Just create a new
note and type the name of the new topic bordered by slashes (or TopicSeparator)
at the first line of this note. After saving, there will be available a
new topic with one note in it.
note and type the name of the new topic bordered by slashes (or
TopicSeparator) at the first line of this note. After saving, there
will be available a new topic with one note in it.
You can create as many subtopics as you like, the format is similar to a
filesystem-path. An example, say, you want to create such a structure:
You can create as many subtopics as you like, the format is similar to
a filesystem-path. An example, say, you want to create such a
structure:
(root - top level)
|
@@ -281,14 +304,15 @@ Topics
If a note does not contain the "magic" /topic/ construction on the first
line, it will be listed under the "root" of note, that is the point you are
at the startup of note.
line, it will be listed under the "root" of note, that is the point
you are at the startup of note.
You can subsequently move a note without a topic to a certain topic. Simply
edit it and insert at the first line the above mentioned construction.
You can subsequently move a note without a topic to a certain topic.
Simply edit it and insert at the first line the above mentioned
construction.
Note: Please don't forget the prepending and appending a slash of a topic.
You will get strange results without it!
Note: Please don't forget the prepending and appending a slash of a
topic. You will get strange results without it!
@@ -296,22 +320,22 @@ Topics
Formatting of notes
===================
Another very nice feature is the possibility to format the note-text (as much as
shell allows it). First, you can use the note-internal "magic-strings" for color-
izing. Those strings looks much like HTML:
Another very nice feature is the possibility to format the note-text
(as much as shell allows it). First, you can use the note-internal
"magic-strings" for colorizing. Those strings looks much like HTML:
"<green>here is a green line of text</green> no more green."
As you see, the beginning of another color starts with a tag(kinda) of the color
<colorname> and ens with an end tag </colorname>.
As you see, the beginning of another color starts with a tag(kinda) of
the color <colorname> and ens with an end tag </colorname>.
The following colors are available:
black, red, green, yellow, blue, magenta, cyan and white.
Beside colorizing text, you can also create bold or underlined text! If you decide
to use this (additional) feature, you need to set the Config-Option "FormatNotes"
to 1 which turns it on.
Usage is very straightforward, if a word (a word is defined as some text with at least
one space surrounded) is between a magic mark-character. Here are the available
things, you can do:
Beside colorizing text, you can also create bold or underlined text! If
you decide to use this (additional) feature, you need to set the
Config-Option "FormatNotes" to 1 which turns it on.
Usage is very straightforward, if a word (a word is defined as some
text with at least one space surrounded) is between a magic mark-
character. Here are the available things, you can do:
bold: **word**
underlined: __word__
@@ -322,30 +346,54 @@ Formatting of notes
Cache
=====
If you have many notes stored in your database then you might
find the cache feature useful. Chaching is currently supported
by the binary and the mysql backend. Set the configuration
parameter "Cache" to "1" or "yes" to turn caching on.
Note will then use an internal copy of your notes-database for
the list/search/tree commands instead of every time accessing
the physically database. If something changed (i.e. you edited
a note or added a new one) then the database will be used and
the cache will be updated.
A "%" character at the top left of the screen indicates that
the cache is in use.
I consider you not to use the cache feature if you are using
multiple instances of note using the same database.
The cache is turned off by default.
Scripting
=========
Since version 1.0.3 there are some additions which allows you to use note in
scripts, without user-interaction. You might run a special script as cronjob,
which adds a note under a certain topic every week. Or the like.
Since version 1.0.3 there are some additions which allows you to use
note in scripts, without user-interaction. You might run a special
script as cronjob, which adds a note under a certain topic every week.
Or the like.
Here are the possibilies you have:
You can add a new note through a pipe, another commands output becomes
note's input:
$ cat /var/spool/news/daily | note -
This command adds the content of a file "daily" as a new note. Note the dash.
it stands for "Standard Input". Note will be completely silent and it will not
ask for something.
This command adds the content of a file "daily" as a new note. Note
the dash - it stands for "Standard Input". Note will be completely
silent and it will not ask for something.
Suppose you are using encryption. You might wonder, how note will get your
passphrase? The solution: You need to set up an environment variable which
contains the password:
Suppose you are using encryption. You might wonder, how note will get
your passphrase? The solution: You need to set up an environment
variable which contains the password:
$ export NOTE_PASSWD=secret
If the variable is present, note will not ask you for a passphrase!
Another thingy you might find useful is the -r (--raw) command-line flag. This
turns note into raw mode , which means it will only print the
Another thingy you might find useful is the -r (--raw) command-line
flag. This turns note into raw mode , which means it will only print the
data without any formatting. Raw mode is available for list and display,
since it makes no sense, interactive mode doe not support raw mode.
@@ -356,8 +404,8 @@ Scripting
Format of the notedb (binary backend)
=====================================
The database where the notes are stored is a binary fixed record length file
of the following format:
The database where the notes are stored is a binary fixed record length
file of the following format:
It consists of three fixed length fields per entry. The fields
have the following types:
o Number: Integer (1 byte)
@@ -440,6 +488,20 @@ Security
After turning on encryption, note will ask you for a passphrase
everytime it runs! It will *not* store this passphrase!
So, don't forget it! Be careful!
If you are using the mysql backend and if your mysql database
requires a password then you can store an encrypted version of
your mysql password instead of the cleartext one.
You need to turn on the config-parameter "encrypt_passwd" (set it
to 1). Then you need to create an encrypted string from your
mysql-password using note's commandline option --encrypt <string>.
Note will ask you for a passphrase which will be used to encrypt
the mysql-password. This passphrase must be exactly the same as
you use for mysql itself. That means you need to use encryption.
The string you get from this command must be saved in your config
file as attribute to "DbPasswd". Later on note will decrypt that
string using the supplied note-passphrase (that's why it must be
the same used for encrypt) and pass the result to the mysql server.
Once note have encrypted some data using this passphrase, you
cannot simply switch to another passphrase, because all data
@@ -465,30 +527,48 @@ Security
and checks if the decrypted timestamp field matches the following
expression: "^\d+\.\d+". Translated from perl to human:
the timestamp must begin with minimum one digit (possibly more),
followed by one dot, followed by minimum one digit (possibly more).
followed by one dot, followed by minimum one digit (possibly
more).
Chances are bad, that a wrong passphrase will cause a timestamp
matching the rule above. If you have other experiences, please
drop me a mail!
drop me a mail!
For the paranoid: do not use the cache-feature, 'cause note stores a
copy of your note database in RAM if cache support is turned on.
This means an attacker could access your (unencrypted!) notes.
Comments
========
You can send any comments to Thomas Linden <tom@daemon.de>.
If you find a bug or if you have a suggestion for improvement of the script
feel free to send me a patch ;-)
If you find a bug or if you have a suggestion for improvement of the
script feel free to send me a patch ;-)
License
=======
This script comes with absolutely NO WARRANTY. It is distributed under the
terms of the GNU General Public License. Use it at your own risk :-)
This script comes with absolutely NO WARRANTY. It is distributed under
the terms of the GNU General Public License. Use it at your own risk :-)
You can read the complete GPL at: http://www.gnu.org/copyleft/gpl.html
Recources
=========
The command-line options and all commands of the interactive mode are
described in the supplied note(1) manpage.
You may also refer to the note website http://www.0x49.org.
Author and Copyright
====================
@@ -506,12 +586,13 @@ Contributors / Credits
Jens Heunemann <jens.heunemann@consol.de> - sub tree.
Peter Palmreuther - various additions.
And many other people who sended bug reports, feature requests. If you feel that
I forgot your name in this list, then please send me an email and I'll add you.
And many other people who sent bug reports, feature requests. If you
feel that I forgot your name in this list, then please send me an email
and I'll add you.
Last changed
============
11/07/2000
08/08/2000