Blog

  • how to install carbonio / the alternative to zimbra

    1. Find a server in hetzner or another vps provider and rent a vps with the min requirements (16gb, 8vcpu should be fine for a single server installation) / Requirements — Zextras Carbonio CE Documentation
    2. Enable backups to make sure your restore in case something fails
    3. You must own a domain. Login to your DNS provider and configure records, add 2 A records and 1 MX record
      • A record servername.domain.com pointing to server IP
      • A record mail.domain.com pointing to server IP
      • MX domain.com (@) with content mail.domain.com with priority 1
    4. hostnamectl set-hostname mail.domain.com
    5. nano /etc/hosts and add IPADRESS HOSTNAME
    6. apt install postgresql-12
    7. Documentation says to edit /etc/postgresql/12/main/pg_hba.conf but in ununtu 20 that was already fixed.
    8. apt update && apt upgrade
    9. Download script from carbonio site / wget https://repo.zextras.io/inst_repo_ubuntu.sh
    10. chmod +x inst_repo_ubuntu.sh
    11. ./inst_repo_ubuntu.sh
    12. sudo apt update
    13. sudo apt upgrade
    14. Install carbonio
      apt install service-discover-server carbonio-directory-server carbonio-proxy carbonio-webui carbonio-files-ui carbonio-mta carbonio-mailbox-db carbonio-appserver carbonio-user-management carbonio-files-ce carbonio-files-public-folder-ui carbonio-files-db carbonio-tasks-ce carbonio-tasks-db carbonio-tasks-ui carbonio-storages-ce carbonio-preview-ce carbonio-docs-connector-ce carbonio-docs-connector-db carbonio-docs-editor carbonio-prometheus carbonio-message-broker carbonio-message-dispatcher carbonio-message-dispatcher-db carbonio-ws-collaboration-ce carbonio-ws-collaboration-db carbonio-ws-collaboration-ui carbonio-videoserver-ce
    15. Make sure all carbonio services are running
      systemctl status carbonio-*
    16. type
      carbonio-bootstrap
      and press Y
      This is gonna take some time / 5-10 minutes so better grab a coffee.
    17. su – zextras -c “carbonio prov setpassword [email protected] SuperStronPassword”
    18. Open browser and point to https://IPADDRESS:6071/static/login/
    19. service-discover setup-wizard
      Complete IP/MASK and type a password
    20. pending-setups -a and type the password of previous step.
    21. Setup database
      • read -s -p “Insert Password:” DB_ADM_PWD
      • su – postgres -c “psql –command=\”CREATE ROLE carbonio_adm WITH LOGIN SUPERUSER encrypted password ‘$DB_ADM_PWD’;\””
      • su – postgres -c “psql –command=\”CREATE DATABASE carbonio_adm owner carbonio_adm;\””
      • Do not unset DB_ADM_PWD / you still need it later
      • PGPASSWORD=$DB_ADM_PWD carbonio-files-db-bootstrap carbonio_adm 127.0.0.1
      • PGPASSWORD=$DB_ADM_PWD carbonio-tasks-db-bootstrap carbonio_adm 127.0.0.1
      • PGPASSWORD=$DB_ADM_PWD carbonio-ws-collaboration-db-bootstrap carbonio_adm 127.0.0.1
    22. Restart carbonio
      • su zextras
      • zmcontrol stop
      • zmcontrol start
      • exit
    23. Configure Let’s Encrypt Certificate Using Carbonio Admin UI (zextras.com)
      • su – zextras -c “carbonio prov gs mail.domain.com | grep -i zimbraReverseProxyMailMode”
        (to check current status)
      • su – zextras -c “carbonio prov ms mail.domain.com zimbraReverseProxyMailMode redirect”
        (to change to redirect mode)

    This could be helpful: Unable to send mail after fresh install – Carbonio General – Zextras Forum

  • how to install windows 2019 on hetzner

    Follow the guide on:

    Windows on Cloud – Hetzner Docs

    Only one last step left. Open the Device Manager. After other devicesEthernet Controller click on it and choose Update Driver Software…. Select Browse my computer for driver software, click on Browse and extand the CD Drive virtio-winNetKVM2k19 and amd64. Click OK and Next. A Windows Security window open, check “Always trust” and Install. Now Windows detects the network and open a right pane Do you want to allow your PC to be discoverable… choose No.

    Source:

    Install Windows Server 2019 on Hetzner Cloud (blog-programmeur.fr)

  • sqlsrv with laravel / error after server update

    Common errors:

    1. SQLSTATE[IMSSP]: An invalid attribute was designated on the PDO object.
    2. ATTR_ERRMODE exception is not supported

    Resolutions:

    Edit: \vendor\laravel\framework\src\Illuminate\Database\Connectors\SqlServerConnector.php

    Comment or delete:

            // PDO::ATTR_STRINGIFY_FETCHES => false,

  • wifi does not reconnect after waking from sleep mode

    Recently we had to deal with a lenovo, equipped with a wifi adapter that could not reconnect, after laptop waking up from sleep mode. A reboot was required to make wireless adapter recover the problem. This frustrating issue occured in a lenovo ideapad 5 with the realtek rtl8852ae after a lenovo and windows update (2022, November). Apparently this was a wifi adapter driver problem in conjuction with laptop’s power settings.

    First, we have tested different combinations in power settings, but none of them worked. The most common resolution to these kind of problems is keeping adapter on, even laptop is in sleep mode. This option is usually available Device Manager > Apapter Settings > Power Management tab (see photo below), but this tab was not available in this realtek 8852. Below, you can see a picture of an Intel adapter, with this option available and on. If this is your case for and this option is availabe to you, try to turn it off to see if this resolves the problem. Unfortunately, this option was not available in the problematic ideapad,

    Power management options in an Intel wireless adapter (device manager).

    Until December Lenovo nor Microsoft had released un update resolving the issue, although the latest updates was already installed.

    Finally, we were addressed to Lenovo support. We admit, they were very fast, but their advice to factory reset the device was not an option for us!

    Resolution

    We had to search other resources. First target was Realteks site. But Realtek has not published any adapters for 8852. If Realtek does not provide info for their adapter, who is? A google search for rtl8852ae, among other results directed us to Lenovo again, but this time, in its thinkpad series drivers section:

    Realtek 8852AE WLAN Driver for Windows 11 (Version 21H2 or later), 10 (Version 20H2 or later) – ThinkPad E14 Gen 3, E15 Gen 3 – Lenovo Support CH

    At first, it seemed irrelevant, but why not trying it? It was an October 2022 update for the same driver, of the same manufacturer. How different could it be?

    Finally, we applied this driver update and it worked for a couple of hours. Thinkpad driver readme does not mention a direct resolution to power related issues. However it seems that the update includes cumulative fixes that the outdated 2021 Ideapad driver was missing.

    Suddenly, a couple of hours later, the problem came up again. So, we had to focus again on how to prevent wifi from sleeping, so we’ve found this useful article:

    Stay Connected to Internet in Sleep mode of Windows 10 / 11 – The Geek Page

    Method 3, was our solution. But the problem is that gpedit is not enabled in windows 11 home edition.

    So, firstly, we had to enable gpedit in our home edition. We’ve managed so thanks to this guide:

    How to Enable Gpedit.exe in Windows 11 [Quick Guide] (windowsreport.com)

    (we ‘ve used the batch file method)

  • laravel permissions

    Copied from: php – How to set up file permissions for Laravel? – Stack Overflow

    cd /var/www/html/laravel >> assuming this is your current root directory
    
    sudo chown -R $USER:www-data .

    Then I give both myself and the webserver permissions:

    sudo find . -type f -exec chmod 664 {} \;   
    sudo find . -type d -exec chmod 775 {} \;

    Then give the webserver the rights to read and write to storage and cache

    Whichever way you set it up, then you need to give read and write permissions to the webserver for storage, cache and any other directories the webserver needs to upload or write too (depending on your situation), so run the commands from bashy above :

    sudo chgrp -R www-data storage bootstrap/cache
    sudo chmod -R ug+rwx storage bootstrap/cache
  • ssh in windows 11 – without putty, without ssh-agent

    You can do everything from windows cmd. There is no need to install putty or any other program, just 3 easy steps:

    1. Create a public and private key pair.
    2. Copy the public key to the server.
    3. Login with ssh through windows cmd.

    The above steps in detail:

    Create the keys in your windows 11 machine

    Open cmd and type:

    ssh-keygen -t ed25519 -C "[email protected]"

    Follow the instructions on screen. When asked for password, type one. Although you can leave it empty, it is strongly recommended it not to.

    Two files are created:

    ed25519.pub and ed25519 without an extension. The first one is the public key and the second is the private. Keep them in a safe place. If someone has access to the file, will have access to your servers.

    Copy or type your public key to your ubuntu / debian / any linux machine

    Open your ed25519.pub file with a text editor, notepad is sufficient enough. Select all text and copy it to notepad. Now, login to your linux machine and locate the file:

    ~/.ssh/authorized_keys

    It the file does not exist create it.

    If the file has already contents, add another line and paste the contents of ed25519.pub.

    If the file is empty, just paste the contents of ed255519.pub.

    Now, to enable passwodless login, locate the ssh configuaration file:

    /etc/ssh/sshd_config 

    Make sure that the following parameters are set properly:

    PasswordAuthentication no
    ChallengeResponseAuthentication no
    UsePAM no

    To apply the settings, restart ssh like this:

    sudo systemctl restart ssh

    Access linux from your windows 11 cmd

    Open cmd again and use ssh to login to remote machine. The difference from typical password authentication is that you must provide the -i switch which allows to define the private key you created in step one.

    ssh -i .\path_to\ed25519 [email protected]

    Of course, you can use any filename you like.