Skip to content

Instantly share code, notes, and snippets.

@davidjgonzalez
davidjgonzalez / config.json
Created February 11, 2018 20:16
QNAP Homebridge Container config.json
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "123-45-678"
},
"description": "This file configures support for Nest, TP-Link Devices and HarmonyHub Remote.",
"platforms": [
{
@davidjgonzalez
davidjgonzalez / install.sh
Last active August 14, 2022 19:53
QNAP Homebridge Container install.sh
#!/bin/bash
# *** Copy this file to /root/.homebridge ***
# This file gets executed as root, so you can use it to
# install or update any plugin dependencies.
# See https://github.com/marcoraddatz/homebridge-docker#installsh
npm update -g n
@davidjgonzalez
davidjgonzalez / gist:66e481b54aafb1b900a579ee95848d8f
Created March 19, 2021 14:49
Asset Share Commons - Binary Resource discovery and Internal Redirect dispatching
@Override
public AssetRendition getRendition(final AssetModel assetModel, final AssetRenditionParameters parameters) {
throw new UnsupportedOperationException(String.format("[ %s ] is not supported by the AEM Async Asset Download Framework.",
this.getClass().getName()));
/*
// Commented out implementation for AEM as a Cloud Service as this only supports a sub-set of the original use-case.
final String expression = mappings.get(parameters.getRenditionName());
package com.adobe.aem.commons.assetshare.content.renditions.download.impl;
import com.adobe.aem.commons.assetshare.content.renditions.AssetRenditions;
import com.adobe.aem.commons.assetshare.content.renditions.download.AssetRenditionPacker;
import com.adobe.aem.commons.assetshare.content.renditions.impl.AssetRenditionServlet;
import com.adobe.aem.commons.assetshare.content.renditions.impl.AssetRenditionsImpl;
import com.adobe.aem.commons.assetshare.testing.MockAssetModels;
import com.adobe.aem.commons.assetshare.util.ServletHelper;
import com.adobe.aem.commons.assetshare.util.impl.ServletHelperImpl;
import io.wcm.testing.mock.aem.junit5.AemContext;
package com.adobe.aem.guides.wknd.core.components.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.doReturn;
import static org.mockito.ArgumentMatchers.*;
<%@include file="/libs/foundation/global.jsp"%><%
%><%@page session="false" contentType="text/html; charset=utf-8"
pageEncoding="UTF-8"
import="org.apache.sling.api.resource.*,
com.day.commons.datasource.poolservice.DataSourcePool,
javax.sql.*,
java.sql.*,
java.util.*,
javax.jcr.*,
@davidjgonzalez
davidjgonzalez / mavenize-cq5-dependencies
Created February 26, 2012 21:09 — forked from kurtharriger/mavenize-cq5-dependencies
This script will download all crxde classpath dependencies and install them in your local maven repository
#! /bin/bash
set -e
trap "exit 1;" INT TERM EXIT
# exec > >(tee $0.log)
# exec 2>&1
[ -z "$CRX_URL" ] && CRX_URL=http://localhost:4502
[ -z "$CRX_CREDENTIALS" ] && CRX_CREDENTIALS=admin:admin
package com.adobe.aem.guides.wknd.core.components.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.doReturn;
import static org.mockito.ArgumentMatchers.*;
package com.adobe.aem.guides.wknd.core.components.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.doReturn;
import static org.mockito.ArgumentMatchers.*;
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Upload a package AND install
curl -u admin:admin -F file=@"name of zip file" -F name="name of package"