iFrame von „fremder“ URL an Höhe des Inhalts anpassen


<iframe name="thetarget"
id="thetarget"
src=""
height="1000"
width="100%"
frameborder="0"
border ="0"
allowtransparency="true"
onload="scroll(0,0);"
scrolling="no">
</iframe>

<script type="text/javascript">
var IFrameID = "thetarget";
var domain = "https://woher-auch-immer.com";
var path = "/de/";

window.onload = function(e) {
var theIframe = document.getElementById(IFrameID);
theIframe.src = domain + path + window.location.search;
};

function updateIFrame( height ) {
var theIframe = document.getElementById(IFrameID);
theIframe.setAttribute( 'height', height );
}

function receiveMessage(event) {
if (event.origin == domain) {
if(typeof event.data === "number") {
updateIFrame(event.data);
}
} else {
return false;
}
}

if (typeof window.addEventListener != "undefined") {
window.addEventListener("message", receiveMessage, false);
}
</script>

IDs aller Unterseiten ermitteln


function getTreePids($parent = 0, $as_array = true){
$depth = 999999;
$queryGenerator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( 'TYPO3\\CMS\\Core\\Database\\QueryGenerator' );
$childPids = $queryGenerator->getTreeList($parent, $depth, 0, 1); //Will be a string like 1,2,3
if($as_array) {
$childPids = explode(',',$childPids );
}
return $childPids;
}

Dateien in Varnish invalidieren

Um in Varnish eine bestimmte Datei zu invalidieren, die bspw. unter mehreren URLs geliefert wird, kann man diese mittels „ban“-Befehl invalidieren.

Beispiel:
varnishadm ban req.url '~' 'DATEINAME\\.zip$'

mySQL Aggregat-Funktion „PRODUCT()“

Um einen „Boost“-Faktor über mehrere Zeilen hinweg berechnen zu können, wird eine Aggregat-Funktion „PRODUCT()“ benötigt, die es in mySQL nicht gibt.

Mögliche SQL-Abfrage:
SELECT SUM(field) FROM table WHERE condition = true GROUP BY something;

Gewünschte SQL-Abfrage:
SELECT PRODUCT(field) FROM table WHERE condition = true GROUP BY something;

Lösung:
SELECT EXP(SUM(LOG(field))) FROM table WHERE condition = true GROUP BY something;

Die Lösung habe ich hier gefunden, wo sie auch nochmal genauer erklärt wird.

Row Data Multiplication in Oracle

TYPO3 Hooks

Datahandler

CommandMap

$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['extkey'] = \Vendor\Extension\Hook\Commandmap::class;
public function processCmdmap_preProcess($command, $table, $id, $value, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processCmdmap_postProcess($command, $table, $id, $value, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processCmdmap_deleteAction($table, $id, $recordToDelete, $recordWasDeleted=NULL, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}

DataMap

$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['extkey'] = \Vendor\Extension\Hook\Datamap::class;
public function processDatamap_preProcessFieldArray(array &$fieldArray, $table, $id, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processDatamap_postProcessFieldArray($status, $table, $id, array &$fieldArray, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processDatamap_afterDatabaseOperations($status, $table, $id, array $fieldArray, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processDatamap_afterAllOperations(\TYPO3\CMS\Core\DataHandling\DataHandler &;$pObj) {}

Change Solr password with cURL

To enable Solr password authentication create the following file:
/var/solr/data/security.json
(The path may be different on your system!)

{"authentication":{"blockUnknown":true,"class":"solr.BasicAuthPlugin","credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="},"":{"v":0}}}

Next run this cURL command:
Replace the „XXX“ by your new password.

curl --user solr:SolrRocks http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -X POST -d '{"set-user": {"solr" : "XXXXXXXX"}}'

Language manager fails to update / Core update fails

Check if there´s a record in table „tx_extensionmanager_domain_model_repository“.

If there is no record run this statement:

INSERT INTO `tx_extensionmanager_domain_model_repository` (`uid`, `pid`, `title`, `description`, `wsdl_url`, `mirror_list_url`, `last_update`, `extension_count`) VALUES
(1, 0, 'TYPO3.org Main Repository', 'Main repository on typo3.org. This repository has some mirrors configured which are available with the mirror url.', 'https://typo3.org/wsdl/tx_ter_wsdl.php', 'https://repositories.typo3.org/mirrors.xml.gz', 0, 0);

Install Varnish with XKey on CentOS 7.x

#Install requirements
yum install autoconf automake jemalloc-devel libedit-devel libtool ncurses-devel pcre-devel pkgconfig python-docutils python-sphinx graphviz

#Download Varnish and install package
wget http://repo.varnish-cache.org/redhat/varnish-4.1/el7/x86_64/varnish/varnish-4.1.6-1.el7.x86_64.rpm
rpm -i varnish-4.1.6-1.el7.x86_64.rpm

#Download level-pack and install
wget http://repo.varnish-cache.org/redhat/varnish-4.1/el7/x86_64/varnish/varnish-devel-4.1.6-1.el7.x86_64.rpm
rpm -i varnish-devel-4.1.6-1.el7.x86_64.rpm

#Download modules and compile
wget https://github.com/varnish/varnish-modules/archive/master.zip
unzip master.zip
cd varnish-modules-master
./bootstrap
./configure
make
make check
make install

Plesk adjust customer


#Remove unwanted files
find . -name .svn -exec rm -rf '{}' \;
find . -name .svn -exec ls '{}' \;

#Change owner / group
chown -R USERNAME httpdocs
chgrp -R psacln httpdocs/*
chgrp psaserv httpdocs

#Change rights
chmod -R -s ./httpdocs/*
find ./httpdocs/ -type f -exec chmod 0644 {} \;
find ./httpdocs/ -type d -exec chmod 0755 {} \;