The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,685 other followers

Archive for June 19th, 2018

Amazon Alexa on a Raspberry Pi (add a USB microphone and a speaker with a 3.5mm plug)

Posted by jpluimers on 2018/06/19

I never realised that Amazon Alexa has an open source account on GitHub: https://github.com/alexa

There are full instructions on getting a Java based Alexa Voice Service (AVS) – also used by Amazon Echo – to run on a Raspberri Pi (3 or better recommended, works on 2 as well) with this extra hardware:

  • USB microphone
  • Speaker with a 3.5mm audio plug
  • USB WiFi (essential for Raspberry Pi 2, optional if you want to boost your WiFi signal on a Raspberry Pi 3)

Full instructions are at Raspberry Pi · alexa/alexa-avs-sample-app Wiki and a video is below: https://www.youtube.com/watch?v=baec1CbV6A0

I should find some time to try this out (:

–jeroen

Read the rest of this entry »

Posted in Development, Hardware, Hardware Development, Hardware Interfacing, Software Development | Leave a Comment »

PowerShell – query reboot/shutdown events

Posted by jpluimers on 2018/06/19

Thanks [WayBackgbabu for the below PowerShell ide

As PowerShell command:

Get-EventLog System | Where-Object {$_.EventID -eq "1074" -or $_.EventID -eq "6008" -or $_.EventID -eq "1076"} | ft Machinename, TimeWritten, UserName, EventID, Message -AutoSize -Wrap

Based on it and my own experience, thse Event IDs can be interesting:

  • 41 – The system has rebooted without cleanly shutting down first
  • 109 – The kernel power manager has initiated a shutdown transition.
  • 1073 – The attempt by user [domain]\[username] to restart/shutdown computer [computername] failed.
  • 1074 – The process [filename].[extension] has initiated the restart of computer [computername] on behalf of user [domain]\[username\ for the
  • 1076 – ???
  • 6008 – The previous system shutdown at [time-in-local-format] on [date-in-local-format] was unexpected.

You can also run this as a batch file, but not you need to escape the pipe | into ^| like this:

PowerShell Get-EventLog System ^| Where-Object {$_.EventID -eq "1074" -or $_.EventID -eq "6008" -or $_.EventID -eq "1076"} ^| ft Machinename, TimeWritten, UserName, EventID, Message -AutoSize -Wrap

If you have PowerShell 3.0 or greater, then you can use the [Archive.is-In operator:

PowerShell Get-EventLog System ^| Where-Object {$_.EventID -in "41", "109", "1074", "6008", "1076"} ^| ft Machinename, TimeWritten, UserName, EventID, Message -AutoSize -Wrap

–jeroen

Posted in Batch-Files, CommandLine, Development, Power User, PowerShell, PowerShell, Scripting, Software Development, Windows | Leave a Comment »

 
%d bloggers like this: