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'

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();

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...

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

Notes - How to create an encrypted tar

tar -zcvf -stuff | openssl des3 -salt -k secret_pass | dd of=stuff.des3

didn't try it, juts took it from old notes.

Saturday, September 10, 2011

workaround for skype without headphones on ubuntu lucid 64

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.
The main issue was a kind of strange noise mixed with the output sound and incoming video not appearing.

So for the first issue, the strange noise, I had to disable pulseaudio by:
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.
source: http://askubuntu.com/questions/8425/how-to-temporarily-disable-pulseaudio

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.

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.

dani@mypc:~$ /usr/bin/pulseaudio --start --log-target=syslog
dani@mypc:~$ start-pulseaudio-x11

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.

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

65

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