Categories
LimeSurvey

LimeSurvey – Create an Multi-language Array with Comments for Every Sub-question

This day challenge was to install limesurvey and copy an existing survey built with EUSurvey. One of the question was an array with comments  for every sub-question in the last column. LimeSurvey does not offer a built in question for that you need to tweak the array question to work.

So here is my solution.

Categories
Azure Microsoft Windows

My First PowerShell to Redirect HTTP to HTTPS on the Azure Application Gateway

After I was able to manage HTTPS with a self-signed certificate on the Microsoft Application Gateway it was the time to redirect all HTTP communication to HTTPS. For that Microsoft offers only a PowerShell solution, you are not able to do that on the Portal. So in my life, it was the first time I had to use PowerShell. Actually, I was surprised. To write and test a PowerShell script for Azure is relatively easy. But the way to get there is full of traps.

Categories
Azure Microsoft

Microsoft Azure Step-by-step Guide to Set Up SSL with self-signed Certificate on an Ubuntu Backend using Azure Application Gateway

Another day in Paradise with Microsoft. 🙂

Today my task was to set up HTTPS on the test environment with Azure Application Gateway, but the end of the day it was done.

Categories
LMS Moodle

Moodle How to Avoid brokenfile.php in the Text Editor when Copying Source HTML Code from an External Editor

So the problem is when we would like to copy HTML source from an external editor which contains a images with full paths Moodle will remove the links and shows as deleted.

Categories
LMS Moodle

Moodle Questionnaire Displays Activity Name without Applying Multi-language Filter

Questionnaire displays activity name without applying multi-language filter in the intro page (mod/questionnaire/view.php?id=) using Questionnaire version 2017050101.

Categories
Linux

How to Set Proxy in an Ubuntu Terminal?

Yes, because companies like to use proxy but I needed to access the Internet from my Ubuntu running on a VirtualBox.

Just a few steps and access can be established:

  1. Edit the /etc/environment file with your favorite editor
  2. Add the following lines
http_proxy="http://myproxy.server.com:8080/"
https_proxy="http://myproxy.server.com:8080/"
ftp_proxy="http://myproxy.server.com:8080/"
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
HTTP_PROXY="http://myproxy.server.com:8080/"
HTTPS_PROXY="http://myproxy.server.com:8080/"
FTP_PROXY="http://myproxy.server.com:8080/"
NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"

Logout and login again.

Apt does not obey the environment variables so we need to set up the proxy setting:

  1. Edit the /etc/apt/apt.conf file with your favorite editor
  2. Add the following line:
Acquire::http::proxy "http://myproxy.server.com:8080/";

HTTP proxy is enough most of the times to download packages and updates.

That’s all.

Cheers.

Categories
Microsoft Windows

Create a database and an user with SQL Server Authentication

Again dear Microsoft, why do you harden our life when you could make it easier?
Yesterday I was able to install Access Database Engine to connect the .ASP application to its database. But because getting

An unhandled win32 exception occurred in w3wp.exe

all the times, I thought it is time to change to MS SQL Express.

  • Installed MS SQL. Few GBs not much.
  • Installed SQL Server Management Studio (the installer is 830MB while MySQL Workbench installer is 23MB).
  • Migrated the data with SQL Server 2016 Import and Export Wizard. Was quite easy because I had already installed the Access Database Engine connector.

So I had everything to start using with the .ASP. But I knew I need a user for the connection.

The first of all only some documentation mentions that you have to enable SQL Server Authentication. Not having this option enabled you will get login failed. Beside that you are able to create the user add password add roles everything without a simple warning that you won’t be able to use it. Haha.

SQL Server Authentication

When set you have to restart the SQL agent. You can use SQL Configuration Manager for this. A tool designed for this. I could not find the service stop start within Windows.

#service mysql restart

Isn’t this more simple? Okay now You could use PowerShell for this.

Secondly, by default you can only create users with a password in a contained database. Why? Don’t know. Maybe life can be too easy.

So again asking stackoverflow what to do. Here is the solution:
exec sp_configure 'contained database authentication', 1
go
reconfigure
go

alter database YourDatabase
set containment = partial
go

Here we go. So now you are able to create a user with a password. Simple, isn’t it?

Finally you can test the connection by creating a TestConnection.udl file somewhere in your server. Then double click on it and test the connection with the specific user name and password.

TestConnection.udl properties

And all of these can be made with one single command in MySQL without any hocus-pocus:

>grant all on (databasename).* to 'username'@'localhost' identified by 'password';

Cheers.

Categories
Microsoft

Another day with Microsoft. :)

Well, well, well.  Using Microsoft is fun. Even when you need to use it in a production area.

Here is the first example. You want to download a Microsoft tool from the Microsoft website with a Microsoft browser. And what happens? You cannot download it. Because it is Microsoft.

Microsoft kills itself

Other good example is to use Microsoft Edge searching images with Bing and you decide to resize the window. Here is the result:

Bing

Thank you for this. 🙂
Cheers.

Categories
LMS Microsoft Moodle MySQL

Microsoft Azure Database for MySQL: Use PHP (not) to Connect and Query Data

Back on the road of blogging again.

So our client who is a big European organization has Microsoft Azure Cloud services and having consultant company for support.

Since we would like to run Moodle we need PHP + MySQL.  We got an Ubuntu app server. Funny isn’t is to run Linux machines in the Microsoft Cloud? But I am sure they are performing better than the Windows Servers. For taking advance of the Cloud service we have been offered to use the Microsoft Azure Database for MySQL Basic solution with 50 DTU. We have been told to use SSL connection.

The problem was that there is no man on Earth who could establish an SSL connection to Microsoft Azure Database for MySQL with PHP.

Even Microsoft’s documentation how to connect MySQL with PHP is without using SSL.

Our other problem was that it was so slow that we gave up using it. A 1MB MySQL dump export took 5 minutes. In a localhost it took few seconds.

We had got the following response from the Microsoft consultant:

We took the smallest instance possible to start with, so you can expect bad performances.

This is not a bad performance, this is unusable.

Hope to have a better MySQL service later. Come on MS!

Categories
Articulate Storyline

Changing State of an Object on a Different Layer Using Articulate Storyline

So I have the following scenario:
I have a layer with a button to show another layer (showing an example).  The new layer does not cover all part of the screen and the button is visible and that might be confusing for the users. So I want to hide the button and when the user closes the example layer I want to make it visible again.

So I made the following steps:

  1. Create a True/False variable with a name Example and default value True.
  2. On layer 1 create a trigger to adjust the variable Example to False when the user clicks on the button.
  3. On layer 1 create a trigger to change the state of the button to hidden when the user clicks on the button.
  4. On layer 1 create a trigger to change the state of the button to normal when the variable Example changes with the condition If Example is equal to True
  5. On layer 2 create a trigger to adjust the variable Example to True when the user clicks on the close button.

as_showexample

as_hideexample

Cheers,