| |
Nov 10
Well since I barely use my jaiku account, even when it has xmpp support. Probably is that I’m not really interested on the conversations there and no one uses jaiku channels. It would be a lot better if it used something like “track” the one you find in identispy for identi.ca, twitterspy for twitter and Jance for Pownce.
Anyway I decided that I wouldn’t bother setting yet another account on some random service to update identi.ca,twitter and jaiku at the same time so I decided to write something myself.
After very little effort I came out with this, it’s pretty basic and with ZERO error checking but it does what I want.
I used feedparser and simplejson python modules.
-
#!/usr/bin/env python
-
-
import simplejson
-
import urllib
-
import feedparser
-
import time
-
import re
-
-
identica_rss="http://identi.ca/IDENTICA_USER/rss"
-
user = ‘JAIKU_USER’
-
api_key =‘JAIKU_KEY’
-
-
class JaikuInterface:
-
method = ‘POST’
-
api_url = ‘http://api.jaiku.com/json’
-
def __init__(self,user,key):
-
self.user=user
-
self.api_key=key
-
def post(self,message):
-
body_dict = (
-
(‘user’,self.user),
-
(‘personal_key’,self.api_key),
-
(‘method’,‘presence.send’),
-
(‘message’,message)
-
)
-
body = urllib.urlencode(body_dict)
-
try:
-
f=urllib.urlopen(self.api_url,body)
-
ret = simplejson.loads(f.read())
-
f.close()
-
if ret[’status’]==u‘ok’:
-
return True
-
else:
-
return False
-
except:
-
return False
-
-
-
-
jaiku = JaikuInterface(user,key)
-
last_date = time.mktime(time.gmtime())
-
oldest = last_date
-
time_fmt= "%Y-%m-%dT%H:%M:%S+00:00"
-
striper = re.compile("^deepspawn: ")
-
stripuser = lambda(x): striper.sub("",x)
-
while True:
-
try:
-
identifeed=feedparser.parse(identica_rss)
-
for entry in identifeed.entries:
-
entry_date = time.strptime(entry.updated,time_fmt)
-
entry_date = time.mktime(entry_date)
-
if entry_date > last_date:
-
oldest = max(entry_date,oldest)
-
post = stripuser(entry.title)
-
jaiku.post(post)
-
last_date=oldest
-
except:
-
pass
-
time.sleep(5*60)
-
Well just replace IDENTICA_USER, JAIKU_USER and JAIKU_KEY with your values and that’s all.
It will poll every 5 minutes the rss and update jaiku with the new dents.
Well that’s all, it’s a small hack I hope someone find this interesting.
Oct 31
Hoy mi compañero Diego recibio este divertido correo desde la Dirección Nacional de Programas de Pregrado
Diego: Cuando la Universidad Nacional decidio abrir el abanico de modalidades para el Trabajo de Grado y quitar las menciones de Meritoria y laureada, no penso en lo que se venia luego: como incentivar y premiar a todas las variaciones de Trabajo de Grado. Como no es lo mismo hacer una pasantia y presentar un reporte a estar todo el semestre frente a un microscopio observando algo superespecial para el desarrollo de la humanidad, pues no se esta actuando con equidad pues el reporte de la pasantia no encaja en el formalismo del concurso mejores trabajos de Grado, asi le hayan puesto de nota 5 y haya tenido un desempeño sobresaliente… La UN debe pensar como premia a los excelentes en cada modalidad pero aun no lo ha hecho. El concurso premio hasta los trabajos de 2007. Falta 2008 pero ahora el enfasis esta en la reforma academica para implementar el acuerdo 033 en el primer semestre de 2009. Asi que solo hasta el 2009 se pensara en como hacer la seleccion y en ese tiempo se premiarian 2008 y 2009 y se haria difusion a lo que se concrete. Por ahora no. Feliz tarde,
Yo empezaré la discución sobre este tema, pero mi opinión personal extendida la dejo como un comentario.
Oct 05
Speeqe is a tremendous idea to bring multi user chat(MUC) into the simplest possible web service you can think, if you want to invite your friends they all just have to follow an url you send and start chatting, things can be more complicated but it’s not required to start participating. Well now I have installed speeqe on my own server quite successfully, it wasn’t an easy task, yet it wasn’t that difficult.
If you want to try it check it here: Valkertown’s rooms you will need a Valkertown’s jabber account to test it, but I will solve this problem asap.
Here’s a list of some of the stuff I had to work around:
- There’s still a lot of hardcoded strings in the js,css,templates with the speeqe url
- The templates, js,css doesn’t prepend the djangos settings for MEDIA_ROOT, I wish I solved this nicely but all I did is set them
manually.
- Everything on my test server is server using an https connection that includes the http-bind. I figured how to solve this and it was not a big deal.
- I had to do some minor modifications to the django/python client so it connects using https and to the ejabberd’s bosh module.
Here’s some of the stuff I disabled.
- The demo stuff
- The register stuff(I simply didn’t understand it) I tought it created a new xmpp account but it looks like it doesn’t, just an speeqe account, correct me if I’m wrong.
- Virtual host, I’m not planning to do subdomain rooms.
- Message search, I don’t like much this feature, I would like more a room search.
- The static urls serve in the urls, I would activate it using some kind of flag, it’s just not good to see it there, I think it may lead to problems.
Here’s some of the stuff I modified:
- I replaced virtual host to normal chat rooms urls, I would like and plan to setup shorter urls for local rooms without using dns
- Templates to match my own domain where it made sense.
At last:
- I’m missing the autologin feature, I’m guessing on how to deal with this but I want to keep the modifications I do to the code at a minimum.
Oct 01
Well, today in the afternoon I was given a task, make the Usb Instruments DS1M12 usb osciloscope in linux, it was quite a surprise
to find out it had some kind of support for Linux and I started my work with their sources.
I found it requires two downloads one from USB Instruments itself and another from a thirdparty driver
Well, those two comes with some .so files you need to link your programs so you need to make sure
they have proper names like libDS1M12.so, libftd2xx.so and they can be found in the LD_LIBRARY_PATH or something like that, this is important.
After you get this solved it’s pretty straightforward with the USB Instruments package comes a good example you can use to understand their library, this took a bit of time since we(called some one to help me pinpoint some problems) could get it working and seeing the data flow quite fast, yet, it took us some time to discover that the sample code enabled the testmode and instead of real sampling, after that we could see the two channels sampling also the signal generator send out the example signals.
After this we agreed that it would be good to have a python interface to this osciloscope and I started working with swig to generare a proper wrapper around the USB Instruments library, around an hour ago I finished what we could call the first release of the interface and I’m being able to plot some data using matlplot lib. It took me a bit to figure how to manage to wrap some of the functions yet in the end swig and numpy solved all my issues.
I’m not really sure If I can release everything at the moment, I think I’ll have to ask USB Instruments since I use one of their headers to build the swig wrapper and it requires some minor modifications to make it work nicely so I would have to publish the modified header. If i get permission or any idea how I should publish the repository, it will be here at valkertown Mercurial Repositories
For now you have to beleive me that now the use of this osciloscope it’s reduced to something like this
-
-
"""
-
Author: Carlos Andres Perilla
-
Centro Internacional de Física, Bogotá-Colombia.
-
-
This program is free software: you can redistribute it and/or
-
modify it under the terms of the GNU Affero General Public License
-
as published by the Free Software Foundation, either version 3 of
-
the License, or (at your option) any later version.
-
-
This program is distributed in the hope that it will be useful, but
-
WITHOUT ANY WARRANTY; without even the implied warranty of
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-
Affero General Public License for more details.
-
-
You should have received a copy of the GNU Affero General Public
-
License along with this program. If not, see
-
<http://www.gnu.org/licenses/>.
-
-
"""
-
-
from Osciloscope import UsbOsciloscope
-
from pylab import *
-
import time
-
-
o = UsbOsciloscope()
-
# Load the firmare into the osciloscope FPGA, this the RFB that comes in the USBI pack.
-
o.program()
-
# Enables both channels for sampling
-
o.set_channels()
-
-
while True:
-
# Start signal, it gets some other params like
-
# triggering configuration, port conf and a lot of other things
-
o.start_scan()
-
status = -1
-
while status != 0:
-
# Do the actual reading of a single frame
-
retval = o.get_data()
-
status = retval[0]
-
if status != 0:
-
# Since the buffers can be large and the according
-
# to the sampling rate we may need to wait a bit
-
time.sleep(0.01)
-
else:
-
# If we got the data successfully we can now plot what we got using
-
# matplot lib.
-
values = retval[5].dwNumValuesReturned
-
x_axis = arange(0,values,1)
-
plot(x_axis ,retval[2][0:values],‘r–’,x_axis,retval[3][0:values],‘bs’)
-
show()
-
Sep 11
Well, here is it, I will keep an eye on it before I add it some where in the page, anyway I’m far more
active on identi.ca than on pownce or jaiku, also I support more the ideas that identi.ca represents.
Also I changed the badges at the right of the blog for some flash based ones, one for Pownce
one for Jaiku, they good look good.
We’ll see with time how it evolves.
Aug 20
I have just fell in love with this image I found at ImgFave, which is a laconi.ca based place. Check Identi.ca to see the original place.

From the signature it looks it was written the year I was born, it just make me feel more in love with the message.
Feel free to copy and share it with everyone you know since this is the way it was passed to me and after a quick google it looks like it’s the overall intention of this message.
Enjoy! Seriously !
Aug 10
First take a look of the fancy xhtml formatted answers that Gajim + Jance can produce:
It’s time to announce the public Releace of Jance repository, it’s released under the GPL V3.0
and you can give a look to it here:
Valkertown Public Mercurial Repositories
If you want to checkout the source of Jance bot:
hg clone http://hg.valkertown.org/jance.hg/
The whole process of coding this bot have been very interesting and been part of my current research on using xmpp as the foundation of some of the instrumentation systems I design and implement, it’s looking good. I have been measuring the traffic it generates client-server, bot-server and with proper configuration an xmpp bot can be useful in a high-latency low-quality network that are the rule on several of the systems I design.
Send patches and bug reports to pownceATvalkertown.org, those are always welcome.
Enjoy!
Jul 29
Well I have just spent a couple of day writings a jabber bot that uses the Pownce api to interact with the site. It has been a fun experience, I will publish the mercurial repository of the repo as soon as I
solve this questions.
- Should I publish the Pownce App key and secret along with the code?
- If I do so, are rethere any security implications of doing that?
- I haven’t checked, but Pownce Apps Terms could have something to say
In the mean while you can play with the one running at valkertown. Just add pownce@valkertown.org to any Jabber roster and type help.
The ongoing documentation is on my home page.
I wrote the bot using Python, Twisted for the Jabber stuff, Oauth to talk with Pownce, YAML to store user data and JSON(simplejson) to extract data from Pownce answers.
Hapy Powncing
Jul 17
Well, from now on I’m going to open valkertown’s jabber server for public registration, will try to do my
best with this service but if it causes too much troubles I will close it again. It’s located at valkertown.org and you should use a jabber client to register the new account there
With time if it’s worth it I would set an public statistics page.
It features:
- Ejabberd server
- MSN transport
- MUC Rooms
- IRC transport (only to servers that runs on the standard irc port)
There’s a couple of conference rooms that are always there:
- general@conference.valkertown.org
- gclap@conference.valkertown.org.
While I have been runnign this server for some time now, I’m kinda new with open jabber servers so I would be happy to hear any tips or help to prevent abuse.
The server supports also http-bind (BOSH) method via https://www.valkertown.org/http-bind/
I’m trying to setup a good browser based http-bind client and host it here at valkertown but I think jwchat is horrible and haven’t been able to make webspark work with valkertown’s ejabberd. So if you know any good client that I could host here let me know.
I’m folllowing with great interest the people from chesspark and speeqe since they seem to have a great browser bosh client. So far they only have published the tools they created for the clients but those looks really promising.
EOP
Jun 18
How to prolong lithium-based batteries
Básicamente estas baterias no pierden su capacidad de carga por los
ciclos de descarga sino por la temperatura y el tiempo desde que las
fabrican.
En el documento hay una tabla muy interesante que muestra como pierde
capacidad la bateria en relación con la temperatura y el tiempo,
considerando la tabla y las temperaturas que reporta el sistema es
posible que uno termine con una bateria del 60% de la capacidad cada 3
meses de tenerla
en el portatil esto refuerza la recomendacion de los fabricantes de
retirar la bateria del computador si se va a estar pegado a la red
electrica todo el tiempo para
evitar que el computador caliente la bateria, por otra parte el hecho
de tener la bateria constantemente cargada empeora el asunto del
deterioro.
Se supone que si va a guardar la bateria es mejor hacerla con un 40%
de la carga y es conveniente enfriar la bateria a 0ºC.
Otra de las recomendaciones que me parece interesante es la de
realizar una descarga completa cada 30 ciclos de descarga para que el
sistema de monitoreo de
la bateria pueda recalibrarse.
Del otro portatil que tengo puedo decir que despues de casi un año y
medio de utilizarlo casi todo el tiempo en bajo consumo donde el
sistema se mantiene en unos 40ºC la bateria
se encuentra en el 40% de capacidad de carga nominal.
La última recomendacion que veo importante es fijarse en la fecha de
fabricación de la bateria de reemplazo y no comprar el repuesto antes
de necesitarlo realmente.
Estuvo interesante la investigación.
|
|
Recent Comments