Playing Lumia 800 (My Friend’s Smartphone) vs HTC 8S (My Smartphone) in Traditional Way

In Indonesia, there were many traditional games but as time goes by they are replaced by digital devices. So, me and my friend decided to use our own smartphone in a traditional game. It’s called “TEPOKAN”. The rule is so simple, just put the smartphone on your palm then do the high five. Check it out in our video !!

Do you wanna play with us ??

Have Fun!!

Raka Satria

Playing Movie Using PowerShell (PowerShell Video Player)

Hufh….!!
I just bored with my daily activities and I decided to make some fun with powershell.
Now, We will try to playing Movie using PowerShell.
I used WPF library + XAML for that. so, let’s see it :D

#WPF Library for Playing Movie and some components
Add-Type -AssemblyName PresentationFramework
Add-Type -AssemblyName System.ComponentModel
#XAML File of WPF as windows for playing movie
[xml]$XAML = @"

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="PowerShell Video Player" Height="355" Width="553" ResizeMode="NoResize">
    <Grid Margin="0,0,2,3">
        <MediaElement Height="250" Width="525" Name="VideoPlayer" LoadedBehavior="Manual" UnloadedBehavior="Stop" Margin="8,10,10,61" />
        <Button Content="Pause" Name="PauseButton" HorizontalAlignment="Left" Margin="236,283,0,0" VerticalAlignment="Top" Width="75"/>
        <Button Content="Play" Name="PlayButton" HorizontalAlignment="Left" Margin="236,283,0,0" VerticalAlignment="Top" Width="75"/>
    </Grid>
</Window>
"@

#Movie Path
[uri]$VideoSource = "C:\Users\Raka\Downloads\HiVi!  - Orang Ke-3 Official MV HD.mp4"

#Devide All Objects on XAML
$XAMLReader=(New-Object System.Xml.XmlNodeReader $XAML)
$Window=[Windows.Markup.XamlReader]::Load( $XAMLReader )
$VideoPlayer = $Window.FindName("VideoPlayer")
$PauseButton = $Window.FindName("PauseButton")
$PlayButton = $Window.FindName("PlayButton")

#Video Default Setting
$VideoPlayer.Volume = 100;
$VideoPlayer.Source = $VideoSource;
$VideoPlayer.Play()
$PauseButton.Visibility = [System.Windows.Visibility]::Visible
$PlayButton.Visibility = [System.Windows.Visibility]::Hidden

#Button click event 
$PlayButton.Add_Click({
    $VideoPlayer.Play()
    $PauseButton.Visibility = [System.Windows.Visibility]::Visible
    $PlayButton.Visibility = [System.Windows.Visibility]::Hidden
})
$PauseButton.Add_Click({
    $VideoPlayer.Pause()
    $PauseButton.Visibility = [System.Windows.Visibility]::Hidden
    $PlayButton.Visibility = [System.Windows.Visibility]::Visible
})

#Show Up the Window 
$Window.ShowDialog() | out-null

Here’s a Screenshot of PowerShell Video Player
PowerShell Movie Player

I knew that it’s not good enough, but not too bad :P
I will create new version of it (if i need to…. hahaha)
LOL!! PowerShell is so much fun!!

Have fun with it!!

Raka Satria

Remote Exchange Management Shell (EMS) from your PC’s Powershell

I just tired to remote desktop and then create or configure something on my Exchange (2010, 2013) Server using PowerShell which is Exchange Management Shell (EMS)
So, I decided to create simple Script to help me Remote Exchange Management Shell from my own PowerShell at Home :) and here’s the script.

#Exchange URI
[uri]$ExchangeConnectionUri = "https://webmail.raka.satria/Powershell?serializationLevel=Full"
#Exchange Credential
$ExchangeUserName = "RAKA\Administrator"
$ExchangePassword = ConvertTo-SecureString "mypassword" -AsPlainText -Force
$ExchangeCredential = New-Object System.Management.Automation.PSCredential($ExchangeUserName, $ExchangePassword)
#Enter Exchange Server Session 
Enter-PSSession -ConnectionUri $ExchangeConnectionUri -Credential $ExchangeCredential -ConfigurationName Microsoft.Exchange -Authentication Kerberos

Now, I can really do anything on my pc :D

Hope this is helpful

Raka Satria

SharePoint 2013 SPDistributedCacheServiceInstance “cacheHostInfo is null”

Again, I get an error after I run “Remove-SPDistributedCacheServiceInstance”

“cacheHostInfo is null”

I can’t start Distributed Cache Service on SharePoint Central Administration, even I’ve run “Add-SPDistributedCacheServiceInstance”.
So, I realize that it happened because there is no cacheHost in SPDistributedCacheHostInfoCollaction but we can fix it with this script
here’s the script

$SPFarm = Get-SPFarm
$cacheClusterName = "SPDistributedCacheCluster_" + $SPFarm.Id.ToString()
$cacheClusterManager = [Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheClusterInfoManager]::Local
$cacheClusterInfo = $cacheClusterManager.GetSPDistributedCacheClusterInfo($cacheClusterName);
$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername}

