Sunday, March 18, 2018

Facebook March 2018: Can't Load URL: The domain of this URL isn't included in the app's domains

In March 2018 Facebook will invalidate calls from URIs not listed in the Valid OAuth redirect URIs requiring us to Enable Strict Mode for Redirect URIs.

If you tried all the solutions available googling about it without success you can try this fix too.

To fix this problem 

a) Update and Enable Strict Mode and HTTPS in the app's settings.
b) Add in the app settings the valid OAuth redirect URIs the URL used to interact with Facebook SDK. 
c) Change this piece of code:

$accessToken = $helper->getAccessToken();


In:

$accessToken = $helper->getAccessToken('myurl_callback');
    } catch(Facebook\Exceptions\FacebookResponseException $e) {
...
}

That's all, this fixed the problem.


Read more...

Monday, September 19, 2016

How to access git using a key pair



The following method will help you accessing your repository using a keypair file. 
This could be usefull when you are using Amazon server with a keypair file without a password otherwise you don't need to follow this guide.

1) Upload/Copy the keypair file (.pem) on your  ~/.ssh/ directory

$ cp cert.pem  ~/.ssh/.

2) Move on your ssh directory and change the permissions on the file

$ chmod 400 cert.pem

3) Create or update your  ~/.ssh/config file

$ nano  ~/.ssh/config

4) Copy and update the rows below with the correct hostname, user and identifyfile:

Host git
Hostname www.example.com
User ubuntu
IdentityFile /pathtossh/ssh/cert.pem

5) Clone the repository

$ git clone git:/path/to/remoteproject/repository.git

Done!

If you need to copy and overwrite the entire cloned project inside another directory you could you the command below:

$ \cp -R source destination

To update your projects and use the new address you need to open the project's git config file

$ nano ~/path/to/remoteproject/.git/config 

After that you have to change the url line:

git:path/to/remoteproject/repository.git





Read more...

Sunday, June 26, 2016

Fix TImezone on RDS Mysql MariaDB

In this post i will explain the steps to fix the timezone UTC "issue" on RDS (if we can call it an issue...). If you need to do that you have to follow this guide. I used MariaDB as mysql fully compatible database.

1) Connect to your RDS instance via shell or client

2) Create the following stored procedure 
DELIMITER | CREATE PROCEDURE mysql.store_time_zone () IF NOT (POSITION('rdsadmin@' IN CURRENT_USER()) = 1) THEN SET SESSION time_zone = 'Europe/Rome'; END IF | DELIMITER ; 

3) Grant permission to the user 
GRANT EXECUTE ON PROCEDURE `mysql`.`store_time_zone` TO 'usersql'@'%'; 

4) Create a new parameter group with eg. Timezonefix 

5) In the search bar search for "init_connect" 

6) Insert the following value: CALL mysql.store_time_zone 

7) Go to your rds instance and modify it selecting the new parameters group 

8) Apply immediatly 

9) Reboot your instance and the job is done.


Read more...

Thursday, May 8, 2014

Parallels Plesk Can't Create/Write to file /tmp/#sql_ MYD (Errcode 17)

To fix this error on parallel plesk, you need to remove the /tmp/#sql_xxx.MYD file from the tmp directory in your root.


Read more...

Saturday, April 5, 2014

SSH exchange identification: Connection closed by remote host [Solved]

If you will face this problem when connecting through ssh:
SSH exchange identification: Connection closed by remote host.
Maybe your server was under a brute force attack. To solve this problem in an easy way you could install denyhosts. On Centos server yum install denyhosts. Edit /etc/hosts.allow and insert the IP that you never want to block. Edit /etc/denyhosts.conf and check your distribution default conf. After that, simply start denyhosts service denyshosts start Stay tuned.


Read more...