photo
Jordan Sissel
geek

Sat, 09 Aug 2003

mh fun, still.

I'm still awake from last night, yadda yadda yadda.
So I got leet with my vim stuff and wrote a keymap that automatically generates an attached pgp signature. I should note, however, that you'll have to run mime from whatnow or run mhbuild yourself, before you send out your email.
" MH comp header/body separator
let g:mhseparator="---------"

if bufname(1) == '/u9/psionic/Mail/draft'
set tw=72
map \t :w<CR>1G:exec "/^" . g:mhseparator . "$"<CR>jyG:enew<CR>PGdd:w! ~/tmp/.draft<CR>:bn<CR>O#<text/plain<ESC>Go#<application/pgp-signature<ESC>:exec "r!gpg --detach-sign --no-secmem-warning --output - --armor --textmode ~/tmp/.draft"<CR>
endif
This should be placed in your .vimrc. The only thing I'll really mention above is the g:mhseparator. This should be exactly the same line that separates your headers from your body (comp, repl, and forw formatting)
Just modify the variable in .vimrc to match your comp format.

One final note: To get the pgp signature mail part to play nice with mhbuild, you'll have to add this line to your .mh_profile
mhbuild-compose-application/pgp-signature:

This just lets mhbuild know of the existance of Content-Type: application/pgp-signature.

 

So the other update is to my mailfilter script. It now supports better html stuffs and pgp signature verification. I've done a bit of testing with other people's pgp signature attachments (though not extensive) and trial runs verifying emails tagged by vim keymapping above. It seems to work pretty well.

Comments: 0 (view comments)
Tags:
Permalink: /geekery/53
posted at: 10:21

Slight update.. ksh prompt

Found a few issues with the latest changes I made to my ksh prompt...

[ -w "/" ] && Z="#" || Z=">"; export Z
PROMPT='$(A=$?; /bin/echo -n $HOST"("`/bin/pwd | /usr/bin/sed -Ee "s,(/usr)?$HOME,~,"`") [!] "$([ $A -ne 0 ] && /bin/echo -n "!!${A}!! ")$Z" " )'
XTERM=
case $TERM in
   aterm|xterm|dtterm)
      XTERM='$(echo -n "\033]2;'${PROMPT%%$Z*}')\007" 1>&2)'
      ;;
   esac
export PS1=$XTERM$PROMPT

Keep in mind that PROMPT is very long...
Previously, it didn't report exit codes due to kludges that made $? change to 0 due to the exit status of some of the crap that runs inside the prompt.

Huzzah. However, on a sad note I'll point out the obnoxious length of PS1 now...

nightfall(~) [569] > echo "${#PS1}"
257

Comments: 0 (view comments)
Tags:
Permalink: /geekery/52
posted at: 06:36

more mh coolness

I got annoyed at html mail being displayed as.. well, plain text. So I stopped being a lazy fool and wrote a script to it right.

The product isn't quite finish at the time of posting, because I want to add lots of more features to it. This will run w3m on your mail if it matches one of the following conditions:
* The Content-Type of the mail is text/html
* The Content-Type is multipart/alternative and the first part is text/html
* The Content-Type is multipart/alternative and the second part is text/html (Useful when mail is transmitted in both text/plain and text/html

Comments: 0 (view comments)
Tags:
Permalink: /geekery/51
posted at: 01:50

Search this site

Navigation

Metadata

Home About Resume My Code (SVN)

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '08 Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials SSH Tunneling (Video)

Tag Cloud

Calendar

< August 2003 >
SuMoTuWeThFrSa
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930
31      

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati