Anwendungsvirtualisierung, Internet der Dinge und Cloud Computing, Blog von Sacha Thomet

Monats-Archive: October 2015

Überwache die Profile Verzeichnisse

Bereits vor Jahren als ich als Citrix Admin gearbeitet habe waren die anwachsenden Benutzerprofileverzeichnisse immer wieder ein Thema. Klar ist das Administratorenleben nun mit neueren Technologien wie dem Citrix User Profile Manager oder anderen 3rd Party Lösungen einfacher geworden, Profile Streaming und Exclusions können viel wert sein.

Trotzdem ist es immer noch ein Thema das als Citrix Admin oder Engineer berücksichtigt werden muss. In einer früheren Firma habe ich  Tool’s wie Treesize  (https://www.jam-software.com/treesize/) oder WinDirStat(http://windirstat.info) gearbeitet. Aber es gibt halt firmen die kein Geld für solche Tools ausgeben wollen oder auch OpenSource nicht trauen, bzw. der Softwareintegrationsprozess kompliziert und langwierig ist.

So hatte ich den Ansatz dieses Profilgrössenproblem mit Bordmitteln zu lösen. Ich habe nun ein kleines PoSh-Script erstellt welches mir rekursiv durch meine Profilordner läuft und die Grössen ausgibt.

#==============================================================================================
# Created on: 10.2015 Version: 0.3
# Created by: Sacha Thomet
# Filename: GetSubdirSizes.ps1
#
#
# Description: This script checks some Citrix Provisioning Server, Farm, vDisk & Target device parameters.
#
# Prerequisite: None
#
# Call by : Manual
#
# Change Log:
# V0.1 first version
# V0.2 only 1 recursive subfolder
# V0.3 corrections of calculation
#
#==============================================================================================



$path = "\\localhost\C$\temp\profiles\"
$top = "4000"
$outputpath = "C:\temp\SubdirSize-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">&euro;30<span class="amount">Million</span></div>

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


 //echo $string. " "; 
 echo str_replace(">&euro;","","$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.

Follow me on Twitter