Re: How to avoid new line from stream

Jean Louis <[email protected]> Sat, 4 Aug 2018 16:52:39 +0200
Newsgroups gmane.lisp.clisp.general
Message-ID <[email protected]>
On Sat, Aug 04, 2018 at 04:21:57PM +0200, Max Zettlmeißl wrote:
> (defun slurp-stream-io-command (command input &key (arguments nil))
>   (with-open-stream (stream (run-program command
>                                          :arguments arguments
>                                          :input :stream
>                                          :output :stream))

I will try that way certainly.

> (defun gpg-decrypt (string &key homedir)
>   (slurp-stream-io-command "gpg"
>                            string
>                            :arguments (list "-d"
>                                             "--no-permission-warning"
>                                             "--trust-model" "always"
>                                             "--yes"
>                                             "--homedir"
>   homedir)))

> Although I advise against using
> "--no-permission-warning" and "--trust-model
> always".

Maybe those are not necessary as you say.

Principle that I use is that client's information
cannot be stored online, so I do not use any
online databases.

Any inquiry that arrives, subscription, just
anything, get encrypted online at the moment of
submission.

As you know servers run under different users,
permissions and similar, so the gpg-encrypt
function is using lax permissions, and is
encrypting only to myself.

Maybe gpg-decrypt was blindly copied from
gpg-encrypt.

And gpg-decrypt is doing it only offline.

It is not used in general encryptio and decryption.

> And you might want to think about using Emacs
> Lisp instead of Common Lisp for the things you
> are doing, since that seems to be more fitting
> so far. It would remove one additional step.

Emacs startup time is much slower then CLISP.

When email arrives, I am reading it with mutt.

Then I click ESC-i if it is inquiry, it get
decrypted and inserted into PostgreSQL database.

Then I am replying to it, and using Emacs for
editing the message.

I made it so that inquiry arrives as if I remember
well, as data which was printed as Lisp data into
the message, or into file.

So it looks like this below, and it can be read
straight into CLISP, first decrypted and then read
as INQUIRY data type, that goes into the database,
and it can be decrypted, replied to, so those Lisp
comment markers #| are used for reply, and below
part is deleted.

That way I have straight forward insertion of the
lead into the database, and quick decryption.

And database is not online, nobody can steal
anything.

Next what I wish to implement is online shopping
without online database.

Jean

On Mon, Jul 16, 2018 at 11:14:15AM +0000, BusinessLeads wrote:
> #| 2018-07-16 11:14:15, Business Inquiry: 3740728455
> From: Joe Doe <[email protected]>
> Main domain: http://www.ourdomain.com
> Referrer URL: http://www.ourdomain.com/contact/index.html
> 
> Hello There
> ,I am Frank, CEO 
> ,We are looking to purchase 2-3
> ,Greetings 
> |#
> 
> #| --- PRIN1-BEGIN --- |#
> 
> #S(INQUIRY :TIMESTAMP "2018-07-16 11:14:15" :UNIVERSAL-TIME 3740728455 :PAGE-ID "NONE"
>    :IP "xxx.136.232.64" :REFERER "http://www.ourdomain.com/contact/index.html" :ACCOUNT 1234
>    :NAME "Joe Doe" :EMAIL "[email protected]"
>    :MESSAGE
>    "Hello There
> ,Greetings"
>    :ASSIGNED-TO 1 :REDIRECT "http://www.outdomain.com/contact/thankyou.html" :METHOD "POST"
>    :SERVER-NAME "127.0.0.1" :PHONE "+1234567" :CITY NIL :COUNTRY "101" :LANGUAGE :EN
>    :OTHER-FIELDS
>    (:SUBMIT "Send+inquiry" :FORM_NAME "orders" :PAGEHASH "1531739323" :FIELD_LIST
>     "Name%2C+E-mail%2C+Phone%2C+Message" :VALIDATE%3AHAS+TEXT "Name%2C+E-mail%2C+Message" :LANG
>     "en"))
> 
> #| --- PRIN1-END --- |#
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list