Commits

David Wolever committed 3ca45cc

Wee! Have private stuff now.

  • Participants
  • Parent commits 5b10aaa

Comments (0)

Files changed (11)

File .pack_common.sh

+function end {
+    rm private.tar.gz > /dev/null 2>&1
+    exit $1
+}
+
+function files_changed {
+    FILES_CHANGED=0
+    cd private || return
+    for FILE in *
+    do
+        if [[ "$FILE" -nt ".$FILE-timestamp" ]]
+        then
+            FILES_CHANGED=1
+            echo "$FILE has been changed"
+        fi
+    done
+    cd ..
+}
+
+if [[ ! `which gpg` ]]
+then
+    echo "Could not find GPG!"
+    exit 1
+fi

File install_links.sh

 #!/bin/bash
-cd "`dirname "$0"`"
-touch ~/.profile_local
-
 function install_link {
     FILE="$1"
-    DOTFILE="$HOME/.$FILE"
+    DOTFILE="$HOME/.`basename "$FILE"`"
+    if [[ -f "`dirname "$FILE"`/.`basename "$FILE"`-nolink" ]]
+    then
+        echo "nolink file exists for $FILE -- not linking."
+        return
+    fi
     if [[ -e "$DOTFILE" || -h "$DOTFILE" ]]
     then
         if [[ $NO_REPLACE ]]
     echo "$FILE --> $DOTFILE"
 }
 
+if [[ "`basename "$0"`" != "install_links.sh" ]]
+then  # We may be executed as a script
+    return
+fi
+
+cd "`dirname "$0"`"
+touch ~/.profile_local
+
 if [[ "$1" == "-n" ]]
 then
     NO_REPLACE=1
 
 for FILE in *
 do
-    if [[ "$FILE" != "`basename $0`" ]]
-    then
-        install_link "$FILE" 
-    fi
+    install_link "$FILE" 
 done
