<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Inoltro ninux-dev per "competenza".<br>
    <br>
    Il 19/02/2014 10:14, Francesco Rapanà ha scritto:<br>
    <blockquote
cite="mid:CACsqx8PDeGgiKYsw3rdNJjFPUg1aY4szvHaMZQeoLDU5L-CyiQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Nel caso il file si trovi sulla stessa macchina
        dove gira lo script va bene, ma se il file si trova su un'altra
        macchina mi pare che il codice non è ancora presente, o sbaglio?
        In questo caso lo script farebbe @readfile($url_file_altro_nas)
        o farebbe un redirect verso lo script che gira sul nas che
        contiene il file?</div>
    </blockquote>
    Hai ragione non è ancora stato implementato, ma perché sto appunto
    aspettando che mi arrivi un altro device per fare lo sviluppo su
    entrambi, di modo che poi si possa passare agli step successivi.<br>
    Comunque, in teoria parsa l'hash e se c'è il token non guarda in
    locale ma fa una richiesta in broadcast rivolta a quel token, che a
    sua volta parsa l'hash e tira fuori il file.<br>
    Lo script locale re-inoltrerebbe l'output della macchina remota, ma
    non so a questo punto quale potrebbe essere la reazione (se appare
    la finestra di download o fa qualche scherzetto).<br>
    Hai idee migliori?<br>
    <br>
    <blockquote
cite="mid:CACsqx8PDeGgiKYsw3rdNJjFPUg1aY4szvHaMZQeoLDU5L-CyiQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>In ogni caso readfile credo (non ho testato) dovrebbe dare
          problemi di memoria con file molto grandi se è abilitato
          l'output buffering, nei commenti su php c'è la funzione
          readfile_chunked con il flush. Andrebbe testato sia usando
          readfile con file locale che con url, mi preoccupa più questo
          secondo caso perché potrebbe tentare di scaricare prima il
          file in memoria locale e poi passarlo in output.</div>
      </div>
    </blockquote>
    <blockquote
