Archive for September, 2023

Sep 14 2023

wrong Video codec on Opera Linux Mint

install chromium and

mv /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so.orig
ln -s /usr/lib/chromium/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/
Sep 9 2023

MSSQL restore all databases from folder with .bak files

Powershell

Install-Module dbatools
Import-Module dbatools
Set-DbatoolsInsecureConnection -SessionOnly
Restore-DbaDatabase -SqlInstance SERVER-NAME\INSTANCE-NAME -Path 'C:\PATH-TO-BACKUPS'
Sep 2 2023

MSSQL: User, group, or role ‘platnik’ already exists in the current database.

lists logins and incorrect SIDs
USE <platnik_db>
GO
EXEC sp_change_users_login 'Report'
GO

Then start SQL
USE <platnik_db>
GO
EXEC sp_change_users_login 'Auto_Fix','<user_name>',NULL, '<password>'
GO

Sep 2 2023

Delete multiple databases in MSSQL

drop databases query

USE master;
Go
SELECT 'DROP DATABASE ['+ name + ']'
FROM sys.databases WHERE name like 'PREFIX%';
GO