2013-07-05, Friday powershell ps tools utils

Download Sysinternals With PS Updated

Update with oneliner

(Invoke-WebRequest "http://live.sysinternals.com").Links | select href | % { Invoke-WebRequest ("http://live.sysinternals.com"+$_.href.ToString()) -OutFile (Join-Path "$PWD" $_.href.ToString()) -Verbose }

Download all the tools from Sysinternals

Practice, practice, practice! I really do want to learn PowerShell and to write...in English.

This snippet downloads all tools from http://www.sysinternals.com/ into a subfolder in the current directory.

    $global:sysinternals = "http://live.sysinternals.com"
    $dest = Join-Path $PWD "Sysinternals"
    $global:numberToDownload = 0


    function Download-File {
        begin {
            $count = 1
        }
        process {
            $file = Join-Path $dest $_.innerHtml
            $url = $global:sysinternals + $_.href
            Write-Progress -Activity "Getting Sysinternals, total files: $global:numberToDownload" -CurrentOperation $url -PercentComplete ([System.Math]::Round($count/$global:numberToDownload, 2) * 100)
            Write-Host $url
            Invoke-WebRequest $url -OutFile $file

            $count++
            }
        }

        # Main

        if(!(Test-Path $dest)){ mkdir $dest }
        $wr = Invoke-WebRequest $sysinternals
        $global:numberToDownload = $wr.Links.Count

        $wr.Links | Download-File

2013-07-04, Thursday restart

Reestart

Blog has been restarted

Blog has a new face, now in bootstrap


2013-07-04, Thursday ps powershell tools utils

Download Sysinternals With PS

Download all the tools from Sysinternals

Practice, practice, practice! I really do want to learn PowerShell and to write...in English.

This snippet downloads all tools from http://www.sysinternals.com/ into a subfolder in the current directory.

    $global:sysinternals = "http://live.sysinternals.com"
    $dest = Join-Path $PWD "Sysinternals"
    $global:numberToDownload = 0


    function Download-File {
        begin {
            $count = 1
        }
        process {
            $file = Join-Path $dest $_.innerHtml
            $url = $global:sysinternals + $_.href
            Write-Progress -Activity "Getting Sysinternals, total files: $global:numberToDownload" -CurrentOperation $url -PercentComplete ([System.Math]::Round($count/$global:numberToDownload, 2) * 100)
            Write-Host $url
            Invoke-WebRequest $url -OutFile $file

            $count++
            }
        }

        # Main

        if(!(Test-Path $dest)){ mkdir $dest }
        $wr = Invoke-WebRequest $sysinternals
        $global:numberToDownload = $wr.Links.Count

        $wr.Links | Download-File

2013-01-19, Saturday blogengine firstpost first

This is the first official post with blog

This first offical post with blog. My blogengine. Dead-simple!

Edjer is a blogengine I wrote to learn ASP.NET MVC

  1. Written i ASP.NET MVC
  2. LINQ is my new friend
  3. Posts are stored in the filesystem as in ~/App_Data/Blog in a database folderhierarchy. The folder named YYYY\MM\DD is date the post is written.
  4. All posts are written in Markdown translated to HTML with MarkdownSharp
  5. The first row in a post is metadata {tag1,tag2,tag3,tag4,etc)
  6. Extra pages are stored in ~/App_Data/Pages, about.md, cv.md etc

How I publish my posts

  • All files are every published every night with a scheduled ftp-script

TODO-list

  • Home
    1. Powershell-script run on my homeserver + triggered when new files appear in my Dropbox, the files are then transfered with FTP and the site is reloaded to cache
    2. maxCount on /Home/Index?max=10, default = 20
    3. Add link to my Twitter and to my Git-page. No mail och Facebook needed.
  • Pages
    1. Change the icon for pages to something different from posts
    2. Make it work with /page/page_name or /page/page%20name
  • Preload all posts and pages in memory
  • Reload-Url (/reload?key=my-secret-reload-key-from-webconfig ?)
  • Indexing of categories and tags? Maybe later...
  • Tags
    1. handles only Posts, make it handle Pages as well
    2. /tag/heatmap
    3. /tag/sortbydate
    4. /tag/sortbyname
    5. /tag/sortbycount
    6. Make /tag/tagname as pretty as /home/index, and make it handle all BlogContent
  • Create default theme
    1. Simplify design CSS ==> Boostrap
    2. Borrow from Leo Babauta
  • Simplify HTML
  • Clean up the code, remove unused code, files and folder
  • No Config (assume everything), only two settings one is default
    1. BlogPath: where all data is stored, default is set to "~/App_Data"
    2. LoadSecretKey is set to "" per default, ie can run until this is set.
  • RSS
    1. Create RSS-feature ( /home/rss ?)
    2. Connection to feedburner
  • Publish on GitHub
    1. Clean up App_Data in webproject, a few testingposts + instructions
    2. Clean reloadkey
  • To write
    1. Blog about tool for iOS
    2. Write post how I wrote blog (step-by-step, File->Project to Build->Publish)
    3. Create instruction on howto publish from VS Web Express to your provider
    4. Create instruction on howto publish from WebMatrix to your provider
    5. Finish HOWTO-get started, put it on GitHub
  • Content
    1. Migrate content from old blog, maybe
  • Tools
    1. Find app to iPhone/iPad to make it possible to blog from there

HOWTO get started

  1. Download/get the source from (link to git)
  2. Change style or use the default
  3. Copy to your provider (instruction howto do that on page)
  4. Upload your first post
  5. Etc