diff --git a/bin/coverlovin.py b/bin/coverlovin.py deleted file mode 100755 index b8a3c8142..000000000 --- a/bin/coverlovin.py +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -'''recursively process subdirectories of given directory, downloading -appropriate cover images from Google Images if .mp3 files are found''' - -'''author: James Stewart -https://launchpad.net/coverlovin''' - -import os, sys -import urllib, urllib2 -import simplejson -import id3reader -import logging -from optparse import OptionParser - -log = logging.getLogger('coverlovinLogger') -log.setLevel(logging.INFO) -handler = logging.StreamHandler() -formatter = logging.Formatter("%(message)s") -handler.setFormatter(formatter) -log.addHandler(handler) - -googImgOpts = ["small", "medium", "large"] -fileTypeOpts = ["jpg", "png", "gif"] -defaultReferer = "https://launchpad.net/coverlovin" -googleImagesUrl = "https://ajax.googleapis.com/ajax/services/search/images" -musicDir = "" -fileType = "" -fileName = "" -fileSize = "" -referer = "" -resultCount = "" -overWrite = False - -def sanitise_for_url(input): - '''sanitise a string so that it is ok to be used in a url''' - - if input == None: input = "" - - words = input.split(' ') - output = '' - - for word in words: - try: - word = urllib.quote(word.encode('utf-8')) - output += word + '+' - except Exception, err: - log.error("Exception: " + str(err)) - - output = output[:-1] - return output - -def dl_cover(urlList, directory): - '''download cover images from url to given dir''' - - coverImg = os.path.join(directory, fileName) - - if os.path.isfile(coverImg) and overWrite: - log.info("%s exists and overwrite enabled - moving to %s.bak" % (coverImg, coverImg)) - os.rename(coverImg, (coverImg + '.bak')) - - for url in urlList: - log.info("Trying url: " + url) - urlOk = True - - try: - coverImgWeb = urllib2.urlopen(url, None, 10) - except Exception, err: - log.error("Exception: " + str(err)) - urlOk = False - - if urlOk: - log.info("Downloading cover from: " + url) - log.info(" to:" + coverImg) - coverImgLocal = open(os.path.join(directory, fileName), 'w') - coverImgLocal.write(coverImgWeb.read()) - coverImgWeb.close() - coverImgLocal.close() - break - -def get_img_urls(searchWords): - '''return list of cover urls obtained by searching - google images for searchWords''' - - imgUrls = [] - - # sanitise searchwords - searchWords = [sanitise_for_url(searchWord) for searchWord in searchWords] - - # construct url - url = googleImagesUrl + '?v=1.0&q=' - for searchWord in searchWords: url += searchWord + '+' - url = url[:-1] - url += '&as_filetype=' + fileType - url += '&imgsz=' + fileSize - url += '&rsz=' + str(resultCount) - - print url - - request = urllib2.Request(url, None, {'Referer': referer}) - - try: - response = urllib2.urlopen(request, None, 10) - except Exception, err: - log.error("Exception: " + str(err)) - return imgUrls - - try: - results = simplejson.load(response) - except Exception, err: - log.error("Exception: " + str(err)) - - for result in results['responseData']['results']: - imgUrls.append(result['url']) - - return imgUrls - -def process_dir(thisDir): - '''recursively process all sub-directories of given directory''' - - dirs = [] - files = [] - - for item in os.listdir(thisDir): - itemFullPath=os.path.join(thisDir, item) - - if os.path.isdir(itemFullPath): - dirs.append(itemFullPath) - else: - files.append(item) - - dirs.sort() - files.sort() - - for dir in dirs: - process_dir(dir) - - log.info("Evaluating " + thisDir) - - # if cover image exists and overwrite is disabled, no further work required - if os.path.isfile(os.path.join(thisDir, fileName)) and overWrite == False: - log.info(thisDir + ": " + fileName + " exists and overwrite is disabled - skipping") - return - - for file in files: - fileFullPath = os.path.join(thisDir, file) - if os.path.getsize(fileFullPath) > 128: - - # check file for id3 tag info - try: - id3r = id3reader.Reader(fileFullPath) - except: - log.info("Skipping " + file + " due to unicode error") - continue - - artist = id3r.getValue('performer') - album = id3r.getValue('album') - - # sanitise None values - if artist == None: artist = '' - if album == None: album = '' - - if artist != '' or album != '': - try: - log.info("Album info found in " + file + ": " + artist + " - " + album) - coverUrls = get_img_urls([artist, album]) - if len(coverUrls) > 0: - dl_cover(coverUrls, thisDir) - break - else: - log.warn("No cover image URL found") - except: - log.warn("File " + file + " contains id3 tags with corrupted encoding.") - else: - # didn't find enough info to get cover - pass - else: - # id3reader fails on files < 128 bytes - pass - -def parse_args_opts(): - '''parse command line argument and options''' - - parser = OptionParser() - - parser.add_option("-s", "--size", dest="size", action="store", default="small", help="file size: small, medium, or large") - parser.add_option("-i", "--image", dest="image", action="store", default="jpg", help="image format, eg jpg, png, gif") - parser.add_option("-n", "--name", dest="name", action="store", default="cover.jpg", help="file name, eg \"cover.jpg\"") - parser.add_option("-r", "--referer", dest="referer", action="store", default=defaultReferer, help="referer url, eg \"http://www.google.com\"") - parser.add_option("-c", "--count", dest="count", action="store", default="8", type="int", help="image lookup count (default: 8))") - parser.add_option("-o", "--overwrite", dest="overwrite", action="store_true", default=False, help="overwrite (default False)") - parser.set_usage("Usage: coverlovin.py [options]") - (options, args) = parser.parse_args() - - # set musicDir or bail if invalid - if len(sys.argv) < 2: - parser.print_help() - sys.exit(2) - elif os.path.isdir(sys.argv[1]) == False: - log.error(sys.argv[1] + " is not a valid directory") - parser.print_help() - sys.exit(2) - else: - musicDir = sys.argv[1] - - # set fileSize or bail if invalid - if options.size in googImgOpts: - fileSize = options.size - else: - log.error(options.size + " is not a valid size") - parser.print_help() - sys.exit(2) - - # set other variables - fileType = options.image - fileName = options.name - referer = options.referer - resultCount = int(options.count) - - return ( { "musicDir" : musicDir, "fileSize" : fileSize, "fileType" : fileType, "fileName" : fileName, "referer" : referer, "resultCount" : resultCount, "overWrite" : options.overwrite} ) - -def main(): - '''recursively download cover images for mp3 files in a - given directory and its sub-directories''' - - global fileType - global fileName - global fileSize - global referer - global resultCount - global overWrite - - argsOpts = parse_args_opts() - - fileType = unicode(argsOpts['fileType'], 'utf-8') - fileName = unicode(argsOpts['fileName'], 'utf-8') - fileSize = unicode(argsOpts['fileSize'], 'utf-8') - referer = unicode(argsOpts['referer'], 'utf-8') - resultCount = argsOpts['resultCount'] - overWrite = argsOpts['overWrite'] - - process_dir(unicode(argsOpts['musicDir'], 'utf-8')) - - return 0 - -if __name__ == "__main__": - sys.exit(main()) diff --git a/bin/onto b/bin/onto deleted file mode 100755 index f2109d60c..000000000 --- a/bin/onto +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# exit if no $host -host=$1 -if [[ "$host" == "" ]]; then - exit 1 -fi - -if [[ "$TMUX" ]]; then - # change to existing tmux window, or - # create a new window and - # ssh to host - # reattach or start a tmux session - tmux select-window -t wraooer:$host || tmux new-window -t wrapper -n $host "ssh -t $host \"tmux attach -t $host || tmux new-session -s $host\"" -else - ssh -t $host tmux attach -t $host || tmux new-session -s $host -fi diff --git a/bin/testmail.pl b/bin/testmail.pl deleted file mode 100644 index 577d842be..000000000 --- a/bin/testmail.pl +++ /dev/null @@ -1,60 +0,0 @@ -use Email::Sender::Simple qw(sendmail); -use Email::Sender::Transport::SMTP::TLS; -use Try::Tiny; - -@months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); -@weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun); -($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime(); -$year = 1900 + $yearOffset; -$theTime = "$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year"; - -my @chars = ("A".."Z", "a".."z"); -my $string; -$string .= $chars[rand @chars] for 1..32; - -my $transport = Email::Sender::Transport::SMTP::TLS->new( - host => 'exch-smtp.apnic.net', - port => 587, - username => 'pilot', - password => 'spacepilot1', - helo => 'test.apnic.net', - debug => 1, -); - -use Email::Simple::Creator; # or other Email:: -my $message = Email::Simple->create( - header => [ - From => 'pilot@apnic.net', - To => 'test1@apnic.net', - Subject => 'Testing exch-smtp' . $string, - ], - body => $theTime . ' - - The standard Lorem Ipsum passage, used since the 1500s - - "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." - - Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC - - "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?" - - 1914 translation by H. Rackham - - "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?" - - Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC - - "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat." - - 1914 translation by H. Rackham - - "On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains." - - ', -); - -try { - sendmail($message, { transport => $transport }); -} catch { - die "Error sending email: $_"; -}; diff --git a/curl/README.md b/curl/README.md new file mode 100644 index 000000000..8dd543d8f --- /dev/null +++ b/curl/README.md @@ -0,0 +1,13 @@ +curl +==== + +Config for curl + +To use, add the following to **dotsyncrc** + + [files] + .. + curl + .. + [endfiles] + diff --git a/curl/curlrc b/curl/curlrc new file mode 100644 index 000000000..c11b16310 --- /dev/null +++ b/curl/curlrc @@ -0,0 +1,38 @@ +# +# dotphiles : https://github.com/dotphiles/dotphiles +# +# Setup curl +# +# Authors: +# Ben O'Hara +# + +user-agent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" +referer = ";auto" + +# read .netrc for user name and password OR URL +netrc-optional + +# pick the most secure methods of authentication that the server accepts +# anyauth + +# !!! remote-time dosn't work with ftp upload from stdin !!! : use -R switch for downloading +#remote-time +remote-name-all +create-dirs + +# Don't show/download error document - only error code +fail + +#verbose +#silent +#show-error + +# FTP setup +ftp-create-dirs +ftp-ssl +ftp-pasv +ftp-method = nocwd + +#proxy = xxx.xxx.xxx.xxx:80 + diff --git a/mutt/README.md b/mutt/README.md new file mode 100644 index 000000000..ece4e5f92 --- /dev/null +++ b/mutt/README.md @@ -0,0 +1,15 @@ +mutt +==== + +Adds configuration for mutt and offflineimap + +To use, add the following to **dotsyncrc** + + [files] + .. + mutt + mutt/muttrc + mutt/offlineimaprc + .. + [endfiles] + diff --git a/mutt/colors/solarized b/mutt/colors/solarized new file mode 100644 index 000000000..a7ac891d3 --- /dev/null +++ b/mutt/colors/solarized @@ -0,0 +1,150 @@ +# vim: filetype=muttrc + +# +# +# make sure that you are using mutt linked against slang, not ncurses, or +# suffer the consequences of weird color issues. use "mutt -v" to check this. + +# custom body highlights ----------------------------------------------- +# highlight my name and other personally relevant strings +#color body yellow default "(ethan|schoonover)" +# custom index highlights ---------------------------------------------- +# messages which mention my name in the body +#color index yellow default "~b \"phil(_g|\!| gregory| gold)|pgregory\" !~N !~T !~F !~p !~P" +#color index J_cream brightwhite "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~N !~T !~F !~p !~P" +#color index yellow cyan "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~T !~F !~p !~P" +#color index yellow J_magent "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~F !~p !~P" +## messages which are in reference to my mails +#color index J_magent default "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" !~N !~T !~F !~p !~P" +#color index J_magent brightwhite "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~N !~T !~F !~p !~P" +#color index J_magent cyan "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~T !~F !~p !~P" +#color index J_magent red "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~F !~p !~P" + +# for background in 16 color terminal, valid background colors include: +# base03, bg, black, any of the non brights + +# basic colors --------------------------------------------------------- +color normal brightyellow default +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +#color status J_black J_status +color status brightcyan brightblack +color indicator default brightblack +color tree default default # arrow in threads +# basic monocolor screen +mono bold bold +mono underline underline +mono indicator reverse +mono error bold + +# index ---------------------------------------------------------------- + +#color index red default "~D(!~p|~p)" # deleted +#color index black default ~F # flagged +#color index brightred default ~= # duplicate messages +#color index brightgreen default "~A!~N!~T!~p!~Q!~F!~D!~P" # the rest +#color index J_base default "~A~N!~T!~p!~Q!~F!~D" # the rest, new +color index red default "~A" # all messages +color index brightred default "~E" # expired messages +color index blue default "~N" # new messages +color index blue default "~O" # old messages +color index brightmagenta default "~Q" # messages that have been replied to +color index brightgreen default "~R" # read messages +color index blue default "~U" # unread messages +color index blue default "~U~$" # unread, unreferenced messages +color index brightyellow default "~v" # messages part of a collapsed thread +color index brightyellow default "~P" # messages from me +color index cyan default "~p!~F" # messages to me +color index cyan default "~N~p!~F" # new messages to me +color index cyan default "~U~p!~F" # unread messages to me +color index brightgreen default "~R~p!~F" # messages to me +color index red default "~F" # flagged messages +color index red default "~F~p" # flagged messages to me +color index red default "~N~F" # new flagged messages +color index red default "~N~F~p" # new flagged messages to me +color index red default "~U~F~p" # new flagged messages to me +color index black red "~D" # deleted messages +color index brightcyan default "~v~(!~N)" # collapsed thread with no unread +color index yellow default "~v~(~N)" # collapsed thread with some unread +color index green default "~N~v~(~N)" # collapsed thread with unread parent +# statusbg used to indicated flagged when foreground color shows other status +# for collapsed thread +color index red black "~v~(~F)!~N" # collapsed thread with flagged, no unread +color index yellow black "~v~(~F~N)" # collapsed thread with some unread & flagged +color index green black "~N~v~(~F~N)" # collapsed thread with unread parent & flagged +color index green black "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged +color index cyan black "~v~(~p)" # collapsed thread with unread parent, no unread inside, some to me directly +color index yellow red "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial) +#color index yellow default "~(~N)" # messages in threads with some unread +#color index green default "~S" # superseded messages +#color index red default "~T" # tagged messages +#color index brightred red "~=" # duplicated messages + +# message headers ------------------------------------------------------ + +#color header brightgreen default "^" +color hdrdefault brightgreen default +color header brightyellow default "^(From)" +color header blue default "^(Subject)" + +# body ----------------------------------------------------------------- + +color quoted blue default +color quoted1 cyan default +color quoted2 yellow default +color quoted3 red default +color quoted4 brightred default + +color signature brightgreen default +color bold black default +color underline black default +color normal default default +# +color body brightcyan default "[;:][-o][)/(|]" # emoticons +color body brightcyan default "[;:][)(|]" # emoticons +color body brightcyan default "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\ + |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\ + |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?" +color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? +color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? + +## pgp + +color body red default "(BAD signature)" +color body cyan default "(Good signature)" +color body brightblack default "^gpg: Good signature .*" +color body brightyellow default "^gpg: " +color body brightyellow red "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" + +# yes, an insance URL regex +color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" +# and a heavy handed email regex +#color body J_magent default "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" + +# Various smilies and the like +#color body brightwhite default "<[Gg]>" # +#color body brightwhite default "<[Bb][Gg]>" # +#color body yellow default " [;:]-*[})>{(<|]" # :-) etc... +# *bold* +#color body blue default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +#mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +# _underline_ +#color body blue default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +#mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +# /italic/ (Sometimes gets directory names) +#color body blue default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" +#mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" + +# Border lines. +#color body blue default "( *[-+=#*~_]){6,}" + +#folder-hook . "color status J_black J_status " +#folder-hook gmail/inbox "color status J_black yellow " +#folder-hook gmail/important "color status J_black yellow " + diff --git a/mutt/colors/zenburn b/mutt/colors/zenburn new file mode 100644 index 000000000..ffe2da2b3 --- /dev/null +++ b/mutt/colors/zenburn @@ -0,0 +1,77 @@ +# Screenshot http://trovao.droplinegnome.org/stuff/mutt-zenburnt.png +# +# This is a zenburn-based muttrc color scheme that is not (even by far) +# complete. There's no copyright involved. Do whatever you want with it. +# Just be aware that I won't be held responsible if the current color-scheme +# explodes your mutt. +# +# Please remember that this color scheme requires a 256 color +# terminal-emulator. Any modern X terminal emulator should have support for +# that and you can enable it by calling mutt as "TERM=xterm-256color mutt", or +# by adding "term screen-256color" to your .screenrc. +# + +# general-doesn't-fit stuff +color normal color188 color234 +color error color115 color236 +color markers color142 color238 +color tilde color108 color234 +color status color144 color237 + +# index stuff +color indicator color108 color236 +color tree color109 color234 +color index color188 color234 ~A +color index color188 color234 ~N +color index color188 color234 ~O +color index color174 color234 ~F +color index color174 color234 ~D + +#color index_number color116 color234 +#color index_date color47 color234 +#color index_flags color0 color234 +#color index_label color49 color234 +#color index_size color116 color234 +#color index_subject color108 color234 ~A + + +# header stuff +color hdrdefault color223 color237 +color header color223 color237 "^Subject" + +# gpg stuff +color body color188 color237 "^gpg: Good signature.*" +color body color115 color236 "^gpg: BAD signature.*" +color body color174 color237 "^gpg: Can't check signature.*" +color body color174 color237 "^-----BEGIN PGP SIGNED MESSAGE-----" +color body color174 color237 "^-----BEGIN PGP SIGNATURE-----" +color body color174 color237 "^-----END PGP SIGNED MESSAGE-----" +color body color174 color237 "^-----END PGP SIGNATURE-----" +color body color174 color237 "^Version: GnuPG.*" +color body color174 color237 "^Comment: .*" + +# url, email and web stuff +color body color174 color237 "(finger|ftp|http|https|news|telnet)://[^ >]*" +color body color174 color237 "" +color body color174 color237 "www\\.[-.a-z0-9]+\\.[a-z][a-z][a-z]?([-_./~a-z0-9]+)?" +color body color174 color237 "mailto: *[^ ]+\(\\i?subject=[^ ]+\)?" +color body color174 color237 "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+" + +# misc body stuff +color attachment color174 color237 #Add-ons to the message +color signature color223 color237 + +# quote levels +color quoted color108 color237 +color quoted1 color116 color237 +color quoted2 color247 color237 +color quoted3 color108 color237 +color quoted4 color116 color237 +color quoted5 color247 color237 +color quoted6 color108 color237 +color quoted7 color116 color237 +color quoted8 color247 color237 +color quoted9 color108 color237 + +# vim: set syntax=muttrc: + diff --git a/mutt/config/global b/mutt/config/global new file mode 100644 index 000000000..aec794dc2 --- /dev/null +++ b/mutt/config/global @@ -0,0 +1,47 @@ +# +# dotphiles : https://github.com/dotphiles/dothiles +# +# main global config to be sourced from ~/.muttrc +# +# Authors: +# Ben O'Hara +# + +# General +set header_cache=~/.mutt/cache/headers +set message_cachedir=~/.mutt/cache/bodies +set certificate_file=~/.mutt/certificates + +set folder_format="%2C %t %5N %8s %d %f" + +set move=no +set edit_headers=yes +set editor='vim +/^$ "+normal j"' +set markers=no + +set sort='threads' +set sort_aux=last-date-received +set imap_check_subscribed +set imap_keepalive=60 +set mail_check=60 +set timeout=15 +set quit=ask-yes +set nobeep +set mailcap_path=~/.mutt/mailcap +auto_view text/html + +ignore "Authentication-Results:" +ignore "DomainKey-Signature:" +ignore "DKIM-Signature:" +hdr_order Date From To Cc + +set pager_index_lines=10 + +# Macros +macro index M "T.*\n;WN" "Mark all messages as read" + +# Settings +source ~/.mutt/config/pgp +source ~/.mutt/config/smime +source ~/.mutt/config/sidebar + diff --git a/mutt/config/pgp b/mutt/config/pgp new file mode 100644 index 000000000..878c3a039 --- /dev/null +++ b/mutt/config/pgp @@ -0,0 +1,28 @@ +# +# dotphiles : https://github.com/dotphiles/dotphiles +# +# Setup mutt for gpg +# +# Authors: +# Ben O'Hara +# + +# GPG Settings +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 0xE9687DBC -- -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 0xE9687DBC -- -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=0xE9687DBC +set pgp_replyencrypt=yes +set pgp_timeout=1800 +set pgp_good_sign="^gpg: Good signature from" + diff --git a/mutt/config/sidebar b/mutt/config/sidebar new file mode 100644 index 000000000..a0b46c7d0 --- /dev/null +++ b/mutt/config/sidebar @@ -0,0 +1,29 @@ +# +# dotphiles : https://github.com/dotphiles/dotphiles +# +# Setup mutt sidebar +# +# Authors: +# Ben O'Hara +# + +# Sidebar +# set up the sidebar, default not visible +set meta_key=yes +set sidebar_width=35 +set sidebar_visible=no +color sidebar_new color33 default +set sidebar_delim=' ' + +#Sidebar Navigation +bind index \ep sidebar-prev +bind index \en sidebar-next +bind index \eo sidebar-open +bind pager \ep sidebar-prev +bind pager \en sidebar-next +bind pager \eo sidebar-open + +# b toggles sidebar visibility +macro index b 'toggle sidebar_visible' +macro pager b 'toggle sidebar_visible' + diff --git a/mutt/config/smime b/mutt/config/smime new file mode 100644 index 000000000..df365f1c5 --- /dev/null +++ b/mutt/config/smime @@ -0,0 +1,63 @@ +# +# dotphiles : https://github.com/dotphiles/dotphiles +# +# Setup mutt for smime +# +# Authors: +# Ben O'Hara +# + +# S/MIME Settings +# If you compiled mutt with support for both PGP and S/MIME, PGP +# will be the default method unless the following option is set +#set smime_is_default +# Uncoment this if you don't want to set labels for certificates you add. +# unset smime_ask_cert_label +# Passphrase expiration +set smime_timeout=300 +# Global crypto options -- these affect PGP operations as well. +set crypt_autosign=no +set crypt_replyencrypt=no +set crypt_replysign=no +set crypt_replysignencrypted=no +set crypt_verify_sig=yes +# Section A: Key Management. +# The (default) keyfile for signing/decrypting. Uncomment the following +# line and replace the keyid with your own. +#set smime_default_key="12345678.0" +# Uncommen to make mutt ask what key to use when trying to decrypt a message. +# It will use the default key above (if that was set) else. +#unset smime_decrypt_use_default_key +# Path to a file or directory with trusted certificates +set smime_ca_location="~/.mutt/smime/cacerts/ca-bundle.cer" +# Path to where all known certificates go. (must exist!) +set smime_certificates="~/.mutt/smime/certificates" +# Path to where all private keys go. (must exist!) +set smime_keys="~/.mutt/smime/keys" +# These are used to extract a certificate from a message. +# First generate a PKCS#7 structure from the message. +set smime_pk7out_command="openssl smime -verify -in %f -noverify -pk7out" +# Extract the included certificate(s) from a PKCS#7 structure. +set smime_get_cert_command="openssl pkcs7 -print_certs -in %f" +# Extract the signer's certificate only from a S/MIME signature (sender verification) +set smime_get_signer_cert_command="openssl smime -verify -in %f -noverify -signer %c -out /dev/null" +# This is used to get the email address the certificate was issued to. +set smime_get_cert_email_command="openssl x509 -in %f -noout -email" +# Add a certificate to the database using smime_keys. +set smime_import_cert_command="smime_keys add_cert %f" +# Sction B: Outgoing messages +# Algorithm to use for encryption. +# valid choices are rc2-40, rc2-64, rc2-128, des, des3 +set smime_encrypt_with="des3" +# Encrypt a message. Input file is a MIME entity. +set smime_encrypt_command="openssl smime -encrypt -%a -outform DER -in %f %c" +# Sign. +set smime_sign_command="openssl smime -sign -signer %c -inkey %k -passin stdin -in %f -certfile %i -outform DER" +#Section C: Incoming messages +# Decrypt a message. Output is a MIME entity. +set smime_decrypt_command="openssl smime -decrypt -passin stdin -inform DER -in %f -inkey %k -recip %c" +# Verify a signature of type multipart/signed +set smime_verify_command="openssl smime -verify -inform DER -in %s %C -content %f" +# Verify a signature of type application/x-pkcs7-mime +set smime_verify_opaque_command="openssl smime -verify -inform DER -in %s %C" + diff --git a/mutt/gmail b/mutt/gmail new file mode 100644 index 000000000..373922268 --- /dev/null +++ b/mutt/gmail @@ -0,0 +1,32 @@ +# +# dotphiles : https://github.com/dotphiles/dothiles +# +# Gmail specific options +# +# Authors: +# Ben O'Hara +# + +color status green default + +set folder=$HOME/.mail +set spoolfile="+Gmail/INBOX" + +set from = "**Your Gmail Account**" +set smtp_url = "smtp://**Your Gmail Username**@smtp.gmail.com:587/" +set mbox = "+Gmail/archive" +unset record +set postponed = "+Gmail/drafts" + +macro index E \ + "+Gmail/archive~B " \ + "search everything" + +macro index D \ + "+Gmail/trash" \ + "move message to the trash" + +macro index S \ + "+Gmail/spam" \ + "mark message as spam" + diff --git a/mutt/mailcap b/mutt/mailcap new file mode 100644 index 000000000..5aaae5f9f --- /dev/null +++ b/mutt/mailcap @@ -0,0 +1,12 @@ +# +# dotphiles : https://github.com/dotphiles/dotphiles +# +# mailcap for mutt +# +# Authors: +# Ben O'Hara +# + +text/html; links %s; nametemplate=%s.html +text/html; links -dump %s; nametemplate=%s.html; copiousoutput + diff --git a/mutt/muttrc b/mutt/muttrc new file mode 100644 index 000000000..2fd170414 --- /dev/null +++ b/mutt/muttrc @@ -0,0 +1,29 @@ +# +# dotphiles : https://github.com/dotphiles/dotphiles +# +# Setup mutt with offlineimap +# +# Authors: +# Ben O'Hara +# + +# Setup mailboxes + +set folder=$HOME/.mail/ +set spoolfile="+Gmail/INBOX" + +set reverse_name=yes +set from=**Your Email** +set realname="**Your Name**" +alternates **Your Work Email** + +source $HOME/.mutt/colors/solarized + +source $HOME/.mutt/config/global + +source ~/.mutt/mailboxes.offlineimap + +# account specific sources +folder-hook Gmail/* source ~/.mutt/gmail +folder-hook Work/* source ~/.mutt/work + diff --git a/mutt/offlineimaprc b/mutt/offlineimaprc new file mode 100644 index 000000000..092cc7d5f --- /dev/null +++ b/mutt/offlineimaprc @@ -0,0 +1,65 @@ +# +# dotphiles : https://github.com/dotphiles/dotphiles +# +# Use offlineimap to pull mail +# +# Authors: +# Ben O'Hara +# + +# In the general section +[general] +# Controls how many accounts may be synced simultaneously +maxsyncaccounts = 2 +accounts=Gmail,Work + +# In the account identifier +[Account Gmail] +# Minutes between syncs +autorefresh = 5 +# Number of quick-syncs between autorefreshes. Quick-syncs do not update if the +# only changes were to IMAP flags +quick = 10 +localrepository = Gmail-local +remoterepository = Gmail-remote + +[Repository Gmail-local] +type = Maildir +localfolders = ~/.mail/Gmail/ + +[Repository Gmail-remote] +type = Gmail +remoteuser = username@gmail.com +# "[Gmail]/Some Folder" --> some_folder +nametrans = lambda folder: re.sub('^inbox$', 'INBOX', + re.sub(' +', '_', + re.sub(r'.*/(.*)$', r'\1', folder).lower())) + +# In the account identifier +[Account Work] +# Minutes between syncs +autorefresh = 5 +# Number of quick-syncs between autorefreshes. Quick-syncs do not update if the +# only changes were to IMAP flags +quick = 10 +localrepository = Work-local +remoterepository = Work-remote + +[Repository Work-local] +type = Maildir +localfolders = ~/.mail/Work/ + +[Repository Work-remote] +type = IMAP +remotehost = imap.work.com +remoteuser = username +ssl = yes + +[mbnames] +enabled = yes +filename = ~/.mutt/mailboxes.offlineimap +header = "mailboxes " +peritem = "=%(accountname)s/%(foldername)s" +sep = " " +footer = "\n" + diff --git a/mutt/work b/mutt/work new file mode 100644 index 000000000..72ba41eba --- /dev/null +++ b/mutt/work @@ -0,0 +1,33 @@ +# +# dotphiles : https://github.com/dotphiles/dotphiles +# +# Work specific options +# +# Authors: +# Ben O'Hara +# +# + +color status cyan default + +set folder=$HOME/.mail/ +set spoolfile="+Work/INBOX" + +set from = "**Your Work Email**" +set smtp_url = "smtp://**Your Work Username**@smtp.work.com:587/" +set mbox = "+Work/Archive" +set record = "+Work/Sent" +set postponed = "+Work/Drafts" + +macro index E \ + "+Work/Archive~B " \ + "search everything" + +macro index D \ + "+Work/Trash" \ + "move message to the trash" + +macro index S \ + "+Work/Spam" \ + "mark message as spam" + diff --git a/tmux/tmuxinator/dotphiles.yml b/tmux/tmuxinator/dotphiles.yml new file mode 100644 index 000000000..9762ec7f2 --- /dev/null +++ b/tmux/tmuxinator/dotphiles.yml @@ -0,0 +1,31 @@ +# +# dotphiles : https://github.com/dotphiles/dotphiles +# +# ~/.tmuxinator/dotphiles.yml +# +# Authors: +# Ben O'Hara +# + +project_name: dotphiles +project_root: ~/.dotfiles +socket_name: dotphiles # Not needed. Remove to use default socket +tabs: + - editor: + layout: even-horizontal + panes: + - vim . + - #empty, will just run plain shell + - testing1: + layout: tiled + panes: + - #sshcd debian1 .dotfiles + - #sshcd ubuntu1 .dotfiles + - #sshcd centos1 .dotfiles + - #sshcd freebsd1 .dotfiles + - testing2: + layout: tiled + panes: + - #sshcd solaris1 .dotfiles + - #empty + diff --git a/tmux/tmuxinator/home.yml b/tmux/tmuxinator/home.yml deleted file mode 100644 index caede5349..000000000 --- a/tmux/tmuxinator/home.yml +++ /dev/null @@ -1,16 +0,0 @@ -# -# dotphiles : https://github.com/dotphiles/dotphiles -# -# ~/.tmuxinator/home.yml -# -# Authors: -# Ben O'Hara -# - -project_name: home -project_root: ~/ -tabs: - - mac-mini: unset TMUX; tmux attach -t mac-mini || tmux new-session -s mac-mini - - nas: ssh -t nas "tmux attach -t nas || tmux new-session -s nas" - - pi: ssh -t pi "tmux attach -t pi || tmux new-session -s pi" - diff --git a/tmux/tmuxinator/network.yml b/tmux/tmuxinator/network.yml deleted file mode 100644 index 80a7ce5be..000000000 --- a/tmux/tmuxinator/network.yml +++ /dev/null @@ -1,39 +0,0 @@ -# -# dotphiles : https://github.com/dotphiles/dotphiles -# -# ~/.tmuxinator/wrapper.yml -# -# Authors: -# Ben O'Hara -# - -project_name: network -project_root: ~/ -tabs: - - configs: - layout: even-horizontal - panes: - - #empty, will just run plain bash - - #empty, will just run plain bash - - office: - layout: tiled - panes: - - #empty, will just run plain bash - - #empty, will just run plain bash - - #empty, will just run plain bash - - #empty, will just run plain bash - - nextdc: - layout: tiled - panes: - - #empty, will just run plain bash - - #empty, will just run plain bash - - #empty, will just run plain bash - - #empty, will just run plain bash - - interactive: - layout: tiled - panes: - - #empty, will just run plain bash - - #empty, will just run plain bash - - #empty, will just run plain bash - - #empty, will just run plain bash - diff --git a/tmux/tmuxinator/work.yml b/tmux/tmuxinator/work.yml deleted file mode 100644 index de5a52e17..000000000 --- a/tmux/tmuxinator/work.yml +++ /dev/null @@ -1,14 +0,0 @@ -# -# dotphiles : https://github.com/dotphiles/dotphiles -# -# ~/.tmuxinator/work.yml -# -# Authors: -# Ben O'Hara -# - -project_name: work -project_root: ~/ -tabs: - - racktables: unset TMUX; tmux attach -t racktables || tmux new-session -s racktables -