Menu Close

How to mount Windows Shared Folders on Debian

 

If you need to have easy access to Windows Shared Folders from your debian (or any other linux distro) steps are very easy!

 

 

Before starting, you need:

– Samba on your debian computer

– UserName and Password of a Windows User that can access to the shared folders

– The path of the folders (es. “//server/cartella” or “//192.168.0.1/cartella”)

– Root access on your debian computer

 

Upgrade to the latest version of emoncms 3

by openenergymonitor.org

To upgrade to the latest version of emoncms:

1) Download the latest version and unzip to your chosen server directory

https://github.com/openenergymonitor/emoncms3

Or if you use git, use git clone when installing for the first time:

git clone git@github.com:openenergymonitor/emoncms3.git

and then all you need to call is git pull and it will download and update the latest changes.

Force HTML5 and HD for embedded youtube video

With the quantity of mobile devices that surfing in the net, and the recent news about not flash support on the new devices, the integration of html5 is needed for compatibility.

So, if you want to force HTML5 and HD for an embedded video, you can use this code:

 

<iframe src="http://www.youtube.com/embed/pmPNz8JJCm8?html5=1&vq=hd720"></iframe>

Modify AjaXplorer for show images in browser

If you want that AjaXplorer shows in browser images from generated public links, you can modify  class.fsAccessDriver.php (in Ajaxplorer4.3.3 is under plugins\access.fs\) at about Line 202:

 

AJXP_Controller::applyHook("dl.localname", array($this->urlBase.$selection->getUniqueFile(), &$localName, $this->wrapperClassName));
// $this->readFile($this->urlBase.$selection->getUniqueFile(), "force-download", $localName);
$Nomefile = $selection->getUniqueFile();
AJXP_Logger::debug("trovo l'estensione di ".$Nomefile);
$pathParts = pathinfo($Nomefile);
//if(isset($pathParts['extension']))
if (array_key_exists('extension', $pathParts))
{
    $ext = strtoupper($pathParts['extension']);

    AJXP_Logger::debug("estensione: ".$ext);

    $pos = strpos($_SERVER["REQUEST_URI"] , "public");

    if ($pos !== false) {
        if ( $ext == 'JPG' || $ext == 'BMP' || $ext == 'PNG' || $ext == 'JPEG')
        {
            $this->readFile($this->urlBase.$selection->getUniqueFile(), "image", $localName);
        }
        else
        {
            $this->readFile($this->urlBase.$selection->getUniqueFile(), "force-download", $localName);
        }
    }
 else
    {
        $this->readFile($this->urlBase.$selection->getUniqueFile(), "force-download", $localName);
    }
} else { $this->readFile($this->urlBase.$selection->getUniqueFile(), "force-download", $localName); }

With a bit of code I check if the current request it’s done from a public url, and in this case I force the visualization of the image instead of simple download it.
I have to check Request_URI for “public” because otherwise when you press the “download” button inside ajaxplorer the browser opens the image instead of download it.

 

If you need to enable debug mode, you can modify conf/bootstrap_context.php with:

define("AJXP_SERVER_DEBUG"  , true);