Application virtualization, IoT and Cloud Computing, Blog of Sacha Thomet

Monthly Archives: October 2015

Monitor you Profile directories

Since I had worked as a Citrix administrator the size of the profile directories was always a contemporary issue. It’s a fact that with new technologies like Citrix User Profile Manager the possibilities are grown and the life is easier with exclusion lists and profile streaming features. But it’s still a topic to consider if you are a Citrix admin or system engineer. I worked in former company with tools like TreeSize (https://www.jam-software.com/treesize/) or WinDir Stat (http://windirstat.info). But in some company they wont to spend money for tools which is only usable for one administrator or they don’t trust to OpenSource software (TreeSize).

I have the approach to solve every possible problem with on-board tools. So I created now a small script what give me the possibility to check my Profile directory with one recursive level so that I get each Size of a Profile within his subdirectories.:

#==============================================================================================
# Created on: 10.2015 Version: 0.3
# Created by: Sacha Thomet
# Filename: GetSubdirSizes.ps1
#
#
# Description: Collect Size of Dir's and Subsirs
#
# Prerequisite: None
#
# Call by : Manual
#
# Change Log:
# V0.1 first version
# V0.2 only 1 recursive subfolder
# V0.3 corrections of calculation
#
#==============================================================================================

$path = "\localhostC$tempprofiles"
$top = "4000"
$outputpath = "C:tempSubdirSize-Report.txt"

Function Get-FolderSize
{
 $Sizes = 0
 ForEach ($Item in (Get-ChildItem $Path))
 {
 If ($Item.PSIsContainer) {$Sizes = (Get-ChildItem $path"$Item" -recurse | Measure-Object -property length -sum).sum}
 Else {Write-Host "No Subfolder"}

 $SizeFormated = "{0:N2}" -f ($Sizes/1MB)
 New-Object PSObject -Property @{'Folder'=$Item;'Size'=$SizeFormated }
 }
}
$outfile = Get-FolderSize $path | sort -property Size –Descending |select -first $top
$outfile | out-file $outputpath
echo $outfile

IoT, LaMetric and mouse issues …

In summer 2014 I became a backer for the Kickstarter project LaMetric. LaMetric was advertised as a smart ticker for life and business. To be honest the Internet of Things (IoT) topic was not so present for me in summer 2014 and I just decided to spend some money for a cool gadget.

Last week I finally received my LaMetric Time and today I need to say it’s one of the coolest gadget I bought in the last months. With the acquisition of Octoblu, what Citrix made early this year and promoted on Citrix Synergy (especially on the GeekSpeak Tonight …) I’m now more aware of IoT an it’s possibilities!

LaMetric is the perfect IoT output device!

First LaMetric app

The creation of apps is pretty easy! On the LaMetric developper portal you can create your push or poll apps. With push you can transmit data to the LaMetric servers in JSON code. W ith pull it’s also easy, you just need a webserver on which you have a file in the correct format.

On this way I created the EuroMillions app which display the current Jackpot. The data are fetched from www.euro-millions.com and formatted with a small and simple PHP script:


{
 "frames": [
 {
 "index": 0,
 "text": "<?php 
$host = "http://www.euro-millions.com"; 
$filestring = file_get_contents($host); 
$startpos = 0; 
// <div class="est-jackpot">€30<span class="amount">Million</span></div>

while($pos = strpos($filestring, ">€", $startpos)) 
{ 
 $string = substr($filestring, $pos, strpos($filestring, "<span class=", $pos + 1) - $pos); 


 //echo $string. " "; 
 echo str_replace(">€","","$string");

 $startpos = $pos + 1; 
} 

?> Millions estimated in next Jackpot",
 "icon": "i616"
 }
 ]
}

Result:

LaMetric-EuroMillions

 

First IoT LaMetric Project

Problem

I’m living in an old farmhouse which is converted with some apartments, but it’s still a old house with a lot of wood. And the old problems … mouses. So I have now since some weeks 4 mouse traps installed, not the killing traps, only those which able me to take the mouse out of my apartment.

Problem: Every morning I need to check all mouse traps, because the traps are hidden positioned an annoying daily work. And with the risk that the mouse need to wait hours until I find them.

Concept

Now the concept of my first IoT project is to get alerted as soon a mouse get in a trap.

I want to solve this with:

  • a modified mouse trap with an attached window/door sensor, something like this http://store.wirelesstag.net/products/reed-kumosensor
  • an Octoblu workflow
  • and LaMetric as Output device.

The result must be this:

LaMetricMouse

Implementation

Need some hours … I have to learn how to handle  octoblu and learn a bit of JSON.