cite="mid:CACsqx8PDeGgiKYsw3rdNJjFPUg1aY4szvHaMZQeoLDU5L-CyiQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div><span style="background-color:rgb(255,255,255)"><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px"><?php <br>
            </span><span class=""
              style="color:rgb(102,153,51);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">function </span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">readfile_chunked</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">(</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$filename</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">,</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$retbytes</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">=</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">true</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">)
              { <br>
                 </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$chunksize </span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">= </span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">1</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">*(</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">1024</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">*</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">1024</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">); </span><span
              class="" style="color:rgb(128,128,128);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">//
              how many bytes per chunk <br>
                 </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$buffer </span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">= </span><span
              class="" style="color:rgb(204,51,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">''</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">; <br>
                 </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$cnt </span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">=</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">0</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">; <br>
                 </span><span class=""
              style="color:rgb(128,128,128);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">//
              $handle = fopen($filename, 'rb'); <br>
                 </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$handle </span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">= </span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">fopen</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">(</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$filename</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">, </span><span
              class="" style="color:rgb(204,51,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">'rb'</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">); <br>
                 if (</span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$handle </span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">=== </span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">false</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">)
              { <br>
                     return </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">false</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">; <br>
                 } <br>
                 while (!</span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">feof</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">(</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$handle</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">))
              { <br>
                     </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$buffer </span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">= </span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">fread</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">(</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$handle</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">, </span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$chunksize</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">); <br>
                     echo </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$buffer</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">; <br>
                     </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">ob_flush</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">(); <br>
                     </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">flush</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">(); <br>
                     if (</span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$retbytes</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">)
              { <br>
                         </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$cnt </span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">+= </span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">strlen</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">(</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$buffer</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">); <br>
                     } <br>
                 } <br>
                     </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$status </span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">= </span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">fclose</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">(</span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$handle</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">); <br>
                 if (</span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$retbytes </span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">&& </span><span
              class="" style="color:rgb(51,102,153);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$status</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">)
              { <br>
                     return </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$cnt</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">; </span><span
              class="" style="color:rgb(128,128,128);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">//
              return num. bytes delivered like readfile() does. <br>
                 </span><span class=""
              style="color:rgb(102,153,51);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">} <br>
                 return </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">$status</span><span
              class="" style="color:rgb(102,153,51);font-family:'Source
              Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">; <br>
              <br>
              } <br>
            </span><span class=""
              style="color:rgb(51,102,153);font-family:'Source Code
              Pro',monospace;font-size:14px;line-height:20.440000534057617px">?></span></span><br>
        </div>
      </div>
    </blockquote>
    Avevo notato bene, infatti su questa cosa che mi ero ripromesso di
    parlarne in ML dev.<br>
    Come detto sopra, non lo so, andrebbe testato, e sto aspettando <a
      href="http://imx.solid-run.com/product/cubox-i4-pro/">questo
      device</a> da metà novembre (spedito poi il 2 febbraio).<br>
    Adesso è "<i>In carico al portalettere del centro postale di RM
      PALESTRINA CSD in data 19-FEB-2014"</i>), quindi in teoria
    dovrebbe arrivare a giorni, se non oggi stesso.<br>
    Ti terrò aggiornato cmq, perché essendo disoccupato e in risposta di
    notizie lavorative <a
      href="https://github.com/gubi/Ninuxoo-2.0/commits?author=gubi">sto
      lavorando a tempo pieno per Ninux</a> :D<br>
    <br>
    Grazie comunque per il coinvolgimento e per la funzione che testerò
    sicuramente ;)<br>
    A presto<br>
    <br>
    Gubi<br>
    <br>
    <blockquote
cite="mid:CACsqx8PDeGgiKYsw3rdNJjFPUg1aY4szvHaMZQeoLDU5L-CyiQ@mail.gmail.com"
      type="cite">
      <div class="gmail_extra"><br>
        <div class="gmail_quote">Il giorno 19 febbraio 2014 08:56,
          Alessandro Gubitosi <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:gubi.ale@gotanotherway.com" target="_blank">gubi.ale@gotanotherway.com</a>></span>
          ha scritto:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> <font
                face="Helvetica, Arial, sans-serif">Parli di una cosa
                come questa?<br>
                <a moz-do-not-send="true"
href="http://192.168.36.210/Scheda:?ZDQxZDhjZDk4ZjAwYjIwNGU5ODAwOTk4ZWNmODQyN2U6Ly9NdXNpY2EvR2lvcmdpbyBHYWJlci8oMTk4NCkgLSBHYWJlci8wNyAtIElsIFNvY2lhbGUubXAz"
                  target="_blank">http://192.168.36.210/Scheda:?ZDQxZDhjZDk4ZjAwYjIwNGU5ODAwOTk4ZWNmODQyN2U6Ly9NdXNpY2EvR2lvcmdpbyBHYWJlci8oMTk4NCkgLSBHYWJlci8wNyAtIElsIFNvY2lhbGUubXAz<br>
                </a><br>
                Non guardare l'ip perché poi dovrà andare su dns anycast
                ninux (ad es. sarà <a moz-do-not-send="true"
                  href="http://ninuxoo.ninux.org/" target="_blank">http://ninuxoo.ninux.org/</a></font><font
                face="Helvetica, Arial, sans-serif"><font
                  face="Helvetica, Arial, sans-serif">Scheda:?sde3uhswf3g)</font>.<br>
              </font><font face="Helvetica, Arial, sans-serif"><font
                  face="Helvetica, Arial, sans-serif">Per rendere questo
                  link scaricabile poi anche dall'america ci vorrà
                  magari un url shortener (in ninux ce n'è già uno) e un
                  proxy bgp come anche suggerisci tu, con un altro dns,
                  magari.<br>
                </font>L'hash contiene già tutto il percorso al file
                (col token del nas al posto del suo ip), per il resto i
                nas si trovano in rete da soli via mdns.<br>
                <br>
                Lo script imputato al download è questo qui: <a
                  moz-do-not-send="true"
href="https://github.com/gubi/Ninuxoo-2.0/blob/master/common/include/funcs/download.php"
                  target="_blank">https://github.com/gubi/Ninuxoo-2.0/blob/master/common/include/funcs/download.php</a><br>
                Grazie per la disponibilità del device, ma a meno che
                non mi dai accesso ssh per correggere gli script che man
                mano sistemo, meglio aspettare.<br>
                Sicuramente sarà utile nella fase di collaudo... ;)<br>
                Notizia: i NAS si potranno collegare tra loro anche se
                sono remoti, basta indicare l'indirizzo ipv(4|6) o
                dns... ;)<br>
                <br>
                A presto<br>
                Gubi<br>
                <br>
              </font>
              <div>Il 18/02/2014 22:23, Francesco Rapanà ha scritto:<br>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">Se ti può essere utile per i test, ho
                      un synology DS213j.
                      <div>Al momento sto vedendo come si potrebbe fare
                        una specie di proxy da installare su un route
                        reflector client in modo da rendere disponibile
                        all'esterno determinati file / cartelle interne
                        alla rete.</div>
                      <div>es: ho un NAS sul nodo xx e un BGP Route
                        Reflector con IP pubblico sul nodo yy. Se
                        volessi rendere "pubblici" determinati file del
                        NAS, il proxy potrebbe mostrare la lista dei
                        file su $IP_pubblico_yy/NAS_xx/ e per il
                        download credo andrebbe fatto qualcosa con fopen
                        / fread / fwrite</div>
                    </div>
                    <div class="gmail_extra"><br>
                    </div>
                  </blockquote>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>