KDiff3 missing window controls (Ubuntu 18)

This is a bug.

Easy solution:

mkdir -p ~/bin/kdiff3
chmod +x ~/bin/kdiff3
nano ~/bin/kdiff3

Add the code:

#!/bin/dash
# workaround https://invent.kde.org/sdk/kdiff3/-/merge_requests/8
# see also: https://stackoverflow.com/q/60251339/334451
perl -i -npe 's/WindowStateMaximised=true/WindowStateMaximised=false/' ~/.kde/share/config/kdiff3rc ~/.config/kdiff3rc
exec /usr/bin/kdiff3 "$@"

If you are using file managers, configure them so that they use ~/bin/kdiff3 instead of the system one.

For details about this read here

Hosting links

Table of contents

  1. Table of contents
  2. Important links about hosting:
  3. New articles with host information (2022):
  4. Paid options
    1. International hosting providers:
    2. Managed WordPress hosting:
  5. Hosting in Greece
    1. Links for hosting providers in Greece that display phone and prices clearly:
    2. Links for hosting providers in Greece:
    3. Providers to avoid (for hosting in Greece):

New articles with host information (2022):

International hosting providers:

  1. www.siteground.com  🏅 (beware: soft limits❗)
  2. www.hetzner.de
  3. www.justhost.com
  4. www.hostgator.com
  5. www.ionos.com (beware: no support for Greece❗)

Managed WordPress hosting:

  1. Kinsta 💰
  2. SiteGround 🤟
  3. WP Engine 💰
  4. Flywheel
  5. Pagely
  6. iphost.net
  7. papaki.gr

Hosting in Greece

  1. www.cretaforce.gr 🤟
  2. jethost.gr 🤟
  3. www.intechs.gr
  1. www.hostsun.com 🇬🇷
  2. www.iphost.net
  3. xtreemweb.net
  4. www.pointer.gr
  5. greekhost.gr
  6. www.ip.gr
  7. www.papaki.gr 🏅
  8. stigma.host 🤨
  9. www.check-domains.gr
  10. www.rainhost.gr 🤨
  11. https://easy.gr

More choices:

  1. www.thewebpower.com
  2. dnhost.gr
  3. www.datahost.gr
  4. ez4uhosting.com
  5. www.jethost.gr
  6. www.1host.gr
  7. www.supremohosting.com
  8. www.hyperhosting.gr
  9. www.kosnet.gr
  10. www.myip.gr
  11. www.mochahost.com
  12. www.turbohosting.gr
  13. www.philoxenos.com

Providers to avoid (for hosting in Greece):

ProviderReason
www.bluehost.comEIG
www.hostgator.com EIG
www.godaddy.comBad support, No free SSL
www.tophost.gr 🇬🇷Low speed
www.awardspace.comNo free SSL

FastAPI quickstart

Create a virtual environment (pythonic)

python -m venv env

Or for a specific python version (for example 3.9):

sudo apt install python3.9-venv
python3.9 -m venv ./venv

Create a requirements file

Create file:
touch requirements.txt
Add requirements to requirements.txt:
python -m pip install --upgrade pip
pip install fastapi
pip install uvicorn
pip install gunicorn
pip install beautifulsoup4
pip install requests
pip install xmltodict
...
pip freeze > requirements.txt

Create a makefile (optional)

Add recipes for activating the virtual environment and installing the requirements:

.PHONY: activate
activate:
	bash --init-file <(echo "source ~/.bashrc;source ./env/bin/activate")

.PHONY: install
install:	
	pip install -r requirements.txt

.PHONY: serve
serve:
	uvicorn --port 5000 --host 127.0.0.1 main:app --reload	

After creating an example project (many examples easy accessible on the official documentation) you can easily active and run the project:

make activate

make serve

Laravel – Apache Errors

Permission denied

Laravel needs the following permission configuration:

  • write access to bootstrap/cache
  • write access to storage

To setup permissions you can either set a custom user account as owner (preferred) or use www-data as owner. The first solution is better because it allows the user to upload files via SSH or FTP without any issues.

The following commands would create an account deployer who would own the site:

sudo useradd -g www-data deployer
cd /var/www/<site>/public
sudo chown -R $USER:www-data /var/www/<site>/public
sudo find . -type f -exec chmod 664 {} \;   
sudo find . -type d -exec chmod 775 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

Symlinks not followed

You may get errors if the site has symbolic links and you do not have enabled the option FollowSymlinks:

You should add the option FollowSymlink to the vhost. Fore example:

<Directory /var/www/<site>/public>
  AllowOverride All
  allow from all
  Options +Indexes +FollowSymLinks
</Directory>

Make sure rewrite is enabled:

sudo a2enmod rewrite

Reload profile after changes:

sudo service apache2 reload

Spring boot links

TABLE OF CONTENTS

  1. Error handling:
  2. Profiles:
  3. Multimodule project
  4. JPA
    1. Specifications
    2. Auditing
    3. Soft Deletes

Error handling:

Profiles:

Multimodule project

JPA

Specifications
Auditing
Soft Deletes

Spring boot – MySQL quickstart

Maven:

<dependency>
  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
  <scope>runtime</scope>
</dependency>

Application properties:

## MySQL DataSource
spring.datasource.url=jdbc:mysql://localhost:3306/astrobook?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC
spring.datasource.username=astrobookuser
spring.datasource.password=Jb435@69o^fn

spring.jpa.database=mysql
spring.jpa.hibernate.ddl-auto:validate

spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.format_sql=true
logging.level.org.hibernate.type.descriptor.sql=trace

spring.h2.console.enabled=false

Personal portal to the Internet