Skip to content

Instantly share code, notes, and snippets.

Florian von Bracht gitfvb

Block or report user

Report or block gitfvb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View size_of_dbs.sql
SELECT [Database Name] = DB_NAME(database_id),
[Type] = CASE WHEN Type_Desc = 'ROWS' THEN 'Data File(s)'
WHEN Type_Desc = 'LOG' THEN 'Log File(s)'
ELSE Type_Desc END,
[Size in MB] = CAST( ((SUM(Size)* 8) / 1024.0) AS DECIMAL(18,2) )
FROM sys.master_files
GROUP BY GROUPING SETS
(
(DB_NAME(database_id), Type_Desc),
(DB_NAME(database_id))
@gitfvb
gitfvb / epi__0__create_settings.ps1
Last active Jul 15, 2019
EpiServer Campaign Handling via PowerShell with strong encrypted session keys and passwords
View epi__0__create_settings.ps1
################################################
#
# SCRIPT ROOT
#
################################################
# Load scriptpath
if ($MyInvocation.MyCommand.CommandType -eq "ExternalScript") {
$scriptPath = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
@gitfvb
gitfvb / test_encrypted_strings.ps1
Last active Jul 15, 2019
Encrypt and decrypt string (like tokens) securely in PowerShell. This can be used to save tokens safely in a text file. The encryption key will be generated on the fly.
View test_encrypted_strings.ps1
################################################
#
# SCRIPT ROOT
#
################################################
# Load scriptpath
if ($MyInvocation.MyCommand.CommandType -eq "ExternalScript") {
$scriptPath = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
} else {
@gitfvb
gitfvb / epi_loosetyped.ps1
Created Jul 12, 2019
EpiServer Campaign SOAP calls via PowerShell
View epi_loosetyped.ps1
<#
https://world.episerver.com/documentation/developer-guides/campaign/SOAP-API/introduction-to-the-soap-api/webservice-overview/
WSDL: https://api.campaign.episerver.net/soap11/RpcSession?wsdl
#>
#---------------------------
# SETTINGS
#---------------------------
View sqlserverstats.sql
# Space and rows of SQL-Server Database
SELECT
t.NAME AS TableName,
p.rows AS RowCounts,
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB,
CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSpaceMB
FROM
sys.tables t
INNER JOIN
@gitfvb
gitfvb / shutdown.ps1
Created Jun 10, 2019
Windows shutdown via command
View shutdown.ps1
# shutdown in 90 minutes (5400 seconds)
shutdown /s /t 5400
# abort shutdown
shutdown /a
@gitfvb
gitfvb / create_link.ps1
Created May 8, 2019
Symbolic links using Powershell
View create_link.ps1
@gitfvb
gitfvb / splitfile.ps1
Created Apr 26, 2019
Function to split a file into parts
View splitfile.ps1
function Split-File{
param(
$inFile,
$outPrefix,
[Int32] $bufSize
)
$file = Get-Item -Path $inFile
@gitfvb
gitfvb / orbit_api.ps1
Last active May 2, 2019
Example of how to handle the Apteco Orbit API / FastStats API v2
View orbit_api.ps1
<#
NOTES
* swagger: http://www.tealgreenholidays.co.uk/OrbitAPI/swagger/ui/index.html#/About/About_GetDataViews
#>
################################################
#
You can’t perform that action at this time.