Posts

Moodle user keeps being redirected to user profile page after login and how to fix

One day you noticed a user keeps being redirected to the Moodle's user profile page after she successfully log in and you cannot do anything. I got that problem too and it took me a while to figure out how to fix it.

Login to Moodle using an administrator account and update all the required field of that user. Save it and everything will be ok.

It's because for some reason your user missing some required information (such as email address in my case). You will wonder how this happens because you cannot create a user if you don't input all the required information. But, there is one scenario this will happen, It's LDAP. When a user login into Moodle the first time, Moodle will create the user as long as it has username. In my case, the user has everything it needs except for the email address.

Interesting right? :D

Fix mysql ERROR 1698 (28000): Access denied for user 'root'@'localhost'

After a fresh install of MariaDB on a Ubuntu 16.04 machine, I got this error when trying to login to mysql:

$ mysql -u root -p

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

Then I realized that I can login without password if I use sudo (of-course I have to enter the sudo password):

$ sudo mysql -u -p

So I's looking around on the Internet and figure out the problem. In Ubuntu 16.04, mysql is using by default the UNIX auth_socket plugin which means that db users will be authenticated by the system user credentials.

$ sudo mysql -u root

mysql> USE mysql;
mysql> SELECT User, Host, plugin FROM mysql.user;

+--------------+-------------------+
| User            | plugin                |
+--------------+-------------------+
| root             | auth_socket       |


So to login to mysql without sudo and use the password, I have to set the root (or any user) user to use the mysql_native_password plugin:

$ sudo mysql -u root

mysql> USE mysql;
mysql> UPDATE …

How to install and start E-commerce service in Open edX navetive installations (Ubuntu 16.04)

Assumptions:
You are installing this on an AWS instance of Ubuntu 12.04, 64-bitYou have at least 30GB of space assigned to the root driveThese instructions are as current as of the Fiscus.3 platform release1. Update and install system dependencies

sudo apt-get update -y

sudo apt-get install -y build-essential software-properties-common python-software-properties curl git-core libxml2-dev libxslt1-dev libfreetype6-dev python-pip python-apt python-dev libxmlsec1-dev swig libmysqlclient-dev

sudo pip install --upgrade pip

sudo pip install --upgrade virtualenv

2. Clone the edx configuration repository and install edX and ecommerce

cd /var/tmp

git clone https://github.com/edx/configuration

cd /var/tmp/configuration

sudo pip install -r requirements.txt

sudo pip install setuptools --upgrade

cd /var/tmp/configuration/playbooks

nano -w edx_sandbox.yml

* Inside the edx_sandbox.yml file, change the SANDBOX_ENABLE_ECOMMERCE flag from False to True.

sudo ansible-playbook -c local edx_sandbox.yml -i "localh…

The proper way to install Ansible on Ubuntu 17.04

Because the ansible version comes with Ubuntu 17.04 is quite all (1.6.2), it may cause you troubles like missing module directory...

After a while, I figured that PIP is the best way to install Ansible on Ubuntu 17.04.

1. Install the needed libs:

$ sudo apt install libffi-dev libssl-dev libxml2-dev libxslt1-dev openssl-dev python-dev libffi-dev python-pip

2. Then install Ansible:

$ sudo pip install ansible

3. Fix AttributeError:'module' object has no attribute 'PROTOCOL_SSLv3' error when running Ansible: 

http://www.dangtrinh.com/2017/06/how-to-fix-attributeerror-module-object.html

4. Enjoy!



How to fix "AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'" err in Ubuntu 17.04

If for some reason you got this error in your Ubuntu 17.04 server:

AttributeError:'module' object has no attribute 'PROTOCOL_SSLv3'** try this to fix it:

$ sudo pip install requests==2.6.0

Or

$ sudo pip install --upgrade requests