martes 18 de octubre de 2011

Ubuntu 11 : fatal error: libxml/xmlversion.h: No such file or directory

ERROR: /bin/sh: xslt-config: not found

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
In file included from src/lxml/lxml.etree.c:239:0:
src/lxml/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

Solution



sudo apt-get install libxml2-dev libxslt-dev

domingo 16 de octubre de 2011

OpenWRT allow remote ssh access


Allow ssh access from port 12345:

shell>/usr/sbin/iptables -I INPUT 1 -p tcp --dport 12345 -j LOG
shell>/usr/sbin/iptables -I INPUT 1 -p tcp --dport 12345 -j ACCEPT
To check if it loads properly -
shell>/usr/sbin/iptables -L | grep 12345
LOG tcp -- anywhere anywhere tcp dpt:12345 LOG level warning
ACCEPT tcp -- anywhere anywhere tcp dpt:12345
I you want to mantain changes Persistently:
shell>nvram set rc_firewall="/usr/sbin/iptables -I INPUT 1 -p tcp --dport 12345 -j LOG"
shell>nvram set rc_firewall="/usr/sbin/iptables -I INPUT 1 -p tcp --dport 12345 -j ACCEPT"

miércoles 5 de octubre de 2011

Ccreate and apply a patch - Subversion

This is not recommended way to merge code with svn! 
 What are diff files ?
A diff file is the difference between a version of the source code in the repository and a working copy. It represents any changes, such as additional features or bug fixes, that have been made by a developer in a working copy. A diff file is generated using the svn diff command. To create a patch:
svn diff > svn_patch.diff
To apply the patch
patch -p0 -i svn_patch.diff


wath is patch command? 
patch takes a patch file patchfile containing a difference listing produced by the diff program and applies those differences to one or more original files, producing patched versions.

what -pX parameter means? 
 -pnum or --strip=num Strip the smallest prefix containing num leading slashes from each file name found in the patch file. A sequence of one or more adjacent slashes is counted as a single slash. This controls how file names found in the patch file are treated, in case you keep your files in a different directory than the person who sent out the patch. For example, supposing the file name in the patch file was.
 what -i parameter means?
 -i patchfile or --input=patchfile Read the patch from patchfile. If patchfile is -, read from standard input, the default.

lunes 18 de julio de 2011

python setup.py howto uninstall (linux)


You need to remove all files manually :(
Just two commands :
python setup.py install files_to_delete
cat files_to_delete | xargs rm -rf

miércoles 8 de junio de 2011

URL Regular Expression

This regular expression matches any internet URLs, very useful!

string pattern = @"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+\-=\\\.&]*)"

viernes 3 de junio de 2011

SOLVED!! Ubuntu 11.04 (Natty Narwhal) 64bits and flash problems

Download flash player 64bits beta for linux from here :

Adobe Labs Download

Quick link : Download plug-in for 64-bit Linux (TAR.GZ, 4.1 MB)

tar -xvzf flashplayer10_2_p3_64bit_linux_111710.tar.gz
sudo cp libflashplayer.so /usr/lib/mozilla/plugins/

if in firefox dont works, try to check plugins at tools->add-ons, then plugins. I had two flash plugins, after disabling the old one flash was working!




for chromium

sudo cp libflashplayer.so /usr/lib/chromium-browser/plugins

jueves 26 de mayo de 2011

Tutorial : Running a symfony project under Dotcloud



Dotcloud is under beta now, you can ask for one.

The main issue I got while try to run a symfony project was to change the root directory. Googling fot symfony and dotcloud didnt answers this...so I create this post.

Lets create a new project

dotcloud create your_symfony_project_name

Lets create the www and db
dotcloud deploy --type python your_symfony_project_name.www
dotcloud deploy --type python your_symfony_project_name.db

Now optionally, import the database. In this case I was using mysql
otcloud run your_symfony_project_name.db "cat > data.sql" < your_local_dump_file.sql
Before push your code to www, lets add nginx configuration for Symfony. create nginx.conf at web directory of your project with this:
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
  expires 7d;
  break;
}

location / {
  try_files $uri $uri/ /index.php;
}

#Remove this at production!!
location ^~ /frontend_dev.php/ {
  try_files $uri /frontend_dev.php;
}
Next step upload the symfony proyect PHP files.
dotcloud push your_symfony_project_name.www ~/your_symfony_project_name
Symfony needs the root directory to be in "web" so create "dotcloud_build.yml" in your aplication root directory with this:
www:
    approot: web
REMEBER: clear the symfony cache!! To clear cache:
dotcloud ssh your_symfony_project_name.www 
cd code
./symfony cache:clear

Thats all folks!
Google Analytics Alternative