Tech blog

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.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

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.

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

Crazy tasty spiderI had recently to switch from geany code editor to visual studio code (further VS Code). I had my geany setup to use joomla coding standards for my code formatting. I used phpcs to inform me on problems. I didn't know how to use php-cs-fixer to automatically fix issues before and I'd like to add this function.

Since I code not only for Joomla, I need to use PSR2 coding standards for non-joomla code and to use PSR2 for other PHP projects.

For example in PSR2 coding standard a statement should look like this

if (true) {
    echo "yes';
}

In Joomla, the brace must be on the new line.

if (true)
{
    echo "yes';
}

The solution was rather tricky for me. So I write this note also for myself for later reference. I had to install somethings globally, system-wide, and some only per joomla workspace (joomla installation folder where I develop my extensions). I use OpenSuSE linux, but this would not make much difference to apply the steps for another OS.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
Multithumb found errors on this page:

There was a problem loading image http://static.xscreenshot.com/small/2017/09/02/12/screen_9f1481d6e69cb5f42a33e41631214653
There was a problem loading image http://static.xscreenshot.com/small/2017/09/02/12/screen_9f1481d6e69cb5f42a33e41631214653

screen_9f1481d6e69cb5f42a33e41631214653My Klipper clipboard manager refused to open on keyboard shortcut (I use Ctrl+`) in LXQT. The problem was, that my LXQT local is in Ukrainian, but shortcut is set in English.

The strange behavior was also because in global shortcut manager, when setting a keyboard shortcut was not possibel. The old ones were working.

After several hour of googling and experiments I have found out the global shortcuts must be selected when my LXQT local and current keyboard input language are the same.

So since my local is Ukrainian, I had to switch to Ukrainian input language and then assign shortcuts.

The shortcuts fire needed actions work with any active input language.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

spiderI used RokSprocket module with tabs layout. But it doesn't allow to select random articles on each page load. It's "random" articles means the same articles in random order on each page load. So instead of having 3 random articles in tabs, I get the same 3 ones in different order.

So I have implemented the same functionality but with real random articles in a dirty way - using 3 RegularLabs extensions (Sourcer, Tabs and Articles Anywhere) and some cutom code.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
Multithumb found errors on this page:

There was a problem loading image http://static.xscreenshot.com/small/2017/06/05/18/screen_feec84c36e0396d3548f67a38e13b948
There was a problem loading image http://static.xscreenshot.com/small/2017/06/05/18/screen_feec84c36e0396d3548f67a38e13b948
Joomla RSS doesn't provide a separate image field

I use zapier.com to post my Joomla article simultaniously to Facebook (RSS->Facebook group). And I face a problem, that Facebook illustrates the articles with a photo it choses on it's own (not the article photo). Zapier has an option to select an item photo, but Joomla article RSS doesn't output a separate image field.

So I used my MVC override plugin to extend Joomla and to add such a functionality. You may check this RSS feed as an example http://airsoft.in.ua/?format=feed&type=rss

A RSS part example (not bold part)

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
Multithumb found errors on this page:

There was a problem loading image http://static.xscreenshot.com/2017/06/05/17/screen_a4ded3298fe6c189cfc4b5e115ee7611
There was a problem loading image http://static.xscreenshot.com/2017/06/05/17/screen_a4ded3298fe6c189cfc4b5e115ee7611
screen_a4ded3298fe6c189cfc4b5e115ee7611
Effective UID is not root (euid=1000 egid=100 uid=1000 gid=100) (rc=-10)
Please try reinstalling VirtualBox.
where: SUPR3HardenedMain what: 2 VERR_PERMISSION_DENIED (-10) - Permission denied.

After each OpenSuse update (I have Leap 42.2 by now) I get the same error with VirtualBox.

Just a note for mysefl to fix it

sudo chmod 4711 /usr/lib/virtualbox/VirtualBox

I'm really tired to do it manually myself, but see no other way out by now.

Subcategories

General Joomla FAQ based on own experience.
Some linux tips just not to forget.
FaLang translation system by Faboba
ОУН-УПА: легенда спротиву Українська Дивізія «Галичина» Зиновій Книш: спогади й матеріали до діяння УВО і ОУН Реаніматор електронних текстів Забуттю не підлягає 1917-1991

See a typo?

Select the text block and press

CTRL+Enter

Comments

  • AutoReadMore - automatic read more for Joomla

    gruz gruz 16.01.2019 13:41
    Hi. Currently it's not possible to make intotext as the link. If you badly need, mail me, I'll try ...

    Read more...

     
  • AutoReadMore - automatic read more for Joomla

    mrwad mrwad 13.01.2019 13:23
    Dear Gruz! One more question. Is there any way to hide and make (blog text) clickable instead?

    Read more...

     
  • AutoReadMore - automatic read more for Joomla

    mrwad mrwad 27.12.2018 22:25
    My bad! Thank you for great plugin!

    Read more...

     
  • AutoReadMore - automatic read more for Joomla

    gruz gruz 27.12.2018 00:09
    Hi. Did you try setting "Strip Formatting" to yes?

    Read more...

     
  • AutoReadMore - automatic read more for Joomla

    mrwad mrwad 26.12.2018 21:16
    Dear Gruz! Thank you for awesome plugin! That saved a lot of time for me developing websites! I have ...

    Read more...