8.5.19

Docker Series



I will be writing some articles about docker. The objective of these articles is to help me keep a brief and consis reference about docker for myself and eventually it will help someone else too. In this series, most of the time, I will not provide explanation to what I am writing, if you find something interesting to you and you need to discuss it leave me a comment and I will try to help as much as can.


Docker Basics



In this article we will discuss 
• What is docker and why?
• Basic docker commands
Why is Docker?
How many times have you tried to install a software and its dependencies and you ran into errors? This is what docker aims to solve, run a software and its dependencies seamlessly on both personal computers and cloud servers. Docker makes it easy to package and ship software.
What is Docker?
It is an application that runs packages which are called containers. A container is a package that has a software and all of its dependencies and configurations. A container is an instance of a docker image.
Basic docker commands:
• docker run hello-world [optional command override] (hello-world is the image name)
• docker ps (listing running containers)
• docker ps -all
• run = create + start
• docker create Image
• docker start ContainerId
• docker start -a Container Id (a prints out the container output to the command prompt)
• docker system prune (clear stopped containers and cache)
• docker logs ContainerId
• docker stop Container Id (SIGTERM)
• decker kill Container Id (SIGKILL)
• docker exec -it Container Id command
• docker exec -it Container Id sh
• docker run Image sh

31.3.18

SharePoint 2013 Workflow Configuration

I am writing this article in order to document the steps of configuring and enabling workflow in SharePoint 2013.


  • Open Web Platform Installer and if you don't have it installed you can download load it here
  • Search for Workflow Manager and install it.
  • Open SharePoint PowerShell and run the command [Register-SPWorkflowService] find the details of the command here
  • Now you have to configure the workflow permissions and to do so you have to follow this article
  • Now, install SharePoint update osfserver2013-kb2880963-fullfile-x64-glb.exe
  • Finally, don't forget to add your Content Type to the Workflow Tasks List.

9.8.16

AgilePoint NX Installation - First Run - Internal Server Error 500.19

If you ever installed AgilePoint NX and you installed all the prerequisites and at the first run you got the following error:








The error indicates an invalid web.config file, but it is a brand new installation and the config file has not been touched yet. So what's the problem, after doing some research I noticed that the config file uses the IIS Rewrite Module, so I downloaded the Web Platform Installer and installed the IIS Rewrite Module and Voila! the issue was resolved.

28.6.16

SharePoint and PowerShell Scripts

Introduction

PowerShell scripts are very powerful, you can do almost everything with them. Also, there are some features cannot be managed through UI and only available through PowerShell. 

Writing scripts to automate deployments and configuration becomes very useful for repeatable tasks which will save you much time. Also, writing PowerShell scripts reduces human errors.

It is most useful when the deployment package will be deployed repeatedly and in different environments like (Testing environment and then production environment). 

I believe as a SharePoint developer you should become familiar with PowerShell scripts and start writing them eventually.

Sample Deployment Script

The following sample script deploys a solution to SharePoint site:


Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$siteUrl = "http://sp2013:8000"

# it is always better to deactivate features in the solution if they already exist
$features = Get-SPFeature | Where-Object {$_.DisplayName -like "*HelloWorldWebPart*"}
foreach($feature in $features)
{
    Disable-SPFeature $feature -Url $siteUrl -Confirm:$false
    Write-Host Feature $feature.DisplayName was deactivated
}

$solutionPackageName = "HelloWorldWebPart.wsp"
$solution = Get-SPSolution | Where-Object {$_.Name -eq $solutionPackageName}
#check to see if the solution package has been installed
if ($solution -ne $null)
{
    # check to see if solution package is currently deployed
    if ($solution.Deployed -eq $true)
    {
        Uninstall-SPSolution -Identity $solutionPackageName -WebApplication $siteUrl -Confirm:$false
        Write-Host Solution $solutionPackageName is retracting.
    }
    
    # wait utill the solution is retracted
    $solution = Get-SPSolution | Where-Object {$_.Name -eq $solutionPackageName}
    while ($solution.Deployed -eq $true)
    {
        sleep -s 10
        $solution = Get-SPSolution | Where-Object {$_.Name -eq $solutionPackageName}
    }

    Remove-SPSolution -Identity $solutionPackageName -Confirm:$false
    Write-Host Solution $solutionPackageName was removed.
}

$solutionPath = $PSScriptRoot + "\" + $solutionPackageName
Add-SPSolution -Literal $solutionPath
Write-Host Solution $solutionPackageName was added.
Install-SPSolution -Identity $solutionPackageName -Local -GACDeployment -WebApplication "http://sp2013:8000"
Write-Host Solution $solutionPackageName was deployed.

$features = Get-SPFeature | Where-Object {$_.DisplayName -like "*HelloWorldWebPart*"}
foreach($feature in $features)
{
    Enable-SPFeature $feature -Url $siteUrl
    Write-Host $feature.DisplayName was activated.
}

Saving / Editing and Running the Script

Copy the script into notepad then save it with .ps1 extension. Make sure you edit the SiteUrl to your testing site before you save the file.

To run the script you can right click the file and click Run with PowerShell. If you want to keep the command window open once the script is finished add Read-Host at the end of the script.

The output of running the script will look like this: