Tag: google

Outside access to the GAE-powered XMPP bots

Posted by on 10-Sep-2009

Origin: Enabling chat outside Google Apps

To use XMPP bots, deployed on Google AppEngine (thanks to the new AppEngine SDK 1.2.5) from non-Google XMPP accounts (jabber.org etc.), in the DNS records for your domain (example.com) add:

_xmpp-server._tcp.example.com. IN SRV 5 0 5269 xmpp-server.l.google.com.
_xmpp-server._tcp.example.com. IN SRV 20 0 5269 xmpp-server1.l.google.com.
_jabber._tcp.example.com. IN SRV 5 0 5269 xmpp-server.l.google.com.
_jabber._tcp.example.com. IN SRV 20 0 5269 xmpp-server1.l.google.com.

Google Wave Federation Protocol with Prosody XMPP server

Posted by on 30-Jul-2009

To be “on the wave” I’ve done some experiments with Google Wave Federation Protocol. Other people already made it working with OpenFire (and another OpenFire install) and ejabberd, so I decided to try with Prosody - very easy to install Lua-based XMPP server, I’m enjoing recently. From version 0.4.0 Prosody have support for external components. My experiments was with the current (0.5.0) version.


Like always in the beginning RTFM - “Components in Prosody”. For the Wave protocol - no differences from the other manuals - create fedone war, generate certificates, corect the run-server.sh script etc.


For the Prosody XMPP server (/etc/prosody/prosody.cfg.lua):

Host "*"
    ...
    -- External components
    component_ports = { 5275 }
    component_interface = "0.0.0.0"
    ...

-- Google Wave experiments
Component "wave.example.com"
    component_secret = "some_secret"

Restart the Prosody server and execute the run-server.sh (be sure the secret in the Prosody config file and in the run script are the same).


Done. Enjoy.

GMail backup

Posted by on 09-Oct-2008

After the rumors about locked GMail accounts, decided to backup my important emails. The article How to back up your Gmail on Linux in four easy steps helped me a lot. My setting in ~/.getmail/getmail.gmail are (IMAP, Maildir):

[retriever]
type = SimpleIMAPSSLRetriever
server = imap.gmail.com
username = my_name
password = my_secret
mailboxes = (”personal”,”important”)

[destination]
type = Maildir
path = ~/gmail-archive/

[options]
verbose = 2
message_log = ~/.getmail/gmail.log

The backup itself was done via:

$ getmail -r ~/.getmail/getmail.gmail

Search Erlang-related information

Posted by on 08-Feb-2007

Started Google Co-op powered Erlang-related Search Engine . Enjoy

Update 09-Feb-2007: Also some tinyurl for the search machine

MapReduce for Ruby: Ridiculously Easy Distributed Programming

Posted by on 21-Aug-2006

Google’s MapReduce is now available for Ruby (via gem install starfish ). MapReduce is the technique used by Google to do monstrous distributed programming over 30 terabyte files.

Here is the basic code that will get you up and running with MapReduce in Starfish .

    # item.rb
    ActiveRecord::Base.establish_connection(
      :adapter  => "mysql",
      :host     => "localhost",
      :username => "root",
      :password => "",
      :database => "some_database"
    )

    class Item < ActiveRecord::Base; end

    server do |map_reduce|
      map_reduce.type = Item
    end

    client do |item|
      logger.info item.id
    end

Now just run:

    starfish item.rb

and Starfish takes care of the rest. The code above does the following:

  • The server grabs all the items via: Item.find(:all)
  • Each of the clients grab an item from the collection
  • When there are no more items to be grabbed, everything shuts down

Just add REST (and it’s come by default with the Edge Rails) and you’ll have your own S3 or GDrive for free ;)

ActiveMailer sending via GMail

Posted by on 27-Jun-2006

On the previous Kansai Rails Conference in Asiyagawa somebody asked me about using GMail (smtp+ssl or tls) with Rails ActiveMailer. Didn’t find solution until now but ‘dza-dza-dzaaaaaaan’ (hahaha i’m not so smart, all credits going to entombedvirus ):

Send email with ActionMailer through TLS only SMTP server

So for Debian (Ubuntu):

Install msmtp (light SMTP client with support for server profiles)

$ sudo apt-get install msmtp

Create/edit ~/.msmtprc

account gmail
host smtp.gmail.com
auth on
user <your_account>@gmail.com
password <your_password>
tls on
tls_starttls on
from <your_account>@gmail.com
maildomain gmail.com
account default : gmail

Stop msmtp complaining about permissions

$ chmod 600 ~/.msmtprc

Add on the bottom of yourrailsapp/config/environment.rb (and comment another ActionMailer::Base.delivery_method settings if exists)

ActionMailer::Base.delivery_method = :msmtp

module ActionMailer
  class Base
    def perform_delivery_msmtp(mail)
      IO.popen("/usr/bin/msmtp -t -C /<path_to>/.msmtprc -a gmail --", "w") do
 |sm|
        sm.puts(mail.encoded.gsub(/\r/, ''))
        sm.flush
      end
    end
  end
end

Do not forget to fix the exact path to your .msmtprc in the source above.

Google Notebook

Posted by on 17-May-2006

Google announced their new toy – Google Notebook . There are already several reviews for it on the net. People complaining about missing tagging etc. GNotebook come with Firefox extension. Pretty cool. And there is already Python Google Notebook API . Hm, where is the Ruby one? ;)

And another happy news from Google – hosted domains already have calendars!

Gmail for your domain

Posted by on 12-May-2006

Gmail for your domain just rocks! After 1 or 2 weeks of waiting you can have the latest on the web 2.0 email market for your own domain (personal or the company one). I already have my Gmail-based family webmail ;) Still moving the whole stuff from the @gmail accounts is in front…Hope there is some tool for easy transfer between accounts – emails, labels, filters etc.