Notas de la sección: Sin categoría

Problema en CakePHP Test AJAX con TestAction

Aparentemente, en la versión 2.7.1 se cambió la línea 376 del la clase AuthComponent en el archivo lib/Cake/Controller/Component/AuthComponent.php

Se cambió la línea 376:

$controller->redirect(null, 403);

Por estas líneas:


Este cambio provoca que fallen los test que se realizan con



Una alternativa para solucionar el problema es hacer un mock del componente Auth

$Post = $this->generate('Post', array(
 'components' => array(

Y devolver true en el método startup



Keeping a process or command running after terminal has been closed

  1. Open ssh terminal to remote server
  2. Begin scp transfer as usual
  3. Background the scp process (Ctrl+Z, then bg)
  4. Disown the backgrounded process (disown)
  5. Terminate the session (exit) and the process will continue to run on the remote machine.

Change the default SSH port o Cambiar el puerto por defecto de SSH

Step 1

As root, use your favorite text editor (vi) to edit the sshd configuration file.
vi /etc/ssh/sshd_config


Step 2

Edit the line which states ‘Port 22’. But before doing so, you’ll want to read the note below. Choose an appropriate port, also making sure it not currently used on the system.

# What ports, IPs and protocols we listen for
Port 50683


Step 3

Switch over to the new port by restarting SSH.
/etc/init.d/ssh restart


Step 4

Verify SSH is listening on the new port by connecting to it. Note how the port number now needs to be declared.
ssh -p 50683


Agregar Directorio en Sentora o ZPanel

So, go to /etc/zpanel/configs/apache/

Edit httpd-vhosts.conf and check OpenBasedir directives in first <VirtualHost *:80> entry (first one should be panel’s vhost). If it’s not for some wierd reason, find it and remove line that looks like:

php_admin_value open_basedir «/var/zpanel/hostdata/USER/public_html/DOMAIN:/var/zpanel/temp/ etc.»

# service apache2 reload

Ionic Network Error

Running Ionic with Genymotion, you might run into network issues when trying to run your application in your Genymotion device VM. The one I got was :

Application Error
There was a network error (

when trying to launch my app on the device. It wasn’t a firewall issue, i was successfuly able to ping my host machine from Chrome within the device. Ran some debugging from within Android Studio and saw that:

04-25 16:10:45.960  14405-14433/com.exam.examinous W/SystemWebViewClient﹕ URL blocked by whitelist:

It turns out that with Cordova 5 and Ionic 1.3 you :

─$ cordova -v
─$ ionic -v

You need to add the Cordova Whitelist Plugin

ionic plugin add

and rebuild, that should set you.

Also if you’re running into this error when trying to add a plugin:

SyntaxError: Unexpected token }
at Object.parse (native)
at getJson (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:29:31)
at Object.exports.save_fetch_metadata (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/metadata.js:56:24)

then check your plugins/fetch.json file for extra brackets.

Permitir CORS en Apache / Enable CORS on Apache



To add the CORS authorization to the header using Apache, simply add the following line inside either the <Directory>, <Location>, <Files> or <VirtualHost> sections of your server config (usually located in a *.conf file, such as httpd.conf or apache.conf), or within a .htaccess file:

  Header set Access-Control-Allow-Origin "*"

To ensure that your changes are correct, it is strongly reccomended that you use

apachectl -t

to check your configuration changes for errors. After this passes, you may need to reload Apache to make sure your changes are applied by running the command

sudo service apache2 reload


apachectl -k graceful


Altering headers requires the use of mod_headers. Mod_headers is enabled by default in Apache, however, you may want to ensure it’s enabled by run

a2enmod headers

Note: you can also use add rather than set, but be aware that add can add the header multiple times, so it’s likely safer to use set.

A %d blogueros les gusta esto: