Working with PowerShell Core on Linux

Here are some useful notes I have been updating whenever I have some new findings.

Installation

First thing first, here is the official documentation on installing pwsh or pwsh-preview on Linux OS.

A known issue

This is a known issue that pwsh will hang after executing any external command if $TERM is screen, i.e. you are running pwsh inside a screen. However, according to the GitHub comment, it seems screen is to blame.

Though this does not limit its usage with other system utilities, I’d like to know if readers like you have some handy solution… Comment below! Continue reading “Working with PowerShell Core on Linux”

A journey with Application Insights

Recently I have been trying to enable Application Insights (AI) on my simple SPARQL query UI on ASP.NET Core 2.1, with reference to quick-start guide on Microsoft Docs. After completing the configuation and trying out the website locally, I believe everyting worked fine. Though the SLA guarantees the delay of telemetries should be under 2 hours, actually I can see the requests in my development environment on Azure dashboard in less than 10 minutes. Continue reading “A journey with Application Insights”

Try WikiClientLibrary on Xamarin Workbooks!

I’ve noticed that MS announced their first pre-release for Workbooks, which allows you to experiment with .NET Framework / .NET Core / Xamarin / WPF in a Jupyter-like fashion. It’s like an enhanced version of C# interactive window.

What is really an improvement, is that you can add reference to NuGet packages in a similar way as you are working with a full C# project, so it exhibit a chance for me to play with WikiClientLibrary. Hopefully, it might give Wiki contributors some convenience on automated edits, such as word-replacement in batch.

Experiment with Workbooks and WCL

If resx localization doesn’t work on your .NET Core application…

Let’s say, you are writing .NET Core application in VS 2017. You have added the following resx resource files to your project

  • Resources.resx (Let’s take it as en)
  • Resources.fr.resx
  • Resources.zh-Hans.resx

However, when running on a French OS, sometimes you may still get English text  for Resource via GetString.

You might as well try Rebuilding the project.

Written a MediaWiki Client Library

This is a MediaWiki client library based on .NET PCL, targeting at .NET Framework 4.5, ASP.NET Core 1.0, Xamarin.iOS, and Xamarin.Android. The verified supported MediaWiki API version can be as low as MediaWiki 1.19 (Wikia). FYI, now Wikipedia is using MediaWiki 1.28.

Repository: https://github.com/CXuesong/WikiClientLibrary

Other MediaWiki client libraries: https://www.mediawiki.org/wiki/API:Client_code

Advertise for it: Frankly I haven’t take time to summarize, but it supports

  • common API for page query/creation/edit/deletion
  • generators.
  • file upload
  • query result pagination (encapsulated as IAsyncEnumerable )

Continue reading “Written a MediaWiki Client Library”

Content is available under CC BY-SA 3.0 unless otherwise noted.