Tuesday, January 26, 2016

PowerShell

AUTOMATING WITH JENKINS AND POWERSHELL ON WINDOWS

PowerShell IDEs Alternative

Resources

  • http://powershell.org/wp/
  • http://blogs.technet.com/b/heyscriptingguy
  • http://github.com/OneGet/oneget                3:00
    • Get-Command -Module PackageManagement | Sort-Object Noun, Verb
      • Find-Package | Out-GridView
    • ..

Tools

Comlets

Get-Command

# Search command
Get-Command -verb "get"
Get-Command -noun "service"

# Get-Help
Get-Help Get-Command
Get-Help -examples
Get-Help -detailed
Get-Help -full
Get-Help -online
Get-Command -?


makecert -n "CN=PowerShell Local Certificate Root" -a sha1 -eku 1.3.6.1.5.5.7.3.3 -r -sv root.pvk root.cer -ss Root -sr localMachine
make cert -pe -n "CN=PowerShell User" -ss MY -a sha1 -eku 1.3.6.1.5.5.7.3.3 -iv root.pvk -ic root.cer


# With RemoteSigned we can run our script
Set-Location 'D:\GitHub\beginning-PS-Dev\pss\'
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser 
. '.\6-do-something.ps1'

# With Unrestricted we can run anything
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser 
$doSomething = 'D:\GitHub\beginning-PS-Dev\pss\6-do-something.ps1'
. $doSomething

Get-ExecutionPolicy -List

Set-ExecutionPolicy -ExecutionPolicy Unrestricted
Enable-PSRemoting -Force
Set-Item wsman:\localhost\client\trustedhosts *
Restart-Service WinRM

Test-WSMan 192.168.140.250

Thursday, January 14, 2016

Hypervisor Options

Lists:
  1. Microsoft Hyper-V (Windows Server 2012 R2)
  2. VMWare
  3. Citrix
  4. VirtualBox
  5. Xen

FW: Principles behind the Agile Manifesto

We follow these principles:
Our highest priority is to satisfy the customer
through early and continuous delivery
of valuable software.
Welcome changing requirements, even late in
development. Agile processes harness change for
the customer's competitive advantage.
Deliver working software frequently, from a
couple of weeks to a couple of months, with a
preference to the shorter timescale.
Business people and developers must work
together daily throughout the project.
Build projects around motivated individuals.
Give them the environment and support they need,
and trust them to get the job done.
The most efficient and effective method of
conveying information to and within a development
team is face-to-face conversation.
Working software is the primary measure of progress.
Agile processes promote sustainable development.
The sponsors, developers, and users should be able
to maintain a constant pace indefinitely.
Continuous attention to technical excellence
and good design enhances agility.
Simplicity--the art of maximizing the amount
of work not done--is essential.
The best architectures, requirements, and designs
emerge from self-organizing teams.
At regular intervals, the team reflects on how
to become more effective, then tunes and adjusts
its behavior accordingly.

Automated Deployment with Octopus Deploy

1. Packaging

  • Packages have:
    • Metadata (ID, version)
    • Content files
  • Packages live in repositories
    • FileShares
    • Web Servers
  • Package with NuGet Package Explorer
    • upload package to octopus server vis Library Menu
    • Create Project to include the Library
    • Push the deploy Button to deploy the project to different servers.
  • Packages could be feed from third party
  • Creating packages with OctoPak
    • Visual Studio NuGet Package: OctoPak, 
      • via Nuget
      • via package manager console
        • Install-Package OctoPak
    • select related Project
      • Database
      • Service
      • WebSite
    • msbuild /t:Rebuild /p:Configuration=Release /p:RunOctoPack=true
    • msbuild /t:Rebuild /p:Configuration=Release /p:RunOctoPack=true /p:OctoPackPackageVersion=1.0.1 /p:OctoPackPublishPackageToFileShare=C:\Packages

    2. Octopus Tentacle

    • listening tentacle
    • polling tentacle




    Tuesday, January 12, 2016

    Capture Performance Data

    • Windows Performance Tools
      • Task Manager
      • Resource monitor
        • More detailed info
        • Includes hard disk info
      • Performance Monitor
        • analysis performance in real time
          • 100's of different counters to measure with
        • Can save results and settings for later use.
    • Data Collector Sets
      • Collection of Counters
        • Comes with some pre-defined sets
          • %systemdrive%\PerfLogs\Admin\BaseLine
      • Can be scheduled
      • Automatically placed into reports
      • Can use predefined collection or created your own
      • Great for creating baselines and ongoing statistics
    • Reliability Monitor.
      • Can be scheduled
      • Tracks changes
        • Add / remove a role
        • Software installs / un-installs
      • System Stability Index
        • Rates system from 1 to 10
        • System and software crashes reduce rating
        • Rating goes up over time if system is stable
      • To enable:
        • regedit: localMachine\Software\Microsoft\Reliability Analysis\WMI\ 
          • New DWord: WMIEnable -> 1
    • Performance Test:
      • JMeter

    Monday, January 4, 2016

    GoLang


    Go Settings on Windows / Linux

    set GOROOT=C:\Go\
    set GOPATH=C:\GoPath\
    set GOBIN=%GOPATH%/bin
    set PATH=%PATH%;C:\Go\bin;%GOBIN%

    export GOROOT=$HOME/go
    export GOBIN=$GOROOT/bin
    export GOARCH=amd64
    export GOOS=linux
    export PATH=$GOBIN:$PATH

    then go install hello.go, hello.exe will be installed into GOBIN

    Miscellaneous

    A closer look at go and nodejs
    Welcome Go, and Farewell Node.js   by TJHoloWayChuk
    Good Tutorial: Build Web Apps with Go Language (golang)
    General discussion of GOLang
    Google's APP Engine Supports: Python   PHP   Java   GO
    Restful WebService
    • Learn industry standard language 
    • Learn many language, don't be religious about it, be pragmatic. Languages are tools, nothing more
    • Include one language that supports class abstractions (like Java or C++)
    • one that supports functional abstraction (like Lisp or ML)
    • one that supports syntactic abstraction (like Lisp)
    • one that supports declarative specifications (like Prolog or C++ templates)
    • one that supports coroutines (like Icon or Scheme)
    • and one that supports parallelism (like Sisal)
    • Learn at least a half dozen programming languages
    • projecteuler.net is a good place to find increasingly difficult problems to solve and doesn't care what language you are using
    • Learn one of these, and you'll always have a job
      • Javascript/CSS/HTML
      • Java / C++  / C# /  Python
      • Go  An Introduction.mp4:  go test ...   gocov test ....
    • Go Links
      • golang.org
      • tour.golang.org
      • godoc.org