PHP ejecutándose en Android

How to install Apache and PHP 7 on Android with Termux

Install web server and process PHP files: build a LAMPP stack on Android

This is not a post of those who use tricks to attract visitors, we are really going to install an Apache server on Android, configure it to process PHP files and finally write a Hello World: everything running from our mobile device.

PHP ejecutándose en Android

PHP running on Android

(more…)

5 - Insertar datos y probar base de datos

How to install MySQL (MariaDB) on Android with Termux

Install MySQL on Android

Android mobile devices are not designed to be servers (although some of them are powerful), however it is always interesting to see how technology advances and day by day we can do more things with our phones.

Today we will see how to install the MySQL or MariaDB server on Android, thanks to the Termux application. For that it is enough to execute a few simple commands and voila, we will have a MySQL database server in our Android; fully functional and ready to execute queries.

If we want to put it for production, we can do it as long as we configure security. In short, we will not see more advanced topics; we will only see how to install mysql on Android.

Here we will use MariaDB and MySQL as synonyms; that is, if you see that I say MariaDB do not get confused, I mean MySQL; and vice versa.

I know that there are really more differences especially with the licenses, but that is another topic and you can search it in Google if you wish.

(more…)

Cambiar nombre de sesión de Termux

Configure Termux on Android (Linux in our pocket)

Install Termux on Android

Today we will see how to install and configure Termux on Android, as well as a brief introduction to its use.

Termux is an application that will allow us to have a terminal on our device, but apart from that it gives us the possibility of installing very interesting packages; and if we configure them well and install well, we can have a complete and stable server on our mobile.

This application does not require root access, you only need that our Android phone has a recent version (I think it works from Android 6).

(more…)

How to install and configure Python 3 and pip on Windows 10

Introduction

In this post we will see how to install and configure the Python interpreter in its version 3 on Windows 10 (works even for 7, 8 and 8.1).

At the end we will be able to execute scripts and also to install third-party libraries using pip; which will make things easier for us.

(more…)

Switch in Python

There is no switch statement in Python, but there are equivalents depending on what you want to achieve. The best-known use of switch is to evaluate a value and avoid nesting multiple if statements.

Today I will explain it: how to make an equivalent switch in Python.

(more…)

Convert C string to upper case

C: convert string to lowercase and uppercase

Introduction

Today we will see how to convert a string in C to uppercase. We will also see how to convert a string to lowercase. That is, to convert something like “Hello World” to “hello world”. Or something like “Good night” to “GOOD NIGHT”.

For this we will use some functions that the standard library has: tolower and toupper.

(more…)

Python: check if item or value exists in list or array

Introduction

Sometimes we need to know if an element or value is within a list or array in Python.

There may be a need to simply know if it exists, but it is also possible that we need to obtain the position of an element, that is, its index.

Today we will see how to do it in Python, to check if an element exists in array, as well as to obtain the index of a certain value.

(more…)

PHP: Generate cryptographically secure token

Intro

Sometimes we need to create a random string or token using PHP. For example, it’s quite common that when we want to reset our password on some website a message is sent to the mail we registered.

Probably the message have a link like this:

site.com/reset-pass?token=123

Where 123 is the token. Today we will see how to create a token cryptographically secure using PHP. We can use this token as a password or as random string to reset something.

This works for PHP 5 and for PHP 7.

(more…)

Share via