Skip to main content

Posts

Showing posts from August, 2021

max_result_window haystack or Elasticsearch DSL

Problems with Elasticsearch limit.. Solving problem with labeling.. When you filter more than 10000 objects you can't browse because there is a limit on elasticsearch. paginate-search-results is difficult in haystack.  If this index is not used so intensively then you can increase maximum in elastic.  Elasticsearch show indexes curl -X GET "144.76.157.233:9200/_cat/indices" green open jobs_vacaturestoday     5 1     3622      0 52.1mb     26mb green open profile_vacaturestoday 5 1   769725      0  3.7gb   1.8gb curl -X PUT "144.76.157.233:9200/profile_vacaturestoday/_settings?pretty" -H 'Content-Type: application/json' -d' {   "index" : {     "max_result_window" : 2000000   } } '

Config vim ~/.vimrc

If a lot of your work is done in VIM, it would be interesting to set it up a bit easier. Here is an example of a config that I often use. vim ~/.vimrc   set encoding=utf8 set paste set expandtab set textwidth=0 set tabstop=4 set softtabstop=4 set shiftwidth=4 set smartindent set backspace=indent,eol,start set incsearch set ignorecase set ruler set wildmenu set commentstring=\ #\ %s set clipboard+=unnamed syntax on

SyncfirebaseCloudFirestore Sync sources and publish updated category

Synchronize XML from different sources, to filter out duplicates and print static customer vacancies in files system. That is internal working method, we are not currently publishing scripts in open source projects because the project is still too raw.  On server vacatures.today ./crontab/syncjobs.bash It contains python3 manage.py syncfirebaseCloudFirestore python3 manage.py deleteold yes | python3 manage.py rebuild_index --using=default On client for firebase deploy ./publish_categories.bash If not installed. sudo pip3 install firebase-admin sudo pip3 install -U Jinja2 Old version slugify is not working in py3. sudo pip3 uninstall slugify sudo pip3 install python-slugify eslint: command not found /bin/sh: eslint: command not found npm ERR! code ELIFECYCLE npm ERR! syscall spawn npm ERR! file /Users/sergejdergatsjev/.cache/firebase/runtime/shell npm ERR! errno ENOENT npm ERR! functions@ lint: `eslint .` npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the functions@ lint script. npm

Change UFW config or disable Firewall on your server mount Raid

Sometimes it can happen that you have not configured your firewall correctly and locked yourself out so that the server is no longer accessible. Activate rescue CD and restart server with Linux 64 bit. Lsblk mkdir /media/mydrive mount /dev/md2 /media/mydrive ls /media/mydrive Now you can access config files in your main operating system. UFW configs you can find in Ubuntu vim /etc/ufw/user.rules So you can reach it in this way. vim /media/mydrive/etc/ufw/user.rules Then you can add rules with your own IP and restart the server… Or you can disable UFW with vim /media/mydrive/etc/ufw/ufw.conf

CRM installation on test server

In General, we can say that the bakup and the code are fully functional. I deployed it in one day without roughly straining. Generally 2 - 3 hours if needed. apt-get install postgresql sudo -u postgres createuser -D -A -P username sudo -u postgres createdb -O user db psql -U user -W pwd -h localhost -p 5432 -f crm.sql git clone https:// apt install libcurl4-openssl-dev libssl-dev pip3 install -r  requirements.txt apt install python3-dev apt-get install  python-dev apt-get install build-essential Troubleshooting When i start runserver then.  raise MissingDependency( haystack.exceptions.MissingDependency: The 'elasticsearch5' backend requires the Elastic wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - apt-get install apt-transport-https Echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list apt-get update && sudo apt-get install elasticsearch Not helped  pip3 ins