Monitor celery by using celery -A freightquotes events
Start celery with beats celery -A freightquotes worker -B -E -l INFO --autoscale=2,1
Note:-
-B beats - to execute schedule tasks
-l log-level (INFO/DEBUG)
-E --task-events
#!/bin/sh | |
cli=/Applications/Karabiner.app/Contents/Library/bin/karabiner | |
$cli set remap.fn_fkeys_to_consumer_f10 1 | |
/bin/echo -n . | |
$cli set private.holdingEscape_to_Control-L 1 | |
/bin/echo -n . | |
$cli set switch_input_language 1 | |
/bin/echo -n . |
sudo timedatectl set-timezone Australia/Sydney | |
sudo yum -y update | |
sudo yum -y install gcc gcc-c++ kernel-devel libxml++-devel libxml2-devel python-devel libxslt-devel libffi-devel openssl-devel mysql-devel | |
sudo yun -y install ImageMagick-devel libcurl-devel wget zip git bash-completion bash-completion-extras curl enchant | |
ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
cat ~/.ssh/id_rsa.pub | |
sudo vi /etc/sysconfig/network | |
sudo echo 'HOSTNAME=luotao.net' >> /etc/sysconfig/network |
# properly install redis follow official doc on centos | |
# https://redis.io/topics/quickstart#installing-redis-more-properly | |
wget http://download.redis.io/redis-stable.tar.gz | |
tar xvzf redis-stable.tar.gz | |
cd redis-stable | |
make | |
sudo cp src/redis-server /usr/local/bin/ | |
sudo cp src/redis-cli /usr/local/bin/ |
--- a/certification/forms.py | |
+++ b/certification/forms.py | |
@@ -309,3 +309,47 @@ class BaseCertRecipeIngredientFormSet(BaseFormSet): | |
+class CertRecipeAttachmentForm(forms.ModelForm): | |
+ # id = forms.CharField(label=_("id"), max_length=254, required=False, widget=forms.HiddenInput()) | |
+ type = forms.ChoiceField(label=_("Attachment type"), choices=[('', '----')] + RECIPE_ATTACHMENT_TYPE_CHOICES, | |
+ required=True, | |
+ error_messages={'required': "Please select type."}) | |
+ file = ExtFileField(label=_("File"), required=False, | |
+ ext_whitelist=['.pdf', '.doc', '.docx', '.jpg', '.png', '.gif', '.eps'], |
openssl version | |
cd /home/install | |
wget https://www.openssl.org/source/openssl-1.0.2m.tar.gz | |
tar -zxf openssl-1.0.2m.tar.gz | |
cd openssl-1.0.2m/ | |
./config | |
make | |
make test | |
make install |
# open Pycharm settings->Build,Execution,Deployment->Console->Django Console | |
# 1.add env var: DJANGO_SETTINGS_MODULE -> settings.settings | |
# 2.copy below into Starting script | |
# open preferences->keymap->search `Python Console`->create new shortcut `cmd + 3` | |
from pprint import pprint | |
from django_extensions.management.shells import import_objects | |
from django.core.management.color import no_style | |
from datetime import datetime |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>com.mysql.mysqld</string> | |
<key>ProgramArguments</key> | |
<array> |
# 1. update openssl | |
brew install openssl | |
brew link openssl --force | |
# 2.reinstall python | |
brew install python --with-brewed-openssl | |
# 3.re-create virtualenv | |
rm -rf env/ | |
virtualenv env --python=/usr/local/Cellar/python/2.7.14/bin/python |
# download https://nodejs.org/en/ | |
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share} | |
npm init -y | |
npm set init.author.email "[email protected]" | |
npm set init.author.name "Lorne" | |
npm set init.license "MIT" | |
npm install express-generator -g |