[NTLUG:Discuss] wallet script

David Stanaway david at stanaway.net
Sun Dec 23 21:35:02 CST 2007


terry wrote:
> I've just installed  and started using Carl Welch's wallet script
> (from linuxjournal.com) on a couple of pc's and I actually like it
> pretty much so far.  But just wondering why the separate
> ~/bin/functions  file?  Is there a good reason for keeping it
> separate?  I was thinking that for simplicity and / or portability,
> I'd combine them both into /usr/local/bin/wallet, but just wondering
> if there's a good reason to leave it alone?  .... just curious...
> 
> Here's the wallet script:
> http://pastebin.ca/830600
> 
> Here is functions:
> http://pastebin.ca/830603
> 


I just use:

~$ more .vimrc
augroup encrypted
         au!
         " First make sure nothing is written to ~/.viminfo while editing
         " an encrypted file.
         autocmd BufNewFile,BufReadPre,FileReadPre      *.gpg,*.asc set 
viminfo=
         " We don't want a swap file, as it writes unencrypted data to disk.
         autocmd BufNewFile,BufReadPre,FileReadPre      *.gpg,*.asc set 
noswapfile
         " Switch to binary mode to read the encrypted file.
         autocmd BufReadPre,FileReadPre      *.gpg       set bin
         autocmd BufReadPre,FileReadPre      *.gpg,*.asc let ch_save = 
&ch|set ch=2
         autocmd BufReadPost,FileReadPost    *.gpg,*.asc
                 \ '[,']!sh -c 'gpg -q --decrypt 2> /dev/null'
         " Switch to normal mode for editing
         autocmd BufReadPost,FileReadPost    *.gpg       set nobin
         autocmd BufReadPost,FileReadPost    *.gpg,*.asc let &ch = 
ch_save|unlet ch_save
         autocmd BufReadPost,FileReadPost    *.gpg,*.asc
                 \ execute ":doautocmd BufReadPost " . expand("%:r")
         " Convert all text to encrypted text before writing
         autocmd BufWritePre,FileWritePre    *.gpg
                 \ '[,']!sh -c 'gpg -q --default-recipient-self -e 
2>/dev/null'
         autocmd BufWritePre,FileWritePre    *.gpg       set bin
         autocmd BufWritePre,FileWritePre    *.asc
                 \ '[,']!sh -c 'gpg -q --default-recipient-self -e -a 
2>/dev/null'
         " Undo the encryption so we are back in the normal text, directly
         " after the file has been written.
         autocmd BufWritePost,FileWritePost  *.gpg,*.asc u
         autocmd BufWritePost,FileWritePost  *.gpg       set nobin
augroup END


and have .asc ascii armored files about.



More information about the Discuss mailing list