windows issues

In KDE Linux it could happen some issues with windows:

  1. rules not memorized: to fix it check if configurations files (tipically in ./config/ kwinrc and kwinrulesrc) have the right permissions (avoid: non access).
  2. new window below others already active: such as Clementine’s window, called from system tray, going below other windows; to fix this you have to set Focus stealing prevention in Window Behavior (the first tab of Window management in System settings) to none, as you can see in the image

    la regola da impostare.

KDE no longer working

If your smartphone doesn’t connect any more with the PC, the problem could be <b>the firewall</b>.

To fix this, you can:

1.install gufw

2.Open gufw from app launcher
Go to the Rules tab
Click the [+] button to add a new rule
Select the direction “Both”
Select category “Network:
Select Application “KDE connect”
Click “Add”

Done!

FreeDCam

It is an interesting android open source camera app, which allows you to control the smartphone camera in a very detailed way.

Unfortunately it hasn’t an easy graphical interface: therefore you should know that a) you can get settings sliding the screen (from left and from bottom); b) you must set an external storage, otherwise you won’t be able to take any photo.

regex replace keeping a part of a string

Today I managed to replace (in html file links and anchors) absolute paths with relative ones.

I needed to keep the anchors and links number.

I did so:

search: href="#_ftn([0-9])">
replace: href="#_ftnref\1" id="_ftn\1">

In this way href=”#_ftn1 was replaced by  href="#_ftnref1" id="_ftn1", href=”#_ftn2 was replaced by  href="#_ftnref2" id="_ftn2", and so on.

For numbers with two digits

search: href="#_ftn([0-9][0-9])">
replace: href="#_ftnref\1" id="_ftn\1">

Only the search string is to be modified, if you have more digits (f.e. [0-9][0-9][0-9][0-9] if you have numbers with four digits, such as 1276), not the replace one (so don’t write \1\1).

digits within brackets

To replace digits within brackets you have to escape the brackets with ‘\’, thus: ‘\(‘, or ‘\[‘. For example, if you plan to convert every ‘(some digits) ‘ with ‘</p><p>(some digits)’, you should use this code:

find: \(([0-9])\)
replace: </p><p>(\1)

update wordpress in localhost

First of all backup your database follwing these insctructions.

  1. Get the latest WordPress zip (or tar.gz) file.
  2. Unpack the zip file that you downloaded.
  3. Deactivate plugins.
  4. Delete the old wp-includes and wp-admin directories on your web host (through your FTPor shell access).
  5. Using FTP or your shell access, upload the new wp-includes and wp-admin directories to your web host, in place of the previously deleted directories.
  6. Upload the individual files from the new wp-content folder to your existing wp-content folder, overwriting existing files. Do NOT delete your existing wp-content folder. Do NOT delete any files or folders in your existing wp-content directory (except for the one being overwritten by new files).
  7. Upload all new loose files from the root directory of the new version to your existing WordPress root directory.

NOTE – you should replace all the old WordPress files with the new ones in the wp-includes and wp-admin directories and sub-directories, and in the root directory (such as index.php, wp-login.php and so on). Don’t worry – your wp-config.php will be safe.

Be careful when you come to copying the wp-content directory. You should make sure that you only copy the files from inside this directory, rather than replacing your entire wp-content directory. This is where your themes and plugins live, so you will want to keep them. If you have customized the default or classic themes without renaming them, make sure not to overwrite those files, otherwise you will lose your changes. (Though you might want to compare them for new features or fixes..)

Lastly you should take a look at the wp-config-sample.php file, to see if any new settings have been introduced that you might want to add to your own wp-config.php.

More details here.

folding code in Kate

Today I noticed that if I write [b]BEGIN[/b] in a row that row is the beginning of a collapsable section, until a row with [b]END[/b].
F.e. /* — BEGIN common tags — / as beginnning and / — END common tags — */ as end.
And I can have nested collpsable sections, even in an html file ( , f. e.)