Skip to content

Instantly share code, notes, and snippets.

View alibertism's full-sized avatar

Emmanuel Allibertis alibertism

  • Greece
View GitHub Profile
@alibertism
alibertism / sp_CompareTableData.sql
Created November 11, 2025 13:33
An SQL Server stored procedure for comparing the contents of two tables with the same schema
CREATE OR ALTER Procedure sp_CompareTableData
(
@TABLE1 NVARCHAR(128),
@TABLE2 NVARCHAR(128),
@EXCLUDEDCOLUMNS NVARCHAR(MAX) = NULL,
@TEMPTABLENAME NVARCHAR(MAX) = NULL,
@OUTPUTSCRIPT BIT = 0
)
AS
BEGIN
@alibertism
alibertism / Readme.md
Last active April 11, 2021 23:45
[Run executable as a Windows Service] Run any windows executable as a service #windows #service

Run any executable as a windows service

To create the service

Open an elevated powershell window and type:

$params = @{
    Name = "{Service name}"
    BinaryPathName = "{Executable path}"
    DisplayName = "{Display name of the service}"
 StartupType = "{Automatic|Manual}"
@alibertism
alibertism / Readme.md
Created November 5, 2020 11:49
[Flash Player installation (Ubuntu)] Install the flash player browser plugin in Ubuntu linux #linux #flash #ubuntu #lubuntu

Pepper Flash plugin installation

The plugin is available in Chrome by default (at least at the time this is being written) For Firefox and Opera you need to follow these steps:

  1. Install the Pepper Flash plugin
sudo apt install pepperflashplugin-nonfree
  1. Install the plugin adapter
@alibertism
alibertism / Readme.md
Last active April 28, 2021 14:03
[Dynamics 365 Maintenance mode] Enter maintenance mode and change configuriation in Dynamics 365 Finance & Operations #Dynamics365 #Configuration #MaintentanceMode

Enable maintenance mode

When opening the 'License Configuration' page, you recieve the warning

This form is read-only unless the system is in the maintenance mode. Maintenance mode can be enabled in this environment by running maintenance job from LCS, or using Deployment.Setup tool locally

In order to change the system configuration, you need to enable maintenance mode. In a production environment, this can be achieved bu running a maintenance job from LCS. In a development environment you need to execute the following command in an elevated powershell prompt:

C:\AosService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe -metadatadir C:\AosService\PackagesLocalDirectory -bindir C:\AosService\PackagesLocalDirectory\Bin -sqlserver localhost -sqldatabase axdb -sqluser {SQL user name} -sqlpwd {SQL user password} -setupmode maintenancemode -isinmaintenancemode true

iisreset
@alibertism
alibertism / Readme.md
Last active July 14, 2020 15:28
[Mobile Device Center on Windows 10] How to fix mobile device center on windows 10 #windowsmobile #mobiledevicecenter #windows10

Open a command prompt and execute the following commands

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\RapiMgr /v SvcHostSplitDisable /t REG_DWORD /d 1 /f

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\WcesComm /v SvcHostSplitDisable /t REG_DWORD /d 1 /f

Open Services manager and locate the services:

  • 'Windows Mobile-2003-based device connectivity'
@alibertism
alibertism / EnableChangeTracking.sql
Last active June 26, 2020 20:53
[Enable Change Tracking for all Database Tables] Use this TSQL script to enable change tracking for all the tables in the database #TSQL #ChangeTracking #SQLServer #MSSQL
DECLARE TablesCursor CURSOR FOR
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE';
OPEN TablesCursor;
DECLARE @TableName NVARCHAR(1024);
DECLARE @Command NVARCHAR(MAX);
@alibertism
alibertism / Readme.md
Created June 26, 2020 11:08
[Export and Import Models in Dynamics 365 FO] Use command line tools to export and import models to development environments #Dynamics365 #Model

Make sure you include in your machine's path environment variable the path to the Model Utility (ModelUtil.exe) which resides in

C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps

Export a model

Issue the following command:

ModelUtil.exe -export -metadatastorepath=C:\AOSService\PackagesLocalDirectory -modelname=[name of the model to export] -outputpath=[path of the folder where the model file should be saved]
@alibertism
alibertism / Readme.md
Last active September 18, 2020 07:49
[Debug on Remote Android Emulator] Connect through adb to an emulator running on a different machine #android #adb #emulator #debugging

Installation

First, you need to install the OpenSSH server implementation on Windows 10. Although there is an implementation available in the 'Manage optional features' section in the Settings app, you should not use this one. Instead, download the latest build of OpenSSH from this link.

Once the download is finished, create a folder named OpenSSH under the Program Files folder and unzip the contents of the archive you just downloaded in there.

Open an elevated powershell window inside the \Program Files\OpenSSH folder and execute the following command:

powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
@alibertism
alibertism / {Test Project File}.csproj
Created June 27, 2018 09:15
[Exception when debugging unit tests] When debugging unit tests inside VS you get the exception 'Could not load assembly {assembly name} ...' #VS2017 #VS #NUnit
<!-- Add this section anywhere inside the test project file -->
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
@alibertism
alibertism / ReflectionEmitProperty.cs
Last active June 26, 2020 20:56
[Reflection Emit Property] Dynamically create a property using Reflection.Emit #dotNet #csharp #Reflection #Emit
// Create a Type Builder that generates a type directly into the current AppDomain.
var appDomain = AppDomain.CurrentDomain;
var assemblyName = new AssemblyName("MyDynamicAssembly");
var assemblyBuilder = appDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
var moduleBuilder = assemblyBuilder.DefineDynamicModule(assemblyName.Name);
var typeBuilder = moduleBuilder.DefineType("MyDynamicType", TypeAttributes.Class | TypeAttributes.Public);
var propertyName = "Name";