Last active
December 18, 2015 11:49
-
-
Save muness/5778339 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# wire this in cron with something like this: | |
# 13,57,43,27 * * * * ~/bin/cal_im_reminder | |
export PATH="$HOME/.rbenv/bin:$PATH" ; eval "$(rbenv init -)"; | |
export TZ='America/New_York' # adjust to your timezone! | |
~/bin/gcalcli agenda --calendar <calendars from which you want IM reminders> --tsv | ~/bin/gcalcli_parse_tsv 10 | sendxmpp <personal gmail> -t <xmpp account you're logged into normally. for me that's my work account> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env ruby | |
if RUBY_VERSION =~ /1.9/ | |
Encoding.default_external = Encoding::UTF_8 | |
Encoding.default_internal = Encoding::UTF_8 | |
end | |
require 'time' | |
minutes=ARGV[0].to_i || 5 | |
STDIN.read.split("\n").each do |line| | |
row = line.split("\t") | |
start_time = Time.parse(row[0] +" " + row[1]) | |
end_time = Time.parse(row[2] +" " + row[3]) | |
cal_link = row[4] | |
hangout_link = row[5] | |
title = row[6] | |
str = hangout_link.length > 0 ? "Hangout at #{hangout_link}" : "More at #{cal_link}" | |
if (start_time >= Time.now && start_time <= (Time.now + (60 * minutes))) | |
puts "#{title} at #{start_time.strftime('%l:%M')} - #{str}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to the top of your sendxmpp script, just after the #!/...perl directive | |
use IO::Socket::SSL; | |
{ | |
no warnings 'redefine'; | |
my $old_connect_SSL = \&IO::Socket::SSL::connect_SSL; | |
*IO::Socket::SSL::connect_SSL = sub { | |
my $sock = $_[0]; | |
${*$sock}{_SSL_arguments}{SSL_cipher_list} = 'RC4-MD5'; | |
goto $old_connect_SSL; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcalcli agenda --calendar Muness `date +"%R"` `date +"%R" --date='4 hours'` --details all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment