Tech blog

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Fixing laradock error

Recently when trying to build a laradock docker container (workspace one) I got an error:

E: Failed to fetch  http://security.ubuntu.com/ubuntu/pool/main/d/dbus/dbus_1.12.2-1ubuntu1.1_amd64.deb   404  Not Found [IP: 91.189.88.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?   

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

GVC JSON to PDF

I had a PDF as image and JSON generated by Google Vision Cloud. The task was to generate a searchable PDF.

So I share my solutions, hope someone else will find it useful.

Overlay text from Google Vision Cloud (OCR) over the original PDF-as-image to create a searchable PDF

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

/images/stories/2020/confuse-the-hell-out-of-the-spiders_thumb.png

I use CentOS Web Panel (CWP) and want to redirect my secondary parked domain to my main domain both http and https using nginx. Needs some tricks.

So I have my main domain gruz.ml and a secondary one gruz.ml. I want when I visit https://gruz.ml/whatever-path , https://gruz.ml/whatever-path I'm redirected to https://gruz.ml/whatever-path

The most obvoious way is to create a domain in CWP and link it to an existing CWP user public_html folder. And this works, but demands some additional steps. Otherwise there you don't redirect to the main domain, but have your web-site accessible under 2 different domains.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

b_300_0_16777215_00_http___ximage.ml_x_spidersem.jpg_qn.jpeg

CentOS Web Panel has an option of using nginx as web-server, but out of the box Search Engine Friendly links don't work for Joomla.

So here are the steps:

  1. Select nginx as the web-server
  2. Create a custom template from terminal or via CWP GUI
  3. Apply the template to the needed domains

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

spider tenancyInstalling Laravel tenancy with Voyager can be very tricky.

Here is a repo with a tutorial how to install multitenancy in Larave with Voyager

https://github.com/gruz/multi-tenancy-voyager-tries

I hope at least some people will find it useful.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

spider web with water beads network dewdrop1We develop a web-site using docker. Well, using docker-compose. So we have it working at our localhosts per team member, but we need run the docker at a real server under a real domain.

My server uses CentOS and CWP(CentOS Web Panel, Pro version). Usually a create a user, domain/subdomain/database. Then upload my web-site files, edit database credentials in the web-site config etc.

Docker wokrs in other way. So to run my docker-based project at my CWP-powered server I did the following.

The idea is easy. Run docker (I did via terminal) and in CWP assign proxy to my domain and point it to the docker web-server port.

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

Problem: Need to quickly translate phrase avoiding opening google translate, copy-pasting etc.

I need often to translate a phrase from one language to another. Currently I often need to translate English to German. KDE Klipper is a perfect tool to do it from keyboard quickly, without opening google translate in browser. There is still some delay while requesting a remote server, but it's much quicker the opening a browser tab and doing a number of other copy-paste-click-task-switch tasks.

Translation from to Klipper demo

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

spider skull on backI switch my keyboard layout in my OpenSuse linux via Caps Lock. It's much more convenient then any other key combination. JIC, to make Caps Lock work as Caps Lock I use Shift+Caps Lock.

Suddenly in KDE apps (e.g. system settings or plasma desktop widgets, but not in Firefox or VS code) pressing Caps Lock started to work as Undo (like if I was pressing ctrl+z).

Solution was to edit ~/.config/kdeglobals .

On some reason the undo shortcut looked like

[Shortcuts]
Undo=Ctrl+Z;\s

I removed \s to make it look like

[Shortcuts]
Undo=Ctrl+Z;

Saved and reloaded KDE. It works!

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

gWLC3AeNBmmgElasticPress is a WordPress plugin, which transforms WP queries into ElasticSearch queries. By default it treats the content as English. I needed to make it work with German special characters like ü => ue. So words gerüstbauer, gerustbauer and geruestbauer would give the same results.

After some investigation I added the following hooks to alter the ElasticSearch index setting. After adding the hooks, ElasticPress should run reindex.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Disable XDebug for Code Sniffer but enable for CLII scripts I use VS Code for php development. I use XDebug, but out of the box it catches phpcs calls on linting documents, making impossible to use xdebug due to numerios interruptions.

The solution was to disable XDebug globally and enable per virtual host.

Globally it can be disabled in php.ini (or another ini file for php, in my case of OpenSuse I use custom file /etc/php7/conf.d/xdebug.ini) and then enable it in .htaccess for needed hosts or for all of them.

So in my php .ini file I have directives

xdebug.remote_autostart = 1
xdebug.remote_enable = off

And in my .htaccess file I have directive

php_flag xdebug.remote_enable on

This worked till I needed to debug a php command line script with XDebug in my VS Code. The solution was to run php with a proper key like

php -d xdebug.remote_enable=1 script.php

And finally, not to forget a key, I created a shortcut script ~/bin/pd containing code

#!/bin/bash
set -o xtrace
php -d xdebug.remote_enable=1 $@

So to run a CLI script and let XDebug listen to I run command pd script.php

P.S. set -o xtrace line is not needed in general. I use it to debug bash scripts.

Subcategories

General Joomla FAQ based on own experience.

Some linux tips just not to forget.

FaLang translation system by Faboba
Електронна бібліотека «Exlibris»: історичні дослідження, мемуаристика, публіцистика, художня література Українська етнографія: книги, курси лекцій, статті й матеріали, мапи, фотоальбоми, веб-ресурси Правителі України: портрети, життєписи, матеріали Твори Адріана Кащенка: романтика козацьких часів Народна війна 1917-1932

See a typo?

Select the text block and press

CTRL+Enter

Comments

  • NotificationAry - get emails on Joomla content is submitted, added or changed

    Berndi Berndi 30.06.2019 11:45
    The fields %TO_NAME% and %TO_USERNAME% are empty

    Read more...

     
  • NotificationAry - get emails on Joomla content is submitted, added or changed

    Berndi Berndi 30.06.2019 11:43
    My fault, I made it

    Read more...

     
  • NotificationAry - get emails on Joomla content is submitted, added or changed

    Berndi Berndi 30.06.2019 10:46
    I did. Now I'm asking me how to put the surename into the email... :-|

    Read more...

     
  • NavigationAry - navigate between Joomla menu items like between articles using "prev - next"

    Berndi Berndi 29.06.2019 15:59
    I also miss content in %TO_NAME%

    Read more...

     
  • NotificationAry - get emails on Joomla content is submitted, added or changed

    Berndi Berndi 29.06.2019 15:15
    Hi gruz, I have the problem, that when I use the %AUTHOR% tag, the plugin dosen't send the author ...

    Read more...