Skip to content

Instantly share code, notes, and snippets.

View Splaxi's full-sized avatar

Mötz Jensen Splaxi

  • Essence Solutions P/S
  • Denmark
  • X @splaxi
View GitHub Profile
@Splaxi
Splaxi / ForEach-TableAzureDB.sql
Created November 29, 2019 12:35
ForEach-TableAzureDB
--select schema_name(t.schema_id) as schema_name,
-- t.name as table_name,
-- '['+ schema_name(t.schema_id) +'].['+ t.name +']' AS FullName
--from sys.tables t
--order by schema_name,
-- table_name;
DECLARE @CurrentRowId AS INT, @CMD AS NVARCHAR(MAX), @Value AS NVARCHAR(MAX),@COMBINEDCMD AS NVARCHAR(MAX)
$pathInput = "C:\Temp(Not-Synced)\OpenShot\Convert2Gif"
$pathOutput = "C:\Temp(Not-Synced)\OpenShot\Convert2Gif"
$ffmpegPath = "C:\Tools\Screen2Gif\ffmpeg.exe"
$files = Get-ChildItem -Path $pathInput
$parameterString = '-y -i "{0}" -lavfi "palettegen=stats_mode=full[palette],[0:v][palette]paletteuse=dither=sierra2_4a" "{1}"'
foreach($file in $files) {
ffmpeg -i "PathToFile" -c copy -map 0 -segment_time 00:01:00 -f segment -reset_timestamps 1 "PathToFolder\FileName_%03d.mp4"
@Splaxi
Splaxi / ConvertTo-Gif
Last active July 2, 2020 09:13
MP4 to GIF via FFMPEG
ffmpeg.exe -i "PATH.MP4" -lavfi "palettegen=stats_mode=full[palette],[0:v][palette]paletteuse=dither=sierra2_4a" "OUTPATH.gif"
ScreenToGif:
-lavfi palettegen=stats_mode=full[palette],[0:v][palette]paletteuse=new=1:diff_mode=rectangle
@Splaxi
Splaxi / FixVbox
Created October 18, 2019 19:02
Fix vboxdrv
Navigate to "C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv"
Right click on "VBoxDrv.inf" file and select Install option
Open the Console as a administrator and run the following command
sc start vboxdrv
@Splaxi
Splaxi / DropAllFunctions.sql
Created September 17, 2019 07:38
Drop All Functions
SELECT ' DROP FUNCTION '+ QUOTENAME(SCHEMA_NAME(schema_id))
+ N'.' + QUOTENAME(name)
from sys.objects
WHERE [type] IN (N'FN', N'IF', N'TF', N'FS', N'FT')
@Splaxi
Splaxi / DropAllProcedures.sql
Created September 17, 2019 07:32
Drop all stored procedures
SELECT ' DROP PROCEDURE ' + s.NAME + '.' + p.NAME
FROM sys.procedures p
JOIN sys.schemas s
ON p.[schema_id] = s.[schema_id]
WHERE p.type = 'P'
@Splaxi
Splaxi / DropAllTables.sql
Last active September 17, 2019 07:28
Drop all tables
SELECT ' Drop table ' + s.NAME + '.' + t.NAME
FROM sys.tables t
JOIN sys.schemas s
ON t.[schema_id] = s.[schema_id]
WHERE t.type = 'U'
@Splaxi
Splaxi / DropAllViews.sql
Created September 17, 2019 07:28
Drop all views
SELECT ' Drop view ' + s.NAME + '.' + v.NAME
FROM sys.views v
JOIN sys.schemas s
ON v.[schema_id] = s.[schema_id]
WHERE v.type = 'V'
@Splaxi
Splaxi / Insert-EntittyToAzureStorageTable.ps1
Created May 10, 2019 18:16
Sample how to write to Azure Storage Table
Add-Type -AssemblyName System.Web
$storageAccountName = "VALUE"
$tableName = "countries"
$sasToken = "?sv=2018-03-28....."
$partitionKey = "All"
$entityKey = "PartitionKey={0},RowKey={1}"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12