Skip to content

Instantly share code, notes, and snippets.

View robvanoostenrijk's full-sized avatar

Rob van Oostenrijk robvanoostenrijk

  • United Arab Emirates
View GitHub Profile
@robvanoostenrijk
robvanoostenrijk / web.config
Created June 11, 2014 11:12
Override Internet Explorer compatibility mode on Intranet
<system.webServer>
<httpProtocol>
<customHeaders>
<clear/>
<add name="X-UA-Compatible" value="IE=edge,chrome=1"/>
</customHeaders>
</httpProtocol>
</system.webServer>
@robvanoostenrijk
robvanoostenrijk / notes.md
Last active August 29, 2015 14:07
Tridion 2013 - XSLT Mediator

XSLT Mediator Usage

Transformation Configuration

Xslt mediator allows specifying special parameters which are used for the transformation process:

<?XsltMediator inputitemname="*package name*" outputitemname="*package name*" extensionsTbbId="*tcm:223-123123-2048*"?>

The output methods defined are:

@robvanoostenrijk
robvanoostenrijk / instructions.md
Created October 27, 2014 04:47
IKVM: Apache Fop

Place compiled Apache FOP in folder structure:###

  • \build\fop.jar
  • \lib\avalon-framework-4.2.0.jar
  • \lib\batik-all-trunk.jar
  • \lib\commons-io-1.3.1.jar
  • \lib\commons-logging-1.0.4.jar
  • \lib\fontbox-1.8.5.jar
  • \lib\fop-20140825.dll
  • \lib\serializer-2.7.0.jar
@robvanoostenrijk
robvanoostenrijk / MonochromeTIFF.cs
Created November 17, 2014 10:07
Save Bitmap as 1-bit CCITT4 compressed TIFF
public static void SaveMonochromeTIFF(Bitmap bitmap, String outputFile)
{
if (bitmap == null)
throw new ArgumentNullException("bitmap");
imageCodecInfo = ImageCodecInfo.GetImageEncoders().FirstOrDefault(ici => ici.MimeType == "image/tiff");
if (imageCodecInfo == null)
throw new NotSupportedException("No image codec for tiff found.")
@robvanoostenrijk
robvanoostenrijk / Instructions.md
Last active October 29, 2024 16:44
Install Mac OS X 10.6 SDK on newer Xcode
@robvanoostenrijk
robvanoostenrijk / TridionRestart.vbs
Created April 27, 2015 05:16
Tridion 2013 Restart Script
Sub StartService(Computer, ServiceName, Wait)
Dim cimv2, oService, Result
' Get the WMI administration object
Set cimv2 = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & Computer & "\root\cimv2")
' Get the service object
Set oService = cimv2.Get("Win32_Service.Name='" & ServiceName & "'")
' Check base properties
@robvanoostenrijk
robvanoostenrijk / jvm.xml
Created July 22, 2015 09:06
Tridion: jvm.xml format
<VirtualMachine>
<Options>
<Option Name="-Xmx" Value="1024M" />
<Option Name="-Dfile.encoding" Value="UTF-8" />
<Option Name="-Djava.io.tmpdir" Value="D:\Temp" />
<Option Name="-Xms" Value="50M" />
</Options>
<Classpath>
<Include LibraryPath="D:\Apps\Tridion\lib" />
<Include LibraryPath="D:\Apps\ActiveMQ\lib" />
@robvanoostenrijk
robvanoostenrijk / TcmSetUnpublished.sql
Last active June 21, 2017 04:02
Mark items as unpublished in Tridion through database
-- This query uses the default stored procedure to set the publish state for any published items to unpublished
-- Note: Do NOT run this on a production SDL Tridion instance, as this activity is not officially supported by SDL Tridion.
DECLARE @publicationTargetId INT
DECLARE @publicationId INT
DECLARE @referenceId INT
DECLARE @itemType INT
DECLARE @state INT
DECLARE @trusteeId INT
DECLARE @templateReferenceId INT
@robvanoostenrijk
robvanoostenrijk / single_line.sh
Created July 18, 2017 03:31
Java - Generate Self-Signed SSL Certificate
# Generate a self-signed certificate in a Java keystore as a single line command
# Note this generates a SAN certificate for machine.domain, localhost & 127.0.0.1
keytool -genkeypair \
-keyalg RSA \
-keysize 2048 \
-alias "machine.domain" \
-keystore /discovery-service/config/keystore.jks \
-keypass "key-password" \
-storepass "store-password" \
-validity 1095 \
@robvanoostenrijk
robvanoostenrijk / s3_cleanup.sh
Created September 25, 2019 03:41
Remove 0 byte placeholders from AWS S3
#!/bin/bash
BUCKET_NAME="<bucket>"
BUCKET_PATH="<path>/"
PROFILE="<profile>"
### S3 Bulk Delete by File Size ###
aws s3 ls "s3://${BUCKET_NAME}/${BUCKET_PATH}" --profile "${PROFILE}" --recursive | awk -F ' ' '{print $3,$4}' | awk -F ' ' '$1 < 1 {print $2}' | xargs -IP echo '{"Key": "P"}' > delete.txt
# Because bulk delete limit is 1000 per api call.