tag:blogger.com,1999:blog-174645952024-03-07T21:12:08.137+01:00Madre míaaaa, madre mía, madre mía QUE eh QUE!!!!Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.comBlogger373125tag:blogger.com,1999:blog-17464595.post-350432468930427022012-12-28T22:10:00.001+01:002012-12-28T22:10:05.234+01:00Pretty priting json from command line<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<pre style="background-color: #0c1021; border: 1px solid rgb(221, 221, 221); clear: both; color: #f8f8f8; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 8pt; line-height: 1.5em; margin-bottom: 1.833em; overflow: auto; padding: 0.667em 0.917em;"><span style="margin: 0px; padding: 0px;">alias</span> <span style="color: #ff6400; margin: 0px; padding: 0px;">pp</span>=<span style="color: #61ce3c; margin: 0px; padding: 0px;">'python -mjson.tool'</span></pre>
<br />
http://ruslanspivak.com/2010/10/12/pretty-print-json-from-the-command-line/</div>
Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-37042635392457553642012-12-28T11:22:00.000+01:002012-12-28T11:22:02.704+01:00Simple json parser for bash using python<div dir="ltr" style="text-align: left;" trbidi="on">
echo $YOUR_JSON_DATA | python -c "import json; import sys; data=json.load(sys.stdin); print data['results']"</div>
Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com1tag:blogger.com,1999:blog-17464595.post-57179059673331734192012-07-03T08:48:00.000+02:002012-07-03T08:48:34.180+02:00365<div dir="ltr" style="text-align: left;" trbidi="on">
<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/plMpa6mqW5o" width="560"></iframe></div>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com1tag:blogger.com,1999:blog-17464595.post-74621035953442459922012-06-01T19:26:00.000+02:002012-06-01T19:26:06.418+02:00334Nuevo disco<br><br>
<iframe width="560" height="315" src="http://www.youtube.com/embed/_EX5HGkeOOw" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-54393103552283764322012-03-25T11:38:00.000+02:002012-03-25T11:38:00.407+02:00266<p>Una cita</p>
<iframe width="560" height="315" src="http://www.youtube.com/embed/hHsnECVc_DE" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-47098152008704508752011-12-30T13:31:00.002+01:002011-12-30T13:31:38.502+01:00180<iframe width="560" height="315" src="http://www.youtube.com/embed/8xdO44DJQAQ" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com1tag:blogger.com,1999:blog-17464595.post-68830083187236677632011-11-12T10:30:00.001+01:002011-11-12T10:37:40.805+01:00132<p>"Vendrá el futuro a verte cualquiera de estos días..."</p>
<iframe width="420" height="315" src="http://www.youtube.com/embed/Omi1KMSqnzo" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-31921197645888170142011-10-29T11:52:00.000+02:002011-10-29T11:52:14.637+02:00118<p>Podría ser</p>
<iframe width="560" height="315" src="http://www.youtube.com/embed/tTJc-Pac694" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-45896461395435076562011-10-21T16:46:00.004+02:002011-10-21T17:00:14.769+02:00Notes - Giving more stability to the mood lamp<div style="text-align: justify;">I had some troubles setting up supervised process for the python binary running <a href="http://translate.google.com/translate?hl=en&sl=es&tl=en&u=http%3A%2F%2Fmadremiamadremiaque.blogspot.com%2F2011%2F02%2Fmidiendo-el-animo-del-mundo.html">the mood lamp</a>, I guess it might be related with the fact that python is also calling gnuplot subprocess via os.system call, and <a href="http://cr.yp.to/daemontools.html">daemontools</a> might be a bit lost with that (not sure).<br /><br />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:<br /></div><br /><div><span class="Apple-style-span" style="line-height: 19px;font-family:sans-serif;font-size:13px;" ><pre style="padding: 1em; border: 1px dashed rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em;"><span style="font-size:100%;">#!/bin/bash<br />CRASH_COUNTER=0<br />while : ; do<br />python ./animo_mundial.py<br />let CRASH_COUNTER=$CRASH_COUNTER+1<br />echo $CRASH_COUNTER > /tmp/animo_crash_counter.txt<br />sleep 10<br />done</span><br /></pre></span></div>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-10925936290481284922011-10-01T22:04:00.002+02:002011-10-01T22:07:00.130+02:00Notes - Have seti@home graphics working with ubuntusudo xhost +si:localuser:boinc<br /><br />this command in your System-Preferences-Sessions-Startup Programs:<br />/usr/bin/xhost +local:<br />If you want to run it at start up<br /><br />sudo xhost +si:localuser:boincDanihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-25270960628620609152011-09-30T22:23:00.001+02:002011-09-30T22:23:32.475+02:0089<iframe width="420" height="315" src="http://www.youtube.com/embed/mYPCYboEpmk" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-67220740073758217272011-09-19T21:23:00.002+02:002011-09-19T21:28:48.554+02:00Notes - Adding stability improvements to the mood lampIf 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<br /><br />service dropbox start<br /><br />bash -c '/usr/bin/screen -dmS minic minicom -o'<br /><br />#this is if you put some services with symlink under /service<br /><br />#svscanboot will run them, but Im not using them form now<br />csh -cf '/command/svscanboot &'<br /><br />#main soft running supervised and under a screen terminal<br />bash -c '/usr/bin/screen -dmS lamp supervise /home/me/scripts/animo'Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-37240251980996111382011-09-16T18:40:00.003+02:002011-09-16T19:25:00.399+02:00Notes - Web scrapping ajax obfuscated websitesIm 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.<br />Just wanted to write this note so I don't forget the pipes that I'm doing. :)<br /><br />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.<br /><br />To get the source code in python use:<br />data = sel.get_html_source()<br /><br />if you're using perl:<br />my $data=$sel->get_html_source();Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com1tag:blogger.com,1999:blog-17464595.post-38070763315473128682011-09-11T19:44:00.001+02:002011-09-11T19:45:29.927+02:00Notes - Monitor an event and send email when it occourstail -f /var/log/messages | awk '/now/ {system("mail -s 'hi' myemail@mydomain.com < /dev/null")}'<br /><br />interesting for /var/log/auth for example...Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-88129573962123340162011-09-11T19:23:00.000+02:002011-09-11T19:24:37.741+02:00Notes - Record shell session for later replay (educational use)script -t 2> tutorial.timing -a tutorial.session<br />type ‘exit’ to end the recording.<br /><br />Replay goes like this<br />scriptreplay tutorial.timing tutorial.sessionDanihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com1tag:blogger.com,1999:blog-17464595.post-49707472181451432702011-09-11T19:07:00.002+02:002011-09-11T19:09:12.293+02:00Notes - How to create an encrypted tartar -zcvf -stuff | openssl des3 -salt -k secret_pass | dd of=stuff.des3<div><br /></div><div>didn't try it, juts took it from old notes.</div>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com1tag:blogger.com,1999:blog-17464595.post-8064488241128410642011-09-10T21:12:00.003+02:002011-09-10T22:10:35.088+02:00workaround for skype without headphones on ubuntu lucid 64<div style="text-align: justify;">I was having some issues with skype and making it work in Ubuntu without using headphones. My monitor has built in camera and microphone that makes much more easy any videoconference.</div><div style="text-align: justify;">The main issue was a kind of strange noise mixed with the output sound and incoming video not appearing.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">So for the first issue, the strange noise, I had to disable pulseaudio by:</div><div style="text-align: justify;">creating a client.conf in your .pulse dir in ~ and put the line "autospawn=no" in it. It would be good to turn back on autospawn after you have done what you need to do.</div><div style="text-align: justify;">source: http://askubuntu.com/questions/8425/how-to-temporarily-disable-pulseaudio</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">To enable incoming video make sure cairo-dock is disabled, for some reason there is a bug that makes it interfere with X11 and skype.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">But when re-running pulseaudio to get all controls back I get missing options, that I cannot figure out yet how to get, didnt spent more time on it, as this is an skype issue. Gmail video web conference have no problem at all with pulseaudio.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">dani@mypc:~$ /usr/bin/pulseaudio --start --log-target=syslog</div><div style="text-align: justify;">dani@mypc:~$ start-pulseaudio-x11</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">So had to comment out again the autospawn so pulse audio spawn during boot. At least useful to know it if someday for some reason you need to use skype.</div>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-37050634925456738062011-09-06T21:05:00.002+02:002011-09-06T21:09:56.109+02:00Installing Latex gui Lyx from sourcesudo su<br />aptitude install build-essential libqt4-dev libaspell-dev<br />cd /usr/local/src/<br />wget ftp://ftp.lyx.org/pub/lyx/stable/2.0.x/lyx-2.0.0.tar.gz<br />gzip -dc lyx-2.0.0.tar.gz | tar xf -<br />cd lyx-2.0.0<br />./configure<br />make<br />make install<br />apt-get install texlive-latex-extraDanihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-47316924231150966562011-09-06T20:36:00.001+02:002011-09-06T20:36:44.393+02:0065<iframe width="420" height="345" src="http://www.youtube.com/embed/FNGGhuKd7eo" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-87131999031981917322011-09-04T16:58:00.002+02:002011-09-04T17:17:12.786+02:00Installing ubuntu from Internet via usb keyDammit, 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.
<br />
<br />Got the netboot.tar.gz file from:
<br />http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/
<br />
<br />and then wrote it to a usb key with imagewriter
<br />sudo apt-get install usb-imagewriter
<br />sudo usb-imagewriter
<br />info from:
<br />https://help.ubuntu.com/community/Installation/FromImgFiles
<br />
<br />boot from usb and installDanihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-86285160450854884912011-08-24T16:27:00.001+02:002011-08-24T16:31:28.463+02:0052<iframe width="420" height="345" src="http://www.youtube.com/embed/Mxv53UiyIHQ" frameborder="0" allowfullscreen></iframe>
<br />Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com1tag:blogger.com,1999:blog-17464595.post-20075087233053844292011-08-15T16:46:00.005+02:002011-08-15T16:56:36.272+02:0043"Im not going to say Science is rock and roll, but Science rocks.."
<br />
<br /><iframe width="560" height="349" src="http://www.youtube.com/embed/vYuOKb3gO7E" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-71247165566874973342011-08-11T19:43:00.003+02:002011-08-11T20:12:57.182+02:0039<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1CqNF_vXmnRJDN1XenVpf5E3V9r0hRNkpEGzNJPQPpYCyyQoSWIZrZbPsSjpRPd89sW0PcJjizW0005k3e-mrTiB8AjH5_Pu_OQV_PGb_OMKtOc7DkNyCxkCMMp4GQd2ruvUF/s1600/dani.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 287px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1CqNF_vXmnRJDN1XenVpf5E3V9r0hRNkpEGzNJPQPpYCyyQoSWIZrZbPsSjpRPd89sW0PcJjizW0005k3e-mrTiB8AjH5_Pu_OQV_PGb_OMKtOc7DkNyCxkCMMp4GQd2ruvUF/s400/dani.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5639655564737819618" /></a>
<br />Creo que se me han perdido unas piezas, no te las llevarías?
<br />
<br /><object width="250" height="40"><param name="movie" value="http://grooveshark.com/songWidget.swf" /><param name="wmode" value="window" /><param name="allowScriptAccess" value="always" /><param name="flashvars" value="hostname=cowbell.grooveshark.com&songIDs=32247854&style=metal&p=0" /><embed src="http://grooveshark.com/songWidget.swf" type="application/x-shockwave-flash" width="250" height="40" flashvars="hostname=cowbell.grooveshark.com&songIDs=32247854&style=metal&p=0" allowScriptAccess="always" wmode="window" /></object>
<br />Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-40666756177457351162011-08-06T22:33:00.001+02:002011-08-06T22:43:42.886+02:00Belle nuit<iframe width="425" height="349" src="http://www.youtube.com/embed/_g1emBGM5nM" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0tag:blogger.com,1999:blog-17464595.post-24239455352042320342011-08-04T21:26:00.000+02:002011-08-04T21:30:28.847+02:0032<iframe width="425" height="349" src="http://www.youtube.com/embed/XTGyeGgMpk8" frameborder="0" allowfullscreen></iframe>Danihttp://www.blogger.com/profile/12808681592189175279noreply@blogger.com0