This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
some helpful instructions when I have to change my laptop | |
clone solr 4 image from https://github.com/fhdalikhan/docker-solr4 | |
on windows don't use git bash, use windows terminal with ubuntu using WSL 2, otherwise will get erros due to line endings being CRLF, which should be LF instead. | |
build using: | |
docker build -t solr4 . | |
run using: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cron example | |
* * * * * /usr/bin/sudo chown -R GROUP_NAME:USER_NAME /home/fahad/upload_testing/ | |
# php example, needs the user password and user has to have root permissons | |
system('echo THE_USER_PASSWORD | /usr/bin/sudo -S chown -R GROUP_NAME:USER_NAME /home/fahad/upload_testing/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// DQL example, however the result has to be mapped | |
$entityManager = $this->getEntityManager(); | |
$query = $entityManager->createQuery( | |
'SELECT nm.id AS nm_id, n FROM \App\Entity\Negotiation n | |
INNER JOIN n.messages nm WITH nm.id = (SELECT MAX(id) FROM \App\Entity\NegotiationMessage WHERE negotiation_id = n.id) | |
ORDER BY nm.id DESC' | |
)->setParameter('direction', EnumMessageDirectionType::TYPE_INBOUND); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
history.pushState(null, null, '<?php echo $_SERVER["REQUEST_URI"]; ?>'); | |
window.addEventListener('popstate', function(event) { | |
window.location.assign("http://www.yoururl.com/"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
solr 4 | |
https://hub.docker.com/r/bxggs/solr4 | |
https://github.com/b-ggs/docker-solr4 | |
https://github.com/docker-solr/docker-solr4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# via curl | |
curl "http://localhost:8983/solr/replaceCoreNameHere/update?commit=true" -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>' | |
# via browser | |
http://localhost:8983/solr/locationsdirect-products/update?commit=true&stream.body=<delete><query>*:*</query></delete> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ARGS="${@}" | |
clear; | |
while(true); do | |
clear | |
OUTPUT=`$ARGS` | |
echo -e "${OUTPUT[@]}" | |
sleep 1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.tutorialspoint.com/svn/svn_review_changes.htm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadModule deflate_module modules/mod_deflate.so | |
LoadModule expires_module modules/mod_expires.so | |
LoadModule ext_filter_module modules/mod_ext_filter.so | |
LoadModule filter_module modules/mod_filter.so | |
LoadModule version_module modules/mod_version.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = 'http://domain/all.zip'; | |
$saveFileWithName = "backup.zip"; | |
$newfile = $_SERVER['DOCUMENT_ROOT'] . '/' . $saveFileWithName; | |
if (copy($file, $newfile)) { | |
echo "Copy success!"; | |
} else { | |
echo "Copy failed."; |
NewerOlder