Skip to content

Instantly share code, notes, and snippets.

View ststeiger's full-sized avatar
😎
Back from holidays

Stefan Steiger ststeiger

😎
Back from holidays
  • Switzerland
View GitHub Profile
@ststeiger
ststeiger / offline_mdn_docs.md
Last active April 30, 2024 10:53 — forked from zed-dz/offline_mdn_docs.md
Offline MDN Docs
@ststeiger
ststeiger / Trigger_Status.sql
Created April 29, 2024 12:37
Trigger Status Information
SELECT
sch.name AS table_schema
,tbl.name AS table_name
,trig.name AS trigger_name
,trig.is_disabled
,CASE WHEN is_disabled = 0 THEN 'Enabled' ELSE 'Disabled' END trigger_Status
FROM sys.triggers AS trig
LEFT JOIN sys.tables AS tbl ON tbl.object_id = trig.parent_id
LEFT JOIN sys.schemas AS sch ON sch.schema_id = tbl.schema_id
@ststeiger
ststeiger / Computed_Columns_Index.sql
Created April 25, 2024 14:09
List indexes on computed columns
SELECT
ind.name
,sch.name
,obj.name
,sc.name
,sc.is_computed AS is_computed
,tbl_computed_columns.definition AS computation
@ststeiger
ststeiger / Windows10.reg.txt
Last active April 25, 2024 08:42
Windows 10 registry settings
To disable "This file comes from another computer"
Disable blocking when files are downloaded, open the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments\SaveZoneInformation
Change SaveZoneInformation to 1.
NOTE:
0 = Not Configured
@ststeiger
ststeiger / Generate_Indexes.sql
Created April 18, 2024 14:43
Index Generation script
SELECT
ind.name
,'DROP INDEX ' + QUOTENAME
(
CASE WHEN SUBSTRING(ind.name, 1, 2) = 'ix' THEN 'IX' + SUBSTRING(ind.name, 3, 10000) ELSE ind.name END
) + ' ON ' + QUOTENAME(sch.name) + '.' + QUOTENAME(obj.name) + '; ' AS DropIndexScript
, ' CREATE '
@ststeiger
ststeiger / OldTableColorSchema.md
Last active April 3, 2024 13:11
Old Excel Table Color Schema

Alle: =IIF(COUNTROWS("SEL_Standort").Equals(Parameters!in_standort.Count),"Alle","Nicht Alle")

What Color
Title Background #4472C4
Light Blue #D9E1F2
Line #AABEE4
@ststeiger
ststeiger / ffmpeg_split.sh
Created April 2, 2024 15:06
Split all screens video into single screen
Simply convert:
ffmpeg -i input.avi output.mp4
Simply convert, but only the left half of the screen(s):
ffmpeg -i input.avi -filter_complex "[0:v]crop=iw/2:ih:0:0,scale=iw:ih[out]" -map "[out]" output.mp4
Simply convert, but only the right half of the screen(s):
ffmpeg -i input.avi -filter_complex "[0:v]crop=iw/2:ih:ow:0,scale=iw:ih[out]" -map "[out]" output.mp4
@ststeiger
ststeiger / KickUsers.sql
Created March 21, 2024 18:41
How to kick users from SQL-server
USE master
GO
ALTER DATABASE database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE database_name SET MULTI_USER WITH ROLLBACK IMMEDIATE
@ststeiger
ststeiger / ExecutedQueries.sql
Last active March 21, 2024 12:11
Find past executed queries by text in MSSQL
SELECT
t.[text], qs.creation_time
FROM sys.dm_exec_cached_plans AS p
CROSS APPLY sys.dm_exec_sql_text(p.plan_handle) AS t
JOIN sys.dm_exec_query_stats qs ON p.plan_handle = qs.plan_handle
-- WHERE t.[text] LIKE N'%something unique about your query%';
WHERE t.[text] LIKE N'%CTE%'
-- AND t.text LIKE '%APP-APERTUR%'
ORDER BY qs.creation_time DESC
@ststeiger
ststeiger / SSRS_Binding_error.md
Last active March 20, 2024 15:15
Fix for An HTTPS binding already exists for the specified IP address and port combination!

This is how to fix this error:
An HTTPS binding already exists for the specified IP address and port combination!

netsh http show sslcert

if too long

netsh http show sslcert > sslcert.txt