Skip to content

Instantly share code, notes, and snippets.

View odenijs's full-sized avatar
🏠

Okke de Nijs odenijs

🏠
View GitHub Profile
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'windows-latest'
@odenijs
odenijs / UpdateIISExpressSSLForChome.ps1
Created October 7, 2021 10:59 — forked from blowdart/UpdateIISExpressSSLForChome.ps1
IIS Express certs (for now) don't contain SAN strings. This makes Chrome unhappy. Make Chrome happy again with a new organic, artisanal, gluten free HTTPS certificate.
# Create a new self signed HTTPS Certificate for IIS Express
# Crafted with all organic, GMO, gluten free ingreditations
# with an artisinal SAN to make Chrome 58 onwards happy.
#
# See https://bugs.chromium.org/p/chromium/issues/detail?id=308330
#
# Run this at an administrative PowerShell prompt.
#
# You will be prompted to trust a new certificate via a windows dialog.
# Click yes otherwise Visual Studio will not be able to determine your
@odenijs
odenijs / removeOlderThanDays.sh
Created April 21, 2021 15:08 — forked from hatifnatt/removeOlderThanDays.sh
Simple script to delete files older than specific number of days from FTP
#!/bin/bash
# Simple script to delete files older than specific number of days from FTP. Provided AS IS without any warranty.
# This script use 'lftp'. And 'date' with '-d' option which is not POSIX compatible.
# FTP credentials and path
FTP_HOST="ftp.host.tld"
FTP_USER="usename"
FTP_PASS="password"
FTP_PATH="/ftp/path"
# Full path to lftp executable
@odenijs
odenijs / UnusedMediaItems.ps1
Created April 16, 2021 16:07 — forked from michaellwest/UnusedMediaItems.ps1
Sitecore PowerShell script to locate media items without reference to any other item.
<#
.SYNOPSIS
Lists all media items that are not linked to other items.
.NOTES
Michael West
#>
# HasReference determines if the specified item is referenced by any other item.
function HasReference {
@odenijs
odenijs / IIS_Backups.ps1
Created July 7, 2019 19:56
Powershell script to backup IIS sites
<#
.SYNOPSIS
Backup IIS sites to an 7zip archive and keep a number of versions
.DESCRIPTION
Create date based backups of all IIS site directories by mirroring site directories to a date folder. Create a zip file for each
mirrored folder with naming convention YYYY-MM-DD-sitename_xx.zip.
Automatically clean up older zip files setting the number of backups to keep.
.EXAMPLE
@odenijs
odenijs / ProxyForFiddler.config
Created May 16, 2019 13:15 — forked from michaellwest/ProxyForFiddler.config
Snippet to be added in the web.config, app.config, or machine.config to redirect traffic to the Fiddler proxy.
<system.net>
<defaultProxy enabled = "true" useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
@odenijs
odenijs / Email Server (Windows Only).md
Created September 5, 2016 20:12 — forked from raelgc/Email Server (Windows Only).md
Setup a Local Only Email Server (Windows Only)
@odenijs
odenijs / mmcs shortcuts
Created March 24, 2015 14:32
System administrator command line shortcuts popular MMCs
###System adminstrator command line shortcuts to popular MMCs
Run command Start > Run or Start > Run > CMD [enter]
| Admin Applet | Command |
|---------------------------------------|---------------|
| AD Domains and Trusts | domain.msc |
| Active Directory Management | admgmt.msc |
| AD Sites and Services | dssite.msc |
| AD Users and Computers | dsa.msc |
@odenijs
odenijs / Render partial view as string
Created August 13, 2013 13:10
Render a partial view as a string
/// <summary>
/// Renders the partial view to string.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="partialViewName">Partial name of the view.</param>
/// <param name="viewData">The view data.</param>
/// <param name="tempData">The temp data.</param>
/// <returns></returns>
public static string RenderPartialViewToString(ControllerContext context, string partialViewName, ViewDataDictionary viewData, TempDataDictionary tempData)
{
@odenijs
odenijs / Timespan calculation
Created July 31, 2013 13:28
Simple timespan calculation
/*
Input parameter is the UNIX timestamp
of the starting date.
The second parameter is optional -
It's value is the ending date,
also UNIX timestamp. If this
parameter is not given, the
default date is current date.
*/
function duration($start,$end=null) {