Skip to content

Instantly share code, notes, and snippets.

Avatar

Rob van Oostenrijk robvanoostenrijk

  • United Arab Emirates
View GitHub Profile
@robvanoostenrijk
robvanoostenrijk / gen.sh
Created Jan 27, 2021
Re-compress Ubuntu Live /casper/initrd
View gen.sh
#!/bin/bash
touch initrd.new
cd early
find . -print0 | cpio --null --create --format=newc > ../initrd.new
cd ../early
find . -print0 | cpio --null --create --format=newc >> ../initrd.new
@robvanoostenrijk
robvanoostenrijk / s3_cleanup.sh
Created Sep 25, 2019
Remove 0 byte placeholders from AWS S3
View s3_cleanup.sh
#!/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.
@robvanoostenrijk
robvanoostenrijk / single_line.sh
Created Jul 18, 2017
Java - Generate Self-Signed SSL Certificate
View single_line.sh
# 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 / TcmSetUnpublished.sql
Last active Jun 21, 2017
Mark items as unpublished in Tridion through database
View TcmSetUnpublished.sql
-- 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 / jvm.xml
Created Jul 22, 2015
Tridion: jvm.xml format
View jvm.xml
<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 / TridionRestart.vbs
Created Apr 27, 2015
Tridion 2013 Restart Script
View TridionRestart.vbs
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 / Instructions.md
Last active Jan 12, 2021
Install Mac OS X 10.6 SDK on newer Xcode
View Instructions.md
@robvanoostenrijk
robvanoostenrijk / MonochromeTIFF.cs
Created Nov 17, 2014
Save Bitmap as 1-bit CCITT4 compressed TIFF
View MonochromeTIFF.cs
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.")
View instructions.md

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 / notes.md
Last active Aug 29, 2015
Tridion 2013 - XSLT Mediator
View notes.md

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: