Scripting C# with Iron Python

February 15, 2017

I wanted to integrate IronPython into one of my C# applications. The following code is a proof of concept for this.

This python script is defined in the file script.py

def process(pString, pAgreement):
  if float(pAgreement.balance) > 100.0:
    return pAgreement.agreementNumber
  else:
    return pAgreement.product

txt = process ...

VLC Snapshots

December 13, 2016

I was playing a video through VLC on Ubuntu and I wanted to take a snapshot frame from the video. It wasn't working.

I needed to:

  • Configure VLC to have a snapshots directory
  • Change the Hardware accelerated decoding option at Preferences->Input & Codecs to something other than VPDAU.

References ...

Tags:

Searching Elasticsearch

October 11, 2016

I wanted to return a list of entries from ElasticSearch, and I wanted to just return ones where the _type field was set to c.

http://host:9200/logstash-2016.10.05/_search?q=_type:c&pretty=true

This URL will filter to just the rows with a _type of c ...

Listing ElasticSearch indexes

October 11, 2016

To find out a top level list of indexes in an ElasticSearch database, use:

http://host:9200/_cat/indices?v

which returns something like

health status index               pri rep docs.count docs.deleted store.size pri.store.size 
yellow open   logstash-2016.10.06   5   1      18908            0        6mb            6mb 
yellow ...

Running Services from PowerShell

September 14, 2016

I wanted to obtain a list of the running services on my windows machine. This can be done from PowerShell with the command:

Get-Service | Where-Object {$_.status -eq "running"}