Skip to content

Instantly share code, notes, and snippets.

@@ -0,0 +1,20 @@
1) install gpedit - run as admin
FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F")
FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F")
2) gpedit - add SeAssignPrimaryTokenPrivilege(Replace a process level token) and SeTcbPrivilege(Act as part of the operating system) privileges to sshuser
Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment
3) enable auto-logon
regedit - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device, change DevicePasswordLessBuildVersion to 0
@pavelovcharov
pavelovcharov / MainWindow.xaml
Last active January 31, 2023 11:56
outer corners
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
@pavelovcharov
pavelovcharov / a-sshAndSwitch.sh
Created March 14, 2022 12:06 — forked from josefglatz/a-sshAndSwitch.sh
Synology cheatsheet: how to query internal Synology postgresql database
# Connect to you NAS with YOUR admin account
ssh [email protected]
# go sudo
sudo -i
# switch to user postgres
su - postgres
@pavelovcharov
pavelovcharov / qwt-qwtpolar.txt
Created October 20, 2020 04:40
how-to-build-qwt-qwtpolar
https://qna.habr.com/q/97069
http://qtlinux.narod.ru/install_qwtpolar.htm
http://qtlinux.narod.ru/install_qwt.htm
qmake qwt.pro
mingw32-make -j3
mingw32-make install
qmake -set QMAKEFEATURES "c:/Qt/Qwt-6.1.0/features"
@pavelovcharov
pavelovcharov / what-forces-layout.md
Created August 18, 2020 08:17 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@pavelovcharov
pavelovcharov / Synology-Diskstation-Git.md
Created February 8, 2020 18:40 — forked from walkerjeffd/Synology-Diskstation-Git.md
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@pavelovcharov
pavelovcharov / GetEffectiveStringFormat.cs
Last active November 27, 2019 12:50
GetEffectiveStringFormat
internal static string GetEffectiveStringFormat(string stringFormat)
{
if (stringFormat.IndexOf('{') < 0)
{
// convenience syntax - build a composite format string with one parameter
stringFormat = @"{0:" + stringFormat + @"}";
}
return stringFormat;
}
EventInfo evClick = GetType().GetEvent("GotKeyboardFocus");
Type tDelegate = evClick.EventHandlerType;
MethodInfo miHandler =
typeof(LayoutPanel).GetMethod("Control_GotFocus",
BindingFlags.NonPublic | BindingFlags.Instance);
// Create an instance of the delegate. Using the overloads
// of CreateDelegate that take MethodInfo is recommended.
//
// Decompiled with JetBrains decompiler
// Type: Microsoft.VisualStudio.PlatformUI.Shell.DockOperations
// Assembly: Microsoft.VisualStudio.Shell.ViewManager, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: D80425EB-D8D0-402B-9969-F22EE27FEC21
// Assembly location: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Microsoft.VisualStudio.Shell.ViewManager.dll
using Microsoft.Internal.VisualStudio.Shell;
using Microsoft.VisualStudio.PlatformUI.Shell.Controls;
using Microsoft.VisualStudio.PlatformUI.Shell.Preferences;
using System;