Create a NAS DIY based on OMV

Since a long time, I wish to create my home made NAS.
I used since a long time a very small NAS which is D-LINK DNS-320 with 2x2Tb Western Digital GREEN.
Very poor in term functionality and network speed, BUT it’s a good start.

My new setup is based on
– ASRock J5005-ITX MB Intel Gemini Lake
– 2x8Gb RAM (G.SKILL F4-2400C16S-8GRS Mémoire RAM SO D4 2400 C16 8 Go)
– 2x2Tb WD Green (my old disk)
– SSD Crucial 500Go CT500MX500SSD1 MX500
– Fractal FD-CA-NODE-304-WH 
– SilverStone SST-ST30SF v 2.0 – Serie SFX, 300W 

The Setup :

Asrock J5005-ITX :
Can accepts 4 SATA
About the RAM, if you buy a memory specify on the recommendation of Asrock(https://www.asrock.com/mb/Intel/J5005-ITX/index.fr.asp#Memory) you can use 16-32Gb of RAM.

About the OS, I choice OpenMediaVault (OMV) comparing to TrueNas (FreeNas).
I prefer debian Operating system…
About the performance, actually the CPU is enough for my usage.
Network speed :
I tested to write on my SSD and RAID 1 (which is 5400rpm) the speed is the same.

The content :

Shinobi :
Shinobi is the Open Source CCTV Solution written in Node.JS. Designed with multiple account system, Streams by WebSocket, and Direct saving to MP4. Shinobi can record IP Cameras and Local Cameras.

https://hub.docker.com/r/shinobicctv/shinobi/

Résultat de recherche d'images pour "shinobi docker"

Domoticz:
Domoticz is a Home Automation System that lets you monitor and configure various devices like: Lights, Switches, various sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water and much more. Notifications/Alerts can be sent to any mobile device.

Used with my Sonoff switch, Xiaomi Home, etc…

https://hub.docker.com/r/linuxserver/domoticz/

PhotoPrism :
PhotoPrism® is a server-based application for browsing, organizing and sharing your personal photo collection. It makes use of the latest technologies to automatically tag and find pictures without getting in your way. Say goodbye to solutions that force you to upload your visual memories to the cloud!

I loved this application, change my life !

https://hub.docker.com/r/photoprism/photoprism

[HOW TO] Use docker with internet/network

When you create you docker container by default it’s usable only offline.
It’s mean that you cannot use your network data or ping google for instance.

$ docker network create -d "transparent" -o com.docker.network.windowsshim.vlanid=7 my_transparent

You will create a new network using « transparent » driver, your internet connection can be gone few second.

To check if the command has been successfully done you can check your docker network with this command

$ docker network ls
NETWORK ID NAME DRIVER SCOPE
d78a094e2ade Default Switch ics local
b82a8e0d571a my_transparent transparent local
c0c3930cefce nat nat local

Look good !
Now run your docker container !

$ docker run -itd –net= »Default Switch » myImage:latest

THAT IT ! ENJOY !

[HOWTO] Show XTREAM in Windows

I looking for an solution for display a xtream broadcast in Windows and I cannot found any software for that.
The reason ? because there are no need to use a specific software for that !
You can use a Media Player like VLC.

How ?

http://server:port/get.php?username=<your username>&password=<your password>&type=m3u_plus&output=ts

In VLC: Media -> Open a Media -> Network
And paste your link here.

That it !
Enjoy

[How To] How to use property sheet in c# project

At the beginning the property sheet has been integrate from Visual Studio for C++ project.
You can centralize common information in this file and he can be used from all projects.

I would like to centralize the output directory of my all c# project.

Step 1 : 

Create a *.targets file.
Example : ( MainPropertySheet.targets)

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MainOutDir>$(SolutionDir)..\libs\VS2013\$(Configuration)\$(Platform)\</MainOutDir>
<MainConfiguration Condition="'$(Configuration)'=='Debug'">Debug</MainConfiguration>
<MainConfiguration Condition="'$(Configuration)'=='Release'">Release</MainConfiguration>
<MainConfiguration Condition="'$(Configuration)'=='Release_with_PDB'">Release</MainConfiguration>
</PropertyGroup>
</Project>

As you can see, I created 2 variables, « MainOutDir » and « MainConfiguration ».
For using this variable, you should write $(MainOutDir).

 

Step 2 :

Use our *.targets file in a other projects.
Open your *.csproj file with notepad.
Add this at the top of your file :

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(ProjectDir)..\..\..\Build\VS2013\MainPropertySheet.targets" />
<PropertyGroup Condition="'$(MainConfiguration)|$(Platform)' == 'Release|x64'">
<OutputPath>$(MainOutDir)</OutputPath>
...
</PropertyGroup>
</Project>

Save your file and reopen with visual. Enjoy !

[HOW TO] convert std::string to std::wstring

Simple function for convert your std::string to std::wstring in C++


std::wstring strTo_wstr(const std::string&amp; s)
{
int len;
int slength = (int)s.length() + 1;
len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0);
wchar_t* buf = new wchar_t[len];
MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len);
std::wstring r(buf);
delete[ ] buf;
return r;
}

