dot

packages and services management
Log | Files | Refs | README

commit 8200cb121fffe64f8eb1ae4dbdc5c6d801eda12d
parent 2b30de6ab29d0d25f5148161bde8aa27ca78eca3
Author: josuah <mail@josuah.net>
Date:   Fri, 23 Dec 2016 14:46:21 +0000

Mixed

Diffstat:
A.local/bin/calendar | 29+++++++++++++++++++++++++++++
D.local/bin/ical | 78------------------------------------------------------------------------------
A.local/bin/icaldir | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
A.local/share/build/ssmtp | 3+++
M.mailrc | 2+-
M.mbsyncrc | 20++------------------
6 files changed, 86 insertions(+), 97 deletions(-)

diff --git a/.local/bin/calendar b/.local/bin/calendar @@ -0,0 +1,29 @@ +#!/usr/bin/awk -f +function is_bissextile(year) +{ + return (year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0); +} + + +function days_in_month(month, year) +{ + if (month == 2) { + return 28 + is_bissextile(year); + } else if (month < 8) { + return 30 + (month % 2 == 1); + } else { + return 30 + (month % 2 == 0); + } +} + + +function date_to_second(year, month, day, hour, minute, second) +{ + for (month--; month > 0; month--) + day += days_in_month(month, year); + + for (year--; year >= 1970; year--) + day += 365 + is_bissextile(year); + + return (second + 60 * (minute + 60 * (hour + (24 * (day - 1))))); +} diff --git a/.local/bin/ical b/.local/bin/ical @@ -1,78 +0,0 @@ -#!/usr/bin/awk -f - - -function is_bissextile(year) -{ - return (year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0); -} - - -function days_in_month(month, year) -{ - if (month == 2) { - return 28 + is_bissextile(year); - } else if (month < 8) { - return 30 + (month % 2 == 1); - } else { - return 30 + (month % 2 == 0); - } -} - - -function date_to_second(year, month, day, hour, minute, second) -{ - for (month--; month > 0; month--) - day += days_in_month(month, year); - - for (year--; year >= 1970; year--) - day += 365 + is_bissextile(year); - - return (second + 60 * (minute + 60 * (hour + (24 * (day - 1))))); -} - -function format_date(date) -{ - return strftime("%Y-%m-%d-%H-%M-%S", date_to_second( \ - substr(date, 1, 4), # Year - substr(date, 5, 2), # Month - substr(date, 7, 2), # Day - substr(date, 10, 2), # Hour - substr(date, 12, 2), # Minute - substr(date, 14, 2))); # Second -} - - -BEGIN { - FS = ":"; -} - - -{ - gsub("\015", ""); - gsub("\t", " "); -} - - -/BEGIN:VEVENT/,/END:VEVENT/ { - if (substr($0, 1, 1) != " ") { - type = $1; - vevent[type] = substr($0, - index($0, ":") + 1, length($0) - length($1)); - } else { - vevent[type] = vevent[type] substr($0, 2, length($0) - 1); - } -} - - -/END:VEVENT/ { - name = format_date(vevent["DTSTART"]) "_" format_date(vevent["DTEND"])); - - gsub(/\\/, "", vevent["LOCATION"]); - printf("SUM: %s\n", vevent["SUMMARY"]); - - gsub(/\\/, "", vevent["LOCATION"]); - printf("LOC: %s\n", vevent["LOCATION"]); - - gsub(/\\n/, "\n", vevent["DESCRIPTION"]); - printf("\n%s\n", vevent["DESCRIPTION"]); -} diff --git a/.local/bin/icaldir b/.local/bin/icaldir @@ -0,0 +1,51 @@ +#!/usr/bin/awk -f + + +function print_date(date) +{ + printf("%s-%s-%s %s:%s:%s", + substr(date, 1, 4), # Year + substr(date, 5, 2), # Month + substr(date, 7, 2), # Day + substr(date, 10, 2), # Hour + substr(date, 12, 2), # Minute + substr(date, 14, 2)); # Second +} + + +BEGIN { + FS = ":"; +} + + +{ + gsub("\015", ""); + gsub("\t", " "); +} + + +/BEGIN:VEVENT/,/END:VEVENT/ { + if (substr($0, 1, 1) != " ") { + type = $1; + vevent[type] = substr($0, + index($0, ":") + 1, length($0) - length($1)); + } else { + vevent[type] = vevent[type] substr($0, 2, length($0) - 1); + } +} + + +/END:VEVENT/ { + print_date(vevent["DTSTART"]); + print_date(vevent["DTEND"]); + printf "\n"; + + gsub(/\\/, "", vevent["LOCATION"]); + printf("Summary: %s\n", vevent["SUMMARY"]); + + gsub(/\\/, "", vevent["LOCATION"]); + printf("Location: %s\n", vevent["LOCATION"]); + + gsub(/\\n/, "\n", vevent["DESCRIPTION"]); + printf("\n%s\n", vevent["DESCRIPTION"]); +} diff --git a/.local/share/build/ssmtp b/.local/share/build/ssmtp @@ -0,0 +1,3 @@ +# simple SMTP client, MTA for sending mail + +tar=http://http.debian.net/debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2 diff --git a/.mailrc b/.mailrc @@ -5,7 +5,7 @@ # #_______________________________________________________________________________ -set sendmail="~/.local/bin/msmtp" +set sendmail="~/.local/sbin/ssmtp" # Do not save message to mbox set hold diff --git a/.mbsyncrc b/.mbsyncrc @@ -1,19 +1,3 @@ -IMAPAccount josuah.net -Host mail.gandi.net -User mail@josuah.net -PassCmd "sed -rn 's/password *\"(.*)\"/\\1/ p' \"$HOME/.netrc\"" +SyncState * +Sync New ReNew Flags -IMAPStore gandi-remote -Account josuah.net - -MaildirStore gandi-local -Path ~/Mail/ -Inbox ~/Mail/INBOX - -Channel josuah.net -Master :gandi-remote: -Slave :gandi-local: -Patterns * -Create Both -Expunge Both -SyncState *