+set realname="David Wolever"  #replace this with your name
+my_hdr From: David Wolever <david@wolever.net> #replace this
+
+set editor="vim -f  -c 'set tw=60 nobackup'" #your favourite editor
+
+set pager_context=1                        
+set pager_index_lines=6                 #show a mini-index in pager
+set menu_scroll  
+set status_on_top                       #put status line at top
+set sort=threads                        #sort by message threads in index
+set ispell="/usr/bin/aspell -e -c"
+
+set pgp_decode_command="gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f"
+set pgp_verify_command="gpg --no-verbose --batch --output - --verify %s %f"
+set pgp_decrypt_command="gpg --passphrase-fd 0 --no-verbose --batch --output - %f"
+set pgp_sign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
+set pgp_clearsign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
+set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0x3A219CC2  -- -r %r -- %f"
+set pgp_encrypt_sign_command="pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0x3A219CC2 -- -r %r -- %f"
+set pgp_import_command="gpg --no-verbose --import -v %f"
+set pgp_export_command="gpg --no-verbose --export --armor %r"
+set pgp_verify_key_command="gpg --no-verbose --batch --fingerprint --check-sigs %r"
+set pgp_list_pubring_command="gpg --no-verbose --batch --with-colons --list-keys %r" 
+set pgp_list_secring_command="gpg --no-verbose --batch --with-colons --list-secret-keys %r" 
+set pgp_autosign=yes
+set pgp_sign_as="0x3A219CC2"
+set pgp_replyencrypt=yes
+set pgp_timeout=1800
+set pgp_good_sign="^gpg: Good signature from"
+
+color body brightblack cyan "^gpg: Signature made.*"
+color body brightblack green "^gpg: Good signature from.*"
+color body brightblack yellow "^gpg: Can't check signature.*"
+color body brightblack yellow "^gpg: WARNING: .*"
+color body brightwhite red "^gpg: BAD signature from.*"
+
+set status_format=" %r %b %f %n      Del %d      Msgs %m %l %> (%P)"
+set pager_format="%-10.10i %[!%a %b %d %R]"
+set date_format="!%H:%M %a %d %b     "
+set index_format="%4C %Z %[%b%d] %-15.15F %s"
+set folder_format="%2C %t %8s %d %N %f"
+
+#set sendmail="/usr/bin/nbsmtp -d isp.net -h smtp.isp.net -f yourname@isp.net"
+
+#set from="default-mailaddress"         #set to your from address
+#set realname="myname"
+
+set record="$HOME/.maildir/sent"        #sent mail is saved here
+set delete=yes                          #delete without prompting
+set include=yes				#quote msg in reply	
+set fast_reply=yes			#no prompting on reply
+set beep=no				#no noise
+set markers=no				#no + on wrapped lines
+set confirmappend=no			#no prompt for save to =keep           
+set to_chars=" +TCF"                    #no L for mail_list
+
+set folder = $HOME/.maildir
+
+save-hook .* =keep                      #default mbox to (s)ave mail is =keep
+
+bind pager h display-toggle-weed	#toggle headers with h key
+
+bind generic	<left> previous-entry
+bind generic 	<right> next-entry
+
+bind pager "k" previous-line
+bind pager <up> previous-line
+bind pager "j" next-line
+bind pager <down> next-line
+bind pager  "K"     previous-entry #pressing "K", while in pager will move the cursor to the previous entry 
+bind pager  "J"     next-entry #pressing "J", while in pager will move the cursor to the next entry 
+
+bind pager   "<"      top
+bind pager   <home>   top
+bind pager   ">"      bottom
+bind pager   <end>    bottom
+bind pager   "{"      previous-thread
+bind pager   "}"      next-thread
+
+macro index "w" "<change-folder>?"           # Folder list
+
+macro pager "w" "<change-folder>?"           # Folder list
+
+# simulate the old url menu
+macro index \cb |urlview\n 'call urlview to extract URLs out of a message'
+macro pager \cb |urlview\n 'call urlview to extract URLs out of a message'
+
+#run fetchmail by hitting key of G
+macro index G "!fetchmail\n"
+macro pager G "!fetchmail\n"  
+
+#use to edit .muttrc and then source it...no restart necessary
+macro generic ,sm ":source $HOME/.muttrc\r"
+
+# default list of header fields to weed out when displaying mail
+#ignore them all and then unignore what you want to see
+ignore *
+unignore  Date To From: Subject X-Mailer Organization User-Agent
+hdr_order Date From To Subject X-Mailer User-Agent Organization 
+
+##your Mutt has to have some colors
+##these are for four levels of quoted text
+##they override the system settings in /etc/mutt/Muttrc
+
+#color quoted green  default
+color quoted1 magenta blue 
+#color quoted2 yellow default
+#color quoted3 red default   
+#color signature cyan cyan   
+
+
+#this color setup is copied from /etc/mutt/Muttrc.color
+#comment it out if you want the default colors in /etc/mutt/Muttrc
+# Je vois la vie en rose :-) 
+color	hdrdefault	brightcyan	blue
+color	header		brightwhite	blue "^from:"
+color   header          brightwhite    	blue   "^subject:"
+
+color   quoted          brightgreen     blue
+color   signature       brightwhite	blue
+
+color   indicator       blue	        green
+
+color   error           red             black
+mono    error           bold
+color   status          black cyan
+mono	status		bold
+color   tree            yellow   	blue
+
+color   tilde           brightmagenta   blue
+color	body	brightwhite		blue	"[-a-z_0-9.]+@[-a-z_0-9.]+"
+mono    body    bold                    "[-a-z_0-9.]+@[-a-z_0-9.]+"
+color   body            brightyellow    black   "^Good signature"
+mono    body            bold                    "^Good signature"
+color   body            brightwhite     red     "^Bad signature from.*"
+mono    body            bold                    "^Bad signature from.*"
+color   normal          white		blue
+color	message		green	black
+color	attachment	brightgreen	blue
+
+set alias_file=~/.mutt_addresses
+set reverse_alias

File pack_private.sh

+#!/bin/bash
+cd "`dirname "$0"`"
+source .pack_common.sh
+
+files_changed
+
+if [[ $FILES_CHANGED -eq 0 ]]
+then
+    echo "Nothing to be done..."
+    exit
+fi
+
+tar -czf private.tar.gz private/ || end 3
+gpg -c private.tar.gz || end 3
+
+cd private/
+for FILE in *
+do
+    touch ".$FILE-timestamp"
+done
+
+end 0

File private.tar.gz.gpg

Binary file added.

File unpack_private.sh

+#!/bin/bash
+cd "`dirname "$0"`"
+source .pack_common.sh
+source install_links.sh
+rm private.tar.gz > /dev/null 2>&1
+
+if [[ ! -f "private.tar.gz.gpg"  ]]
+then
+    echo "private.tar.gz.gpg not found :("
+    exit 1
+fi
+
+files_changed
+
+if [[ $FILES_CHANGED -eq 1 ]]
+then
+    echo "Oh no! local files have changed.  Please do something about that."
+    end 3
+fi
+
+gpg -d private.tar.gz.gpg > private.tar.gz || end 4
+
+tar -zxvf private.tar.gz || end 5
+
+NO_REPLACE=1
+for FILE in private/*
+do
+    install_link "$FILE"
+done
+
+end 0