Command-line event management tools for Linux: Gcal and Gcalcli

 

Gcal

One day you might decide to switch to command-line calendar. Our suggestion will be GNU gcal.

wget http://ftp.gnu.org/gnu/gcal/gcal-3.6.tar.gz
tar xvzf gcal-3.6.tar.gz
cd gcal-3.6
./configure
make
make install
which gcal

After installation is completed let's run gcalc. Expected output is below.

[jsmith@reader ~]$ gcal

     August 2010
 Su Mo Tu We Th Fr Sa
  1  2  3  4  5  6  7
  8  9 10 11 12 13 14
 15 16 17 18 19 20 21
 22 23 24 25 26 27 28
 29 30 31

[jsmith@reader ~]$

For testing purposes let's print calendar for the month of September.

[jsmith@reader ~]$ gcal --start-of-month --month September

    September 2010
 Su Mo Tu We Th Fr Sa
           1  2  3  4
  5  6  7  8  9 10 11
 12 13 14 15 16 17 18
 19 20 21 22 23 24 25
 26 27 28 29 30

[jsmith@reader ~]$

 

Gcalcli

In case that you need to keep track of your events and  meeting, I would suggest to use gcalcli.

gcalcli is an application that communicates with Google calendar.

To install it, you would need several Python modules listed below:

  • python-gdata.noarch : A Python module for accessing online Google services
  • python-dateutil.noarch : Powerful extensions to the standard datetime module

 

First, let's install them:

yum install python-gdata python-dateutil 

Now let's download gcalcli:

wget http://gcalcli.googlecode.com/files/gcalcli-1.4.tgz
tar xvzf gcalcli-1.4.tgz
mv gcalcli /usr/local/bin/

Next, we need to create .gcalclirc

nano ~/.gcalclirc

Paste your google username and password:

[gcalcli]
user: jsmithcisco.com
pw: jsmithpass

Configure permissions:

chmod 600 ~/.gcalclirc 

 

Now, let's list our events:

[jsmith@reader ~]$ gcalcli agenda

Fri Aug 13  12:00am  Forecast for 10023 (26° | 20°)
             2:00pm  Cisco Systems Forecast

Sat Aug 14  12:00am  Forecast for 10023 (27° | 20°)
             9:00am  Design Meeting - Day 1

Sun Aug 15  12:00am  Forecast for 10023 (27° | 23°)
             9:00am  Design Meeting - Day 2

Mon Aug 16  12:00am  Forecast for 10023 (27° | 24°)

[jsmith@reader ~]$

 

 

Common gcalcli erros include:

 Traceback (most recent call last):
File "/usr/local/bin/gcalcli", line 59, in <module>
from gdata.calendar.service import *
ImportError: No module named calendar.service

Fixed by installing "python-gdata"

Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 61, in <module>
    from dateutil.tz import *

Fixed by installing "python-dateutil"

Thu Aug 12Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 1114, in <module>
    DoooooItHippieMonster()
  File "/usr/local/bin/gcalcli", line 1042, in DoooooItHippieMonster
    gcal.AgendaQuery(startText=args[1])
  File "/usr/local/bin/gcalcli", line 779, in AgendaQuery
    self._PrintEvents(today, start, eventList)
  File "/usr/local/bin/gcalcli", line 626, in _PrintEvents
    '  %-7s  %s\n' % (tmpTimeStr, event.title.text))
  File "/usr/local/bin/gcalcli", line 207, in PrintMsg
    sys.stdout.write(msg)
  File "/usr/lib/python2.6/codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 33: ordinal not in range(128)

Fixed by commenting out the lines below:

# for unicode support
#sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
#sys.stdin = codecs.getreader(locale.getpreferredencoding())(sys.stdin)

 

 

Moving your apps to Amazon or Miscrosoft Clouds?

We can help you analyze your existing infrastructure, identify the cost savings we can achieve by migrating to a cloud provider. We can then execute end-to-end migration plan of your infrastructure and bringing down your TCO.

Cloud Computing

Ready for IPv6 Migration?

The Internet is running out of the equivalent of phone numbers - familiar problem, non-trivial solution.

The world has to move to IPv6, with its 128-bit addresses. But that's easier said than done.

IPv6 Migration

Are you fluent in "Linux"?

Learn Linux from a leading expert and quickly master you Linux skills.

Learn how to simplify your workflow and increase your productivity using tips and techniques of the pros.

Ideal training for Corporate IT Beginners and Advanced IT Admins alike.

Corporate Linux Training

Who's Online

We have 9 guests and no members online