if([System.String]::IsNullOrEmpty($cacheClusterInfo.CacheHostsInfoCollection))
{
	#here's the key. we can't provision, unprovision, start, or stop a Cache Service because we still have a Cache Service that have no server attached  
	$serviceInstance.Delete()
	Add-SPDistributedCacheServiceInstance
	$cacheClusterInfo.CacheHostsInfoCollection
}

and problem is solved… :D

Hope this is helpful

Raka Satria

SharePoint 2013 Unexpected exception in FeedCacheService.IsRepopulationNeeded: Unable to create a DataCache. SPDistributedCache is probably down.

Error :
Screenshot_6

Well, I was spanning all night just to clear them out from my SharePoint Server 2013. I searched everywhere hope somebody can help but I got nothing till finally I found the answer and here’s the thing.

First of all, running this on SharePoint Management Shell

Remove-SPDistributedCacheServiceInstance

then, make sure you registry @HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppFabric\V1.0\Configuration exactly same with your DistributedCacheService.exe.config file at “C:\Program Files\AppFabric 1.1 for Windows Server\DistributedCacheService.exe.config”
Screenshot_1

at last, you run this script

$SPFarm = Get-SPFarm
$cacheClusterName = "SPDistributedCacheCluster_" + $SPFarm.Id.ToString()
$cacheClusterManager = [Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheClusterInfoManager]::Local
$cacheClusterInfo = $cacheClusterManager.GetSPDistributedCacheClusterInfo($cacheClusterName);
$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername}
$serviceInstance.Delete()
Add-SPDistributedCacheServiceInstance
$cacheClusterInfo.CacheHostsInfoCollection

and errors will be gone…. :D hahaha

Hope this is helpful

Raka Satria

Error Install Office Web App Server 2013 on Windows Server 2012

Ok, Straight to the point…
If you got messages like these

  • Server Error in ‘/m’ Application
  • Warning: ASP.NET 4.0 – Event code: 3008 – Event ID: 1310
  • Could not load file or assembly ‘Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified. (C:\Program Files\Microsoft Office Web Apps\BroadcastServices_Host\web.config line 44)

I got the same problem like you and to solve this problem just type the following command on PowerShell:

Add-WindowsFeature NET-Framework-Features, NET-Framework-Core

or You can use Server Manager then Add Roles and Features to add .NET Framework 3.5

Those errors happen because in .NET 4.5 or 4.0, the version of Microsoft.Build.Utilities is 4.0. so, to solve that problem just add .NET 3.5 Core on Server.

Hope this is helpful

Raka Satria

Playing Music with PowerShell

Crazy, huh ?? yes, I am…
hehehe….
karena bosen dengan media player yang terlalu banyak macam, bentuk dan variannya so, iseng-iseng cari-cari akal supaya bisa playing lagu (mp3) pake powershell. ternyata karena kelebihan powershell yang luar biasa dapat melakukan akses hampir keseluruh object, assembly, dan net framework di OS membuat powershell sangat flexible. so, mumpung ini hari libur (minggu, 11/12/2011) jadi bersenang-senang dengan powershell should be fantastic, here we go…

berikut adalah Script untuk playing satu buah file mp3

Add-Type -AssemblyName PresentationCore
$mediaPlayer = New-Object System.Windows.Media.MediaPlayer
[uri]$fileName = 'C:\Users\Raka Satria\Music\Jason Mraz\Live at EBS Space Gonggam\Geek In The Pink.mp3
$mediaPlayer.open($fileName)
$mediaPlayer.Play()

cara pakenya tinggal ganti $fileName dengan file yang dah ada aja, terus save sebagai .ps1 kemudian execute di PowerShell

Script untuk playing sebuah folder musik :)

Add-Type -AssemblyName PresentationCore 
$mp3Player = New-Object System.Windows.Media.MediaPlayer 
$folderMusic = 'C:\Users\Raka Satria\Music\Jason Mraz\Live at EBS Space Gonggam' 
$musicFiles = Get-ChildItem -path $folderMusic -include *.mp3 -recurse 
$duration = $null
foreach($fileMP3 in $musicFiles) 
{ 
 "Playing $($fileMP3.BaseName)"
 [uri]$file = $fileMP3.FullName
 do {
    $mp3Player.Open($file)
    $duration = $mp3Player.NaturalDuration.TimeSpan.TotalMilliseconds
 }
 until ($duration)
 $mp3Player.Volume = 1
 $mp3Player.Play()
 Start-Sleep -Milliseconds $duration
 $mp3Player.Stop()
 $mp3Player.Close()
}

cara pakenya tinggal ganti $folderMusic dengan folder music yang dah ada aja, terus save sebagai .ps1 kemudian execute di PowerShell.

Selamat Bersenang-Senang….

Raka Satria