Archive

Posts Tagged ‘script’

Greasemonkey Script to get Jabber Room for Google Group Chat

March 15th, 2009

So, today I was invited to Google Group chat for the first time. This would be really cool on a terminal that’s not equipped with an IM client, since it’s all done through the web with flash and magic. But, since I don’t like having 2 IM clients running at the same time (Pidgin and the Flash one from Google), I decided I needed to rip out the Jabber Group Chat Room name from the invite page. I got some tips from this site, and wrote a Greasemonkey script to do so.

whoa

All you have to do is copy the room name into the Join Chat window, and put in groupchat.google.com as the server.  I hope you find it useful.  If anyone knows how to make this a link that GNOME will throw at Pidgin, let me know.  That would be awesome.

Get the Script


Uncategorized , , , , , , , , , , , ,

DNS for bash

March 31st, 2008

Today, I decided I wanted a network service that propagated variables and aliases to every login shell that subscribed to it. This is dangerous on a large scale, but perfectly acceptable on my small home network where everyone trusts everyone else.

First, I got Camping installed, bringing back fond memories of Ruby development. I then copied off the blog example, and created TreeHugger, a 427 line script that provides a web interface to edit the variables, and a plain text output for the shells to source.

This script, when run, allows some simple MVC actions to an sqlite3 database.

Example Screenshot

As you can see, I have some aliases here I want to send to all the subscribing hosts. Eventually, I want to add some detection functionality to the database (mostly reverse DNS lookups for host rule referencing). I just have to access /out to get my desired output:


# Treehugger Configuration
# Aliases
alias ai='sudo apt-get install'
alias aup='sudo apt-get update'
alias aug='sudo apt-get upgrade'

# Environment Variables

Now, to get this into bash. I looked into making the date command spit out pretty unique timestamps. Turns out you can do this with the nanoseconds format:


$ date +%s%N
1206926780157462141

I made it so wget saves the treehugger config to a tempfile using the somewhat random seed above as a filename suffix, and then I have my shell source it:


FILENAME=/tmp/treehugger-`date +%s%N`; 2>/dev/null wget -O $FILENAME  http://rofl.who/treehugger/out && source $FILENAME && rm $FILENAME

And now I have nice aliases on my laptop served up from my desktop as fresh as the shell:


hank@davros:~$ alias
alias ai='sudo apt-get install'
alias aug='sudo apt-get upgrade'
alias aup='sudo apt-get update'
alias ls='ls --color=auto'


Uncategorized , , , , , , , ,