Wednesday, October 14, 2015

Thursday, September 10, 2015

Great JS frameworks infographic

Here is a great infographic that is very useful when choosing an adequate JS framework for your projects: http://www.webdesigndegreecenter.org/choosing-javascript-framework/

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 installing gnureadline

I was getting the following error gen trying to install gnureadline via pip:

collect2: error: ld returned 1 exit status

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/gnureadline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1_fHxP-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/gnureadline
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/pip/__main__.py", line 5, in <module>
    exit = run()
  File "/usr/lib/python2.7/dist-packages/pip/runner.py", line 12, in run
    return pip.main()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 235, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 66: ordinal not in range(128)

Turns out that is an issue generated by the use of older versions of pip: https://github.com/pypa/pip/issues/2667

The the version of pip in my server was 1.5.4 so I updated it:

sudo python -m pip install --upgrade pip
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-7.1.2-py2.py3-none-any.whl#md5=5ff9fec0be479e4e36df467556deed4d
  Downloading pip-7.1.2-py2.py3-none-any.whl (1.1MB): 1.1MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.4
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed pip
Cleaning up...

Mine was a new server so I installed some needed common libs: http://stackoverflow.com/questions/31508762/exception-using-pip-install

sudo apt-get install libffi-dev libssl-dev libxml2-dev libxslt1-dev libncurses5-dev

Then I tried to install gnureadline again and everything worked fine :)

Monday, July 13, 2015

Error installing MySQL-python on OSX

Tring to install mysql-python:

sudo python -m pip install MySQL-python



I was getting the error:

    sh: mysql_config: command not found

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/Applications/XAMPP/xamppfiles/htdocs/associate-fork-jhon-venv/build/MySQL-python/setup.py", line 17, in <module>

    metadata, options = get_config()

  File "setup_posix.py", line 43, in get_config

    libs = mysql_config("libs_r")

  File "setup_posix.py", line 25, in mysql_config

    raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found



I solved the issue running:

brew install mysql


Reference:

Thursday, January 29, 2015

Monday, January 26, 2015

Heroku: enable gzip compression

Add to your .htaccess file:

##################### GZIP COMPRESSION #####################

SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-phpBrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
Header append Vary User-Agent env=!dont-vary

Reference:
http://stackoverflow.com/questions/12367858/how-can-i-get-apache-gzip-compression-to-work