Skip to content

Month: June 2021

Install PHP Xdebug on M1 Macbook Pro

Installing Xdebug on M1 MacBook Pro can be very tricky due to the CPU architecture changed.

This post will show how I install it on my machine:

  1. Make sure you install ur PHP through brew. For me, I have PHP v7.4.15 and perl v5.30.2 installed
  2. Install Xdebug with perl:
    arch -arm64 sudo pecl uninstall xdebug
  3. Locate the Xdebug path in your system. For me, it’s installed on /opt/homebrew/Cellar/[email protected]/7.4.15_1/pecl/20190902/xdebug.so
  4. Make sure xdebug.so is loaded correctly in php.ini. You can check the following block.
zend_extension="/opt/homebrew/Cellar/[email protected]/7.4.15_1/pecl/20190902/xdebug.so"
xdebug.mode=debug
xdebug.client_host=localhost
xdebug.client_port=9000

DONE~
You may start using Xdebug to debug ur PHP application. =)

1 Comment

Fix Nextcloud login form Content Security Policy issue

I get the following error when my Nextcloud instance is hosted on a FreeNAS machine and it’s behind Nginx reverse proxy.

Refused to send form data to ‘http://cloud.example.com/’ because it violates the following Content Security Policy directive: “form-action ‘self’ cloud.example.com”.

It’s because the host is enabled with HTTPS, but the Nextcloud instance is running as HTTP behind the reverse proxy, thus Nextcloud itself doesn’t know it should run as HTTPS.

Solution

We can add the following line into config/config.php:

  'overwriteprotocol' => 'https',

Basically, it tells Nextcloud to run the instance as HTTPS. It perfectly resolved the problem, instead of struggling with the Nginx Content Security Policy directive.

My setup info

FreeNAS version: FreeNAS-11.3-U1
Nextcloud version: 21.0.2

Nextcloud directory path in FreeNAS jail: /usr/local/www/nextcloud

Reference

  • https://github.com/nextcloud/server/issues/17409#issuecomment-538684976
  • https://content-security-policy.com/
Leave a Comment

How to install Netflix on Unifi Plus Box

Until the date of writing this post, Unifi users are still not able to install Netflix on Unifi Plus Box.

It’s because the official Netflix app itself will verify the machine when it launch.

But if you insist to have Netflix installed on your Unifi Plus Box, you can still install a modded Netflix app through an APK file.

Disclaimer: Do this at your own risk! I’m not the owner of the modded APK and I don’t take any responsibility. Stop here if you having concerns!

You can get the modded APK from this XDA forum post:
https://forum.xda-developers.com/t/v7-aidans-rom-s905x-atv-9-no-lag-bloat-1-2gb-2021-update-tv-netflix.4191157/

How to install:

Option 1: Copy the APK file into a USB drive, and then install it via file manager.

Option 2: Install it through network with adb command.

# connect your machine first, make sure ur device allow the access.
adb connect 192.168.1.XXX

# install the .apk file
adb install /path/to/apk-file

Conclusion

I have been using it for months already, everything looks ok.
If you afraid before installing it, you can scan the APK on MetaDefener OR VirusTotal OR any other online virus scanner platform.

 

Leave a Comment