PHP – file encryption/decryption

To have some sort of privacy while sending/receiving messages (or files) using encryption is the first choice.

Below you can find a very simple PHP web application that allows you to encrypt/decrypt a file using your web browser (and a web server hosting the page).

Linux: get info about notebook battery

Below you can find a very simple shell script that gets information about every battery present in your notebook and shows a summary.

  1. create a new file (es: /usr/local/bin/battery.sh)
  2.  paste inside the new file the following code
  3. save the file
  4. make the file executable (es: chmod +x /usr/local/bin/battery.sh)
  5. use the script (from a terminal  execute: /usr/local/bin/battery.sh)

 

 

Automatic Wpa Supplicant restart

If wifi connection used by your Linux box is not stable and goes up&down, with wpa_supplicant requiring some manual restart you could use a simple script that does it for you.

Below you can find a script i’m using on a RaspberryPi 3 with Raspian installed.

Remember to use a value for WLAN corresponding to you wifi interface.

The shell script alone doesn’t give you a fully automatic and periodic check&restart … to have it you should use crontab and schedule script invocation (user: root!) every 15 minutes (or every time you need it).

Slackware: keep Gradle up-to-date

Using AndroidStudio to develop mobile apps requires you to always have an updated installation of  Gradle, doing so on a Slackware system could lead to quite a lot of manual work.

To help me in the process i created a small tool that on its own downloads and makes a Gradle Slackware package (thanks to these SlackBuilds).

To use this tool you only have to execute the script, wait for it to finish and the upgrade Gradle using the packages created.

Continue reading Slackware: keep Gradle up-to-date

Linux: change temporary directory for Android Studio

Using Android Studio the directory used by the system to store temporary files (the default one is /tmp) could be filled by many (big) files, in order to limit this behaviour you can choose another directory to be used by the IDE.

To do so you could launch the IDE every time with the following commands (in a terminal):

Remember to replace all paths  with the correct values, on my linux box i use:

You could also put everyting into a single script file:

 

Nextcloud client for Slackware64

Using cloud storage is a popular choice and creating a personal cloud is now a possibility many of us have.

If you want to create your own cloud storage you can install OwnCloud or NextCloud on a webserver and connect to them usng a web browser or a client application.

I’ll show how to install NextCloud client on a Slackware64 system.

Continue reading Nextcloud client for Slackware64

Skype4Slackware : a Skype packager for Slackware

Microsoft makes packages of “Skype For Linux” only in .deb and .rpm format.

If you want to use them on Slackware you have, every time, to download the file,  convert it into a native package and install it.

Can we execute this procedure using a tool that requires only to be launched ?
The answer is simple : YES.

See how to use Skype4Slackware.

Continue reading Skype4Slackware : a Skype packager for Slackware

Install Mozilla Firefox portable on Linux

Installing an instance of Mozilla Firefox portable on Linux is pretty simple but this action could reserve you some trouble if you have to do it manually every time.

Because of this i created a very simple script which does the dirty job and can create a portable installation of this the browser. Supported Firefox versions, at the moment, are:

  • Mozilla Firefox standard (lastest release)
  • Mozilla Firefox ESR (latest release)

Continue reading Install Mozilla Firefox portable on Linux