a non-destructive way to modify a multi-boot

You can try gdisk: a very simple, easy, fast and safe, command-line tool.

With gdisk you can make several actions, such as:

  • convert a MBR disk to a GPT one (with the command gdsk and then the disk you want modify , i.g. /dev/sda, and the doing the command “w”, that is “write”)
  • re-order your partition table (with the command “s”, that is “sort”), if in your disk there is some “desorder”, i.g. if /dev/sdb8 is before /dev/sdb6.

Be careful, if you get a warning message that partitions will be deleted: it can really happen.

But mainly be careful that if you change the order of SO partitions you could not be more able to boot.

connecting android to samba in Linux

You must add in smb.conf (in /etc/samba), at [global] section and at “allow hosts = row, the android device IP, otherwise you won’t be able to connect it to PC samba network.

Then you can use several android apps, like X-plore (G-Play, commercial, but good) or Material File Manager (F-Droid, open source, quite spartan, but fast and reliable), to set the samba connection with your PC and view the files shared on your PC.

Provided, obviously, that PC and android device are both connected at the same local network.

php show a content in a given period of the year

You can use a very simple php code, f.e. for Christmas and Happy New Year greetings:

<?php 
$dataattuale = date('m-d');
$inizioauguri = date('m-d', strtotime("11/13"));
$finauguri = date('m-d', strtotime("01/10"));  
if (($dataattuale >= $inizioauguri) && ($finauguri <= $finauguri))
{include "$root/natalizio.php";} 
?>

The above code show the content of natalizio.php (in root folder) from November 13th to January 10th.

Another example

$now = date('Y-m-d');
$end = date('2024-07-15');  
if ($now <= $end)
{echo "some text";}

open-source cookie-bar solution

I found this very interesting and simple script: cookie-bar, customizable very easily here.

Unfortunately I didn’t manage to save and use that (free) javascript in local. No jquey, no css, a very short code.

The only thing you have to do is personalize the code within you have what you want hide if your visitor refuse your cookies.

The code should be something like the following:

<?php
 if ((isset($_COOKIE['cookiebar'])))
    {
    echo " [whatever you want";
    }
 else
    {
    echo "<div class=\"what-you-want\">to see this content accept our cookie policy.</div>";
    }
?>

radial gradient in new KDE

The new KDE Plasma releases require a slight change in your svg files, if you have a radiant gradient (no problems instead with the linear ones).

You have to specify the radialGradient cx, cy and r, like in the following example:

<?xml version="1.0" standalone="no"?>
<svg viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <radialGradient id="gradient" cx="0.50" cy="0.50" r="0.45">
      <stop offset="0%" stop-color="#fbfbf0"></stop>
      <stop offset="80%" stop-color="#bc5a1f"></stop>
    </radialGradient>
  </defs>
  <g>
    <path fill="url(#gradient)" d="M11 .008l3.4 6.888L22 8l-5.5 5.361 1.298 7.57L11 17.357l-6.798 3.574 1.298-7.57L0 8l7.6-1.104z" />
  </g>
</svg>

Because a svg with this other following code won’t work (will be invisible)

<?xml version="1.0" standalone="no"?>
<svg viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <radialGradient id="gradient">
      <stop offset="0%" stop-color="#fbfbf0"></stop>
      <stop offset="80%" stop-color="#bc5a1f"></stop>
    </radialGradient>
  </defs>
  <g>
    <path fill="url(#gradient)" d="M11 .008l3.4 6.888L22 8l-5.5 5.361 1.298 7.57L11 17.357l-6.798 3.574 1.298-7.57L0 8l7.6-1.104z" />
  </g>
</svg>