Friday, December 30, 2011
Saturday, November 12, 2011
Saturday, October 29, 2011
Friday, October 21, 2011
Notes - Giving more stability to the mood lamp
So in order to have the binary running more stable and making it strong against spurious crashes I did a little script that is running under a screen session:
#!/bin/bash
CRASH_COUNTER=0
while : ; do
python ./animo_mundial.py
let CRASH_COUNTER=$CRASH_COUNTER+1
echo $CRASH_COUNTER > /tmp/animo_crash_counter.txt
sleep 10
done
Posted by Dani 0 comments
Saturday, October 01, 2011
Notes - Have seti@home graphics working with ubuntu
sudo xhost +si:localuser:boinc
this command in your System-Preferences-Sessions-Startup Programs:
/usr/bin/xhost +local:
If you want to run it at start up
sudo xhost +si:localuser:boinc
Posted by Dani 0 comments
Friday, September 30, 2011
Monday, September 19, 2011
Notes - Adding stability improvements to the mood lamp
If yo want to store chart data for public serving, It's necessary to have dropbox running, due to encryption issues maybe if you reboot your computer it will not run until you log in and mount your home so first thing run dropbox
service dropbox start
bash -c '/usr/bin/screen -dmS minic minicom -o'
#this is if you put some services with symlink under /service
#svscanboot will run them, but Im not using them form now
csh -cf '/command/svscanboot &'
#main soft running supervised and under a screen terminal
bash -c '/usr/bin/screen -dmS lamp supervise /home/me/scripts/animo'
Posted by Dani 0 comments
Friday, September 16, 2011
Notes - Web scrapping ajax obfuscated websites
Im using a perl script that calls selenium server, then I use Beautiful soup to nicely parse the rendered output coming from selenium. Probably using webkit could be done more nicely but this way is easy and quick to setup.
Just wanted to write this note so I don't forget the pipes that I'm doing. :)
Really it is not needed to get data first with perl, rc selenium export to python (Remote Control) it is enough later to get the source and parse it.
To get the source code in python use:
data = sel.get_html_source()
if you're using perl:
my $data=$sel->get_html_source();
Posted by Dani 1 comments
Sunday, September 11, 2011
Notes - Monitor an event and send email when it occours
tail -f /var/log/messages | awk '/now/ {system("mail -s 'hi' myemail@mydomain.com < /dev/null")}'
interesting for /var/log/auth for example...
Posted by Dani 0 comments
Notes - Record shell session for later replay (educational use)
script -t 2> tutorial.timing -a tutorial.session
type ‘exit’ to end the recording.
Replay goes like this
scriptreplay tutorial.timing tutorial.session
Posted by Dani 1 comments
Notes - How to create an encrypted tar
tar -zcvf -stuff | openssl des3 -salt -k secret_pass | dd of=stuff.des3
Posted by Dani 1 comments
Saturday, September 10, 2011
workaround for skype without headphones on ubuntu lucid 64
Posted by Dani 0 comments
Tuesday, September 06, 2011
Installing Latex gui Lyx from source
sudo su
aptitude install build-essential libqt4-dev libaspell-dev
cd /usr/local/src/
wget ftp://ftp.lyx.org/pub/lyx/stable/2.0.x/lyx-2.0.0.tar.gz
gzip -dc lyx-2.0.0.tar.gz | tar xf -
cd lyx-2.0.0
./configure
make
make install
apt-get install texlive-latex-extra
Posted by Dani 0 comments
Sunday, September 04, 2011
Installing ubuntu from Internet via usb key
Dammit, after 2 weeks vacations without using my main desktop pc, ubuntu natty stopped working. Don't have time to troubleshoot, so rolling back to LTS lucid.
Got the netboot.tar.gz file from:
http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/
and then wrote it to a usb key with imagewriter
sudo apt-get install usb-imagewriter
sudo usb-imagewriter
info from:
https://help.ubuntu.com/community/Installation/FromImgFiles
boot from usb and install
Posted by Dani 0 comments
Wednesday, August 24, 2011
Monday, August 15, 2011
Thursday, August 11, 2011
Saturday, August 06, 2011
Thursday, August 04, 2011
Wednesday, August 03, 2011
Tuesday, August 02, 2011
Saturday, July 30, 2011
27
Posted by Dani 0 comments
Wednesday, July 27, 2011
Tuesday, July 26, 2011
Monday, July 25, 2011
22
Porque si decidiéramos irnos a algún lugar juntos me da miedo que un día… hoy no quizás… quizás… quizás mañana tampoco… pero un día de repente puede que empiece a llorar y llorar y llore tanto que nada ni nadie pueda pararme y que las lágrimas llenen la habitación y que me falte el aire y que te arrastre conmigo y que nos ahoguemos los dos.
Posted by Dani 0 comments
Saturday, July 23, 2011
Wednesday, July 20, 2011
Sunday, July 17, 2011
14
Saturday, July 16, 2011
Friday, July 15, 2011
Thursday, July 14, 2011
10
Día de la bastilla, puedo ver el minuto 4:38 , sólo verlo, pero se acerca.
Posted by Dani 0 comments
Tuesday, July 12, 2011
Monday, July 11, 2011
8
Posted by Dani 0 comments
Sunday, July 10, 2011
Saturday, July 09, 2011
Sin hijo, ni árbol, ni libro. Silvio Rodriguez
Los hombres sin historia son la historia. Apiádense del hombre que no tuvo ni hijo, ni árbol, ni libro.
Posted by Dani 0 comments
6
Posted by Dani 0 comments
Thursday, July 07, 2011
4
Posted by Dani 0 comments
Wednesday, July 06, 2011
3
Suena el desperador a las 5 y a las 6 en marcha, día movidito, a las 6 de vuelta. Hoy me he vuelto a encontrar con la mujer mayor del edificio y está vez me ha mirado cuando le decía Bonsoir y ha hecho un gesto con la cabeza como queriéndome devolver el saludo pero sin decir nada, no es normal, algo pasa. Un día de estos que venga más relajado me voy a poner a cantarle la canción del Monoprix y hacerle unos bailes, eso no fallará, seguro que reacciona. Y si eso no es sufiente la llevo a conocer a los que viven en el cesped con su sofá.
Los del sofá, grandes personajes, mayoritariamente se dedican a estar sentados en el sofá, beber cerveza de alta graduación y fumar, de vez en cuando piden algo de limosna pero no suele ser habitual verles salir de su pequeño parque público, si no es para comprar más cerveza.
Posted by Dani 1 comments
Tuesday, July 05, 2011
Un cuento chino, con Ricardo Darín
Para pasar el rato, basada en una historia real
Posted by Dani 1 comments
2
Por fín he podido conseguir un poco de Ice Tea el Monoprix, es genial para eso, el finde pasado di unas cuantas vueltas por el Carrefour y nada. La verdad que me agobia bastante ir al Carre, siempre tiene una mezcla de olores que me marean y suelo acabar abriendo las botellas de agua que compro antes de pagar en caja, no sé lo que pensarán los que me vean, no me importa.
Posted by Dani 0 comments
Monday, July 04, 2011
Día 1
Posted by Dani 0 comments
Sunday, July 03, 2011
The pursuit of happiness
- Hey
- Don't ever let somebody tell you: you can't do something
- Not even me
- All right?
- All right
- You got a dream...you gotta protect it. People can't do something themselves, they wanna tell you you can't do it. If you want something, go get it. Period.
Posted by Dani 1 comments
Cuidando de Lyon
Sentado enfrente del rio, la colina asoma por encima del palacio, los barcos siguen atracados esperando un cambio y el agua verdosa refleja con dificultades la luz del sol. El césped quemado por el sol sujeta a los pocos atrevidos que luchan por un espacio de sombra.
Posted by Dani 0 comments
La música amansa a las fieras
La parte técnica del blog está de vacaciones, durante un tiempo. Eso no quiere decir que yo esté descansando :-)
Sólo quería dejar unas líneas para recordar a Torito que como me contaban de pequeño seguramente esté ya en el limbo, o no.
Un yorkshire con corazón de niño mimado.
"If I get murdered in the city, don’t go revengin in my name. One person dead from such is plenty, no need to go get locked away. When I leave your arms, the things that I think of, no need to get over alarmed. I’m comin home. I wonder which brother is better. Which one our parents love the most. I sure did get in lots of trouble. They seemed to let the other go. A tear fell from my father’s eyes. I wondered what my dad would say. He said I love you, and I’m proud of you both, in so many different ways. If I get murdered in the city, go read the letter in my desk. Don’t worry with all my belongings, but pay attention to the list. Make sure my sister knows I loved her. Make sure my mother knows the same. Always remember, there is nothing worth sharing, like the love that let us share our name. Always remember, there is nothing worth sharing, like the love that let us share our name"
Posted by Dani 0 comments
Saturday, July 02, 2011
No sabes cuánto te he querido - Paco Bello
No sabes cuanto te he querido,
olvidarte es saber que no hay forma,
ahora tengo que aprender a desnombrarte,
con los ojos más que con la boca.
Sigues siendo la dueña,
del gigante que se esconde en mi silencio.
Has cambiado mi forma de mirar,
has cambiado el sentido de las calles
Caminar sin ti, no es del todo andar
has llenado los semáforos de sangre.
No me morire, pero ya verás,
como no sabré esquivar los vientos que te nombran
No me cansaré, de pensar que estás,
a mi lado pero no como una sombra.
Y no sabes, que aún cocino para ti,
y no sabes, que dibujo tu perfil con las frases,
que hace tiempo te escribí. Con las frases,
que ahora estallan junto a mi.
Y no sabes, que no debes sonreir,
no me abraces, que no sabré salir de los besos,
que de pronto no me das, de este fuego
que me alumbra, cuando no estás.
Has cambiado mi forma de mirar,
has cambiado el sentido de las calles
Caminar sin ti, no es del todo andar
has llenado los semáforos de sangre.
No me morire, pero ya verás,
como no sabré esquivar los vientos que te nombran
No me cansaré, de pensar que estás,
a mi lado pero no como una sombra.
via: http://miqueridopinwino.blogspot.com/
Posted by Dani 0 comments
Wednesday, June 08, 2011
Saturday, June 04, 2011
Configuring extras for mythtv after building from svn repository
By the way checkinstall is very cool.
110 ./configure --prefix=/usr/local
111 apt-get install install fftw2 fftw2-devel libtaglib-devel flac-devel libcdaudio-devel SDL-devel cdparanoia-devel
112 sudo apt-get install libmad0-dev libvorbis-dev libflac-dev libcdaudio-dev libcdparanoia0-dev libtag1-dev
113 sudo apt-get install fftw3-dev libsdl1.2-dev
114 apt-get install libfaad2-dev libmp4v2-dev
115 apt-get install libtiff-dev libexif-dev
116 apt-get install libmysqlclient15-dev
117 apt-get install libxml-sax-perl libxml-simple-perl libxml-libxml-perl libdate-manip-perl libsoap-lite-perl libimage-size-perl
118 ./configure --prefix=/usr/local
119 apt-get install python-lxml
120 ./configure --prefix=/usr/local
121 apt-get install mythxmal
122 apt-get install mythxml
123 apt-get install lxml
124 apt-get install libmyth-python
125*
126 ./configure --prefix=/usr/
127 apt-get install python-4suite-xml
128 ./configure --prefix=/usr/
129 ./configure --prefix=/usr/local
130 apt-get remove python-4suite-xml
131 apt-get install libxml-xpath-perl
132 ./configure --prefix=/usr/local
133 apt-get install libtimedate-perl
134 ./configure --prefix=/usr/local
135 apt-get install libdatetime-format-iso8601-perl
136 ./configure --prefix=/usr/local
137 make -j3
138 checkinstall
139 apt-get install checkinstall
140 checkinstall
Posted by Dani 1 comments
Friday, June 03, 2011
Thursday, June 02, 2011
Compiling kernel from ubuntu
http://buildall.wordpress.com/2011/04/17/installing-kernel-2-6-38-3-in-the-ubuntu-10-10/
Posted by Dani 0 comments
Sunday, April 17, 2011
script - checking Betamax rates with a cronjob
This little script can be extended or modified with your own sip providers. It is useful for me to keep and eye open with one of the providers that I'm currently using.
#!/bin/bashLAST_RATE=$(cat ./md5_12voip.txt | awk '{print $1}')lynx --dump http://www.12voip.com/en/calling-rates.html | \
grep -E 'Sweden|Spain' | md5sum > ./md5_12voip.txtNOW_RATE=$(cat ./md5_12voip.txt | awk '{print $1}')if [ $LAST_RATE = $NOW_RATE ]; thenecho "no change on rates"elseexport DISPLAY=:0 && zenity --info --text 'Betamax 12voip rates changed \
for Sweden or Spain, check page: http://www.12voip.com/en/calling-rates.html'fi
Posted by Dani 0 comments
Monday, April 04, 2011
Setting up services on la Fonera / Accton MR3201A
- VPN server (pptp)
- Firewall (iptables)
- Voice over ip and PBX (Asterisk)
- IRC bouncer (miau)
- Bandwidth monitor (bwm)
- Samba client (cifs)
- Ssh server (dropbear)
- Mail server (ssmtp)
- Wireless router (wireless-tools)
Posted by Dani 1 comments
Sunday, February 27, 2011
Abriendo las puertas de Internet
Posted by Dani 1 comments
Sunday, February 06, 2011
Midiendo el ánimo del mundo
Así que hace unas semanas me decidí a medir el ánimo mundial basándome en estudios ya comenzados relativos a ésta materia, registrando los eventos más importantes y dando un clima más cálido a la casa, mezclando hardware y software libre con sentimientos reales de personas.
class TipoAnimo: |
AMOR=0 |
ALEGRIA=1 |
SORPRESA=2 |
IRA=3 |
ENVIDIA=4 |
TRISTEZA=5 |
MIEDO=6 |
NUM_TIPOS_ANIMO = 7 |
AMOR_QUERY = '\"te+quiero+mucho\"+OR+\"te+quiero+más\"+OR+\"amo+tanto\"+[...] |
IRA_QUERY='\"te+odio\"+OR+\"siento+rabia\"+OR+\"le+odio\"+OR+\"estoy+furioso\"+[...] |
ALEGRIA_QUERY='\"mas+feliz\"+OR+\"bastante+feliz\"+OR+\"tan+feliz\"+OR+[...] |
SORPRESA_QUERY='\"no+me+lo+puedo+creer\"+OR+\"increible\"+OR+\"asombro\"+OR+[... |
ENVIDIA_QUERY='\"ambiciono\"+OR+\"codicio\"+OR+\"mucha+envidia\"+OR+[...]
|
TRISTEZA_QUERY='\"muy+triste\"+OR+\"tan+deprimido\"+OR+\"estoy+llorando\"+OR+[...] |
MIEDO_QUERY='\"muy+asustado\"+OR+\"tan+asustada\"+OR+\"realmente+asustado\"+OR+[...] |
def parse_tps(animoID): |
print 'query_dict[animoID]= '+query_dict[animoID] |
#query can be done either json or atom |
base_url='http://search.twitter.com/search.json?q='+query_dict[animoID]+'&rpp=30&locale=es&result_type=recent' |
f = 0 |
try: |
f = urllib2.urlopen(base_url) |
except urllib2.URLError, (err): |
print "URL error(%s)" % (err) |
if (f != 0): |
a = json.loads(f.read()) |
#debug |
#todo keep the msg if somethings happens |
b = json.dumps(a, sort_keys=True, indent=4) |
first_tw_time = a['results'][0]['created_at'] |
last_tw_time= a['results'][29]['created_at'] |
tstart = time_string_to_stamp(first_tw_time) |
tend = time_string_to_stamp(last_tw_time) |
tps = 30 / (tstart - tend) |
else: |
print 'We shouldnt be here, as this is bad' |
tps= c.all_tpm[animoID] / 60 #If we cannot get value from http we keep the old one |
#returning the tweets per second and all the message just in case we have an alert |
return tps,b |
#aplicamos exponential moving averages |
self.animo_mundial_avg[animoID] = self.animo_mundial_avg[animoID] * (1 - a) + tpm * a |
#debug print 'timestamp: '+str(self.timestamp)+' animo at T '+str(self.animo_mundial_avg) |
for i in range(NUM_TIPOS_ANIMO): |
self.ratios_temperamento[i] = self.ratios_temperamento[i] * (1 - a) + self.ratios_animo_mundial[i] * a |
enum COLORID { |
ROSA = 0, |
AMARILLO, |
NARANJA, |
ROJO, |
VERDE, |
AZUL, |
BLANCO, |
NUM_COLORS, |
}; |
for (int numflashes = 5; numflashes >= 0; numflashes-=1){ |
analogWrite(RED_LED_PIN,0); |
analogWrite(GREEN_LED_PIN,0); |
analogWrite(BLUE_LED_PIN,0); |
delay(1000); |
analogWrite(RED_LED_PIN,Colors[lastcolorID].r); |
analogWrite(GREEN_LED_PIN,Colors[lastcolorID].g); |
analogWrite(BLUE_LED_PIN,Colors[lastcolorID].b); |
delay(1000); |
} |
Actualizaciones:
Dic. 2013 - Añadido soporte para la API 1.1 de twitter search
Posted by Dani 19 comments