Vinterdal

Wireguide

A cheat sheet of some of the most common wireplugs and equipment used with computers and other peripheral equipment. Originaly created to support endusers in a Swedish muncipality.
If you have any suggestion to the guide, feel free to contact us!

Windows Task Scheduler

A collection of result codes that task scheduler outputs.
To get result code, run in Powershell:


$task = Get-SheduledTask -TaskPath '???' | Where-Object {$_.TaskName -eq 'mytask'}
$task | Get-SheduledTaskInfo
				

0 - The operation completed successfully
1 - Incorrect function called or unknown function called
2 - File not found
10 - The environment is incorrect
255 - The extended attributes are inconsistent
1056 - Already Running
267008 - Task is ready to run at its next scheduled time
267009 - Task is currently running. Same as 1056?
267010 - The task will not run at the scheduled times because it has been disabled
267011 - Task has not yet run
267012 - There are no more runs scheduled for this task
267013 - One or more of the properties that are needed to run this task on a schedule have not been set
267014 - The last run of the task was terminated by the user
267015 - Either the task has no triggers or the existing triggers are disabled or not set
1073807364 - Cannot open the File
2147750671 - Credentials became corrupted
2147750687 - An instance of this task is already running
2147942401 - "Illegal Function" Was once fixed by setting "Configure For" to Windows Server 2016
2147942402 - File not found
2147942405 - Access denied
2147942487 - Wrong parameter
2147942667 - Check so that "Start in" is configured correctly, example, no extra " or otehr character
2147943140 - Task needs more permissions
2147943467 - Task ended unexpected
2147943645 - The service is not available (is "Run only when an user is logged on" checked?)
2147746132 - Class not registered
2147946720 - The operator or administrator has refused the request
2148073520 - The device that is required by this cryptographic provider is not ready for use
3221225786 - The application terminated as a result of a CTRL+C
3228369022 - Unknown software exception.
				

Powershell - Mimicking the awesome "/usr/bin/watch"

Simple one-liner:


while($true) {cls;Get-ChildItem -Path $pwd;Start-Sleep -Seconds 2}
			

Another way, slightly more sofisticated solution. With this one you can load it into your profile or similiar and call it with:
watch {Get-ChildItem -Path $pwd} -Seconds 5


function watch {
    param (
        $ScriptBlock,
        $Seconds=4
    )

    while ($true) {
        cls
        Write-Output ('Watch reloaded last time at: {0}' -f (Get-Date))
        # Can't really rember whay I needed to use '&'
        & $ScriptBlock | Out-Host
        Start-Sleep -Seconds $Seconds
    }
}
			

Initter.sh

Simple script I run on freshly installed linux-machines with apt.


#!/bin/bash

echo ":: Starting update with apt"
apt-get update && apt-get upgrade -y
echo ":: Update finished"

apps=(curl git htop links vim ncdu sudo tmux watch)

echo "Installing ${apps[*]}"

apt-get install ${apps[*]} -y