Sunday, November 15, 2020

Loopback LB4, mysql SSL configuration

 I had a tough time trying to find documentation on how to configure loopback 4 to use SSL certs for communicating with a mySQL backend. So here's how I did it:



    dataSource: {  
     name: "mysql",  
     connector: "mysql",  
     // url: process.env.DS_URL, // don't use URL because SSL doesn't work with it  
     host: process.env.DB_HOST,  
     port: 3306,  
     ssl: {  
      rejectUnauthorized: false,  
      ca: fs.readFileSync(process.env.mysqlSSLCAcert, { encoding: 'utf8', flag: 'r' }),  
      key: fs.readFileSync(process.env.mysqlSSLClientKey, { encoding: 'utf8', flag: 'r' }), //client  
      cert: fs.readFileSync(process.env.mysqlSSLClientCert, { encoding: 'utf8', flag: 'r' }), // client  
     },  
     user: process.env.DB_USERNAME,  
     password: process.env.DB_PASSWORD,  
     database: "facility"  
    },  

Thursday, May 28, 2020

RabbitMQ proxied through apache httpd web server

Problem

RabbitMQ wasn't allowing us to add exchanges through the web console. Clicking on the button resulted in the PUT request being sent to apache, but apache wasn't forwarding the traffic onto rabbitMQ.

This was confirmed by checking the apache logs. Indeed the request was received, but in the rabbitMQ logs, there was no change in activity. This would a suggest a problem at the apache level.

At the browser level, debugging shows a 404 status code was returned, which suggests that apache wasn't able to find handler for the request.

Solution


Reference: https://serverfault.com/questions/639327/rabbitmq-behind-apache-mod-proxy-not-resolving-deep-link

Modify your httpd.conf or ssl.conf to have the following
Edit /etc/rabbitmq/rabbitmq.conf and add
 management.path_prefix = /mq  


Edit /etc/httpd/conf.d/ssl.conf and add the following rules:
   AllowEncodedSlashes NoDecode  
   ProxyPass /mq http://localhost:15672/mq nocanon  
   ProxyPassReverse /mq http://localhost:15672/mq  

It's important to note that a trailing slash is required when entering the URL path in the browser. For example:

https://myhost/mq/

Friday, February 14, 2020

How to remove bloatware from Oppo Reno Z

Its unbelievable how much bloatware apps are installed by defualt on Oppo phones. But there is a way to remove them using some simple command-line tools.

This article describes how to remove the bloatware installed by default on a new Oppo Reno Z using the adb tool.

Follow this guide to install ADB: 


To install ADB go here:


In Windows 10 using powershell, launch ADB as follows

cmd /c adb shell

 Most of the bloatware is installed under the package "com.coloros"

pm list packages | grep coloros

Here are the commands I used for removing the bloatware apps:

pm uninstall -k --user 0 com.coloros.gamespace
pm uninstall -k --user 0 com.coloros.weather.service
pm uninstall -k --user 0 com.coloros.weather2
pm uninstall -k --user 0 com.coloros.gallergy3d
pm uninstall -k --user 0 com.coloros.musiclink
pm uninstall -k --user 0 com.coloros.phonemanager
pm uninstall -k --user 0 com.coloros.calculator
pm uninstall -k --user 0 com.coloros.screenrecorder
pm uninstall -k --user 0 com.coloros.alarmclock
pm uninstall -k --user 0 com.coloros.compass2
pm uninstall -k --user 0 com.coloros.oppomultiapp
pm uninstall -k --user 0 com.coloros.soundrecorder
pm uninstall -k --user 0 com.coloros.oppopods
pm uninstall -k --user 0 com.coloros.onekeylockscreen
pm uninstall -k --user 0 com.coloros.video
pm uninstall -k --user 0 com.coloros.


That cleaned up quite a bit and removed icons from the screen.

Unfortunately, there were some apps I couldn't remove such as the Oppo Contacts, and Clone Phone.
I'd be interested to hear if anybody figured out how to remove them, or other bloatware found on their phone.

Restore uninstalled apps

The apps are not really deleted, they're just hidden. To view a list of all packages including the uninstalled apps use

pm list packages -u | grep coloros

To restore an app in adb shell

cmd package install-existing com.coloros.usbselection


Good luck