Skip to content

Instantly share code, notes, and snippets.

View kamilkosek's full-sized avatar

Kamil Kosek kamilkosek

View GitHub Profile
@kamilkosek
kamilkosek / Win32ErrorCodes.csv
Last active November 3, 2023 09:39
Contains all Win32 Error Codes in a useful CSV file. This could be used ie. when calling a exe file from powershell or python wihtout capturing the output of the execution and just processing the exit code.
ErrorCode ErrorName Description
0x00000000 ERROR_SUCCESS The operation completed successfully.
0x00000000 NERR_Success The operation completed successfully.
0x00000001 ERROR_INVALID_FUNCTION Incorrect function.
0x00000002 ERROR_FILE_NOT_FOUND The system cannot find the file specified.
0x00000003 ERROR_PATH_NOT_FOUND The system cannot find the path specified.
0x00000004 ERROR_TOO_MANY_OPEN_FILES The system cannot open the file.
0x00000005 ERROR_ACCESS_DENIED Access is denied.
0x00000006 ERROR_INVALID_HANDLE The handle is invalid.
0x00000007 ERROR_ARENA_TRASHED The storage control blocks were destroyed.
<?xml version="1.0"
encoding="utf-16"?>
<Discovery ID="SQL.VMs.Standalone.Group.DiscoveryRule"
Enabled="true"
Target="SQL.VMs.Standalone.Group"
ConfirmDelivery="false"
Remotable="true"
Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
@kamilkosek
kamilkosek / FontAwesomeIcons.cs
Last active September 27, 2019 06:52
This list contains all free Icons from FontAwesome for use as static strings in C#
public static class FontAwesomeIcons
{
public static string _500px = "fa-500px";
public static string AccessibleIcon = "fa-accessible-icon";
public static string Accusoft = "fa-accusoft";
public static string AcquisitionsIncorporated = "fa-acquisitions-incorporated";
public static string Ad = "fa-ad";
public static string AddressBook = "fa-address-book";
public static string AddressCard = "fa-address-card";
public static string Adjust = "fa-adjust";
@kamilkosek
kamilkosek / 2.log
Created June 29, 2017 12:18
ShowInputPrompt with i.e. <string[]> as mandatory param
Verbose : Writing Request 'evaluate' with id 2
Diagnostic : WRITE MESSAGE:
{
"jsonrpc": "2.0",
"id": "2",
"method": "evaluate",
"params": {
"expression": "get-item",
"context": "repl",
@kamilkosek
kamilkosek / 1.log
Created June 29, 2017 11:30
output after evaluate
Verbose : Writing Request 'evaluate' with id 14
Diagnostic : WRITE MESSAGE:
{
"jsonrpc": "2.0",
"id": "14",
"method": "evaluate",
"params": {
"expression": "dir",
"context": "repl",
@kamilkosek
kamilkosek / CommandLaunch.ps1
Created June 22, 2017 23:00
InvokeRegisteredEditorCommand Sample
Register-EditorCommand -Name 'Demo' -DisplayName 'Launch Command Test' -ScriptBlock {
write-host "Hello World "
}
$view = New-VSCodeHtmlContentView -Title "Link Test$(Get-Random)" -ShowInColumn Two
$content = @"
<a href="#" id="link">Run demo command</a><br/>
<a href="#" id="link2">Show Console without encodeURI()</a>
<script>
@kamilkosek
kamilkosek / CleanUpOthers.ps1
Created May 12, 2017 09:54
WSUS 0x8024000d Error with Windows 10 1703
# Since Windows 10 1703 clients got issues while connecting to a WSUS Server
# with 3rd party update, I decided to remove the updates so the categories will disappear
# In our case there were updates which were injected by secunia csi.
$updateServer = 'wsus-02'
[Boolean]$useSecureConnection = $False
[Int32]$portNumber = 8530
$null = [reflection.assembly]::LoadWithPartialName('Microsoft.UpdateServices.Administration')
$Wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer($updateServer,$useSecureConnection,$portNumber)
@kamilkosek
kamilkosek / Move-To-New-Instance.ps1
Created February 28, 2017 15:15
PowerShell ISE - Move File to new Instance / ISESteroids
# http://stackoverflow.com/a/2146418
add-type -typedefinition @"
using System.Security.Principal;
using System;
using System.Runtime.InteropServices;
public class LookupAccountName
{
public const uint SE_GROUP_LOGON_ID = 0xC0000000; // from winnt.h
public const int TokenGroups = 2; // from TOKEN_INFORMATION_CLASS
@kamilkosek
kamilkosek / testView.xaml
Created October 24, 2016 15:07
test view for mahapps request
<StackPanel DataContext="{Binding MyDevice}">
<TextBox mah:TextBoxHelper.AutoWatermark="True" Text="{Binding DeviceId}"></TextBox>
</StackPanel>
@kamilkosek
kamilkosek / testmodel.cs
Created October 24, 2016 15:01
testmodel for mahapps request
public class Device
{
[Display(Name = "Geräte Id")]
public int DeviceId { get; set; }
[Display(Name = "Geräte Name")]
public string DeviceName { get; set; }
}