Pretty priting json from command line
alias pp='python -mjson.tool'
http://ruslanspivak.com/2010/10/12/pretty-print-json-from-the-command-line/
alias pp='python -mjson.tool'
Posted by Dani 0 comments
Posted by Dani 1 comments
#!/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
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
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
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
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
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
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.