[How To] Convert automatically bytes to adapted format (Qt)

QString formatBytes(long bytes)
{
QStringList suffix;
suffix &lt;&lt; &quot;B&quot; &lt;&lt; &quot;KB&quot; &lt;&lt; &quot;MB&quot; &lt;&lt; &quot;GB&quot; &lt;&lt; &quot;TB&quot;;
int i;
double dblSByte = bytes;
for (i = 0; i &lt; suffix.length() &amp;&amp; bytes &gt;= 1024; i++, bytes /= 1024)
dblSByte = bytes / 1024.0;
return QString(&quot;%1 %2&quot;).arg(dblSByte).arg(suffix.at(i));
}

For example :

formatBytes(1048576);
He returns : « 1 MB »

How to convert timestamp to formatted date/time in qml/javascript

function timestampConverter(time){
var ret;
var date = new Date(time*1000);// hours part from the timestamp
var hours = date.getHours(); // minutes part from the timestamp
var minutes = date.getMinutes();// seconds part from the timestamp
var seconds = date.getSeconds();
var day;
switch(date.getDay()){
case 1:<br />
day = "Lundi";
break;
case 2:
day = "Mardi";
break;
case 3:
day = "Mercredi";
break;
case 4:
day = "Jeudi";
break;
case 5:
day = "Vendredi";
break;
case 6:
day = "Samedi";
break;
case 7:
day = "Dimanche";
break;
}
var num = date.getDate();
var year = date.getFullYear(); // will display time in hh:mm:ss format
var formattedTime = hours + ':' + minutes + ':' + seconds;
var formattedDate = day + " " + num + " " + year;

//console.debug("Time : " + formattedTime + " " + formattedDate);
}

How to get RSS flux in QML

For this example, i using the QtQuick 1.1, but normally, you shouldn’t have problem if you use the newer version of QtQuick.

For this example, i getting the RSS from http://vianavigo.com/fr/actualites-trafic/rss-vianavigo-vos-transports-en-commun-en-ile-de-france-optile-ratp-sncf/?type=102

XmlListModel{
id: xmlModel
source: "http://vianavigo.com/fr/actualites-trafic/rss-vianavigo-vos-transports-en-commun-en-ile-de-france-optile-ratp-sncf/?type=102"
query: "/rss/channel/item
namespaceDeclarations: "declare namespace content=\"http://purl.org/rss/1.0/modules/content/\";"   //For getting content:encoded !!
XmlRole { name: "pubDate"; query: "pubDate/string()" }
XmlRole { name: "titre"; query: "title/string()" }
XmlRole { name: "description"; query: "description/string()" }
XmlRole { name: "detail"; query: "content:encoded/string()" }            //You should declare the namespace for getting this parameters
}

And now your xmlModel is ready you can use

ListView{
id: listView
model: xmlModel
}

For getting this example :

media:thumbnail url="<a href="http://farm5.static.flickr.com/4048/4362801851_b80289ca0e_s.jpg">http://farm5.static.flickr.com/4048/4362801851_b80289ca0e_s.jpg</a>"height="75" width="75"

 

XmlRole { name: "thumbnail"; query: 'media:thumbnail/@url/string()' }