SOLR install on production

  1. Download binary version of solr from here https://archive.apache.org/dist/lucene/solr/
    The version for 8.5.2 will be https://archive.apache.org/dist/lucene/solr/8.5.2/solr-8.5.2.tgz
    Note: Mind that it needs to be file without “src” in name. You can store the file wherever you like because all files will be copied into right places by installation.
  2. Run tar xzf solr-8.5.2.tgz solr-8.5.2/bin/install_solr_service.sh --strip-components=2
  3. Run sudo bash ./install_solr_service.sh solr-8.5.0.tgz

    NOTE! use “sudo” even if you are logged as root!

By running the command above you run it with default configuration which is equivalent of sudo bash ./install_solr_service.sh solr-8.5.0.tgz -i /opt -d /var/solr -u solr -s solr -p 8983

 
Solr has two important folders:
– Solr home directory => in config above its /var/solr
– Solr installation directory => in config about its /opt
 
The home directory is where you will have configuration of cores and solr itself.
Installation directory should not be changed.
 
The final tuning of solr regarding memory, logging configuration etc, should be done in /etc/default/solr.in.sh with env vars.

Project dependent PHP CLI version

When you use one system for different PHP projects then sooner or later you will need to set up different PHP version per project. One solution is to manually change PHP before switching to project. But this is boring… To have the right version of PHP without our interaction we can use php-fpm and set right php version directly in vhost. But how to automatically change PHP version on CLI ?

Continue reading

Moving website to new server using proxy pass to avoid domain propagation problems

Sometimes we need to move website to new server, with new IP. In such cases the most problematic part is domain propagation period. In that period part of website users will hit the old server and part of website users will hit new server. The problem is when they will submit some data – if they were on old server then we will have inconsistent data between old and new server. Is there solution for this ?

Continue reading

Move repo and all branches and tags from one repo to other

#!/bin/bash

REPO_FROM=git@github.com:sourcebroker/imageopt.git
REPO_TO=git@github.com:sourcebroker/imageopt_new.git

mkdir repomove
cd repomove
git clone --bare ${REPO_FROM} .git
git config --unset core.bare
git reset --hard
git remote rename origin old-origin
git remote add origin ${REPO_TO}
git push -u origin --all
git push -u origin --tags

 

Installing mac osx from scratch – the web develper view

brew cask install lastpass
brew cask install toggldesktop
brew cask install chrome
brew cask install iterm2

brew cask install slack

brew cask install filezilla
brew cask install phpstorm
brew cask install tunnelblick
brew cask install dropbox
brew cask install sequel-pro
brew install php71-apcu
brew install php71-opcache
brew install php71-mcrypt
brew install php71-intl
brew install php71-xdebug
brew install xdebug-osx
brew install mc
brew install wget
brew install imageoptim
brew install pngquant
brew install optipng
brew install pngquant
brew install gifsicle
brew install jpegoptim
brew install jpegrescan
brew install jpegtran
brew install mozjpg

Replace right option with right alt on mac osx

By default when you want to use some national polish chars on macosx keyboard you need to use right alt. More convenient and natural however is to use right command key which is closer to your right tumb. You could replace the keys with Karabiner (https://pqrs.org/osx/karabiner/) but if its only thing you need Karabiner for then its better to do it without installing third party software.

Continue reading