Issue:
Cannot using arrow keys when updating document in vi mode
Solution
$ vim ~/.vimrc
$ set nocompatible
Cannot using arrow keys when updating document in vi mode
$ vim ~/.vimrc
$ set nocompatible
To check running Tomcat process on Ubuntu, run the following command:
$ ps -ef | grep tomcat
Note: column 2 is process number.
And also kill all
$ ps -ef | grep tomcat | awk ‘{print $2}’ | xargs kill -9
To list out processes comsume memory sorted decending
ps aux --sort -rss
Create a new repo from a tag in order to start coding.
$ git remote add horus_remote git@bitbucket.org:luan_vominh/edx-platform-gingko.git $ git fetch horus_remote $ git add --all $ git push -u horus_remote master tags/open-release/ginkgo.1
Next, in case we want to use the new repo for coding, just checkout new branch:
$ git checkout -b horus_remote
Next, in case we add new files and want to push to the new repo:
$ git add --all $ git commit -m 'your message' $ git push --set-upstream origin horus_remote
In above example, i want to fork a new repository from EDX ginkgo.1 release.
The objective of this post is to guide to enable an exisitng theme, then active it.
EDX version: ficus devstack.
Open EDX comes with few existing themes:
Firstly, we need to enable a theme first: red-theme in my case.
$ vagrant ssh $ sudo su edxapp $ cd ~ $ vi lms.env.json
Update following three fields:
"ENABLE_COMPREHENSIVE_THEMING": true DEFAULT_SITE_THEME": "red-theme", "COMPREHENSIVE_THEME_DIRS": [ "/edx/app/edxapp/edx-platform/themes" ], "THEME_NAME": "red-theme",
Restart the server.
Until this step, the red-theme theme is enabled and ready to use. However, our site is still not using this theme. We need to apply the theme.
We need to apply theme to a site, this is done via /admin url.
Login http://localhost:8000/admin with an admin account. The default installation does not come with an admin account. We MUST create a new one. Please see the sesction below.
url: http://localhost:8000/admin/sites/site/
url: http://localhost:8000/admin/theming/sitetheme/
naming new theme with the name set up in lms.env.json. In my case: red-theme.
In case you want to swith to edx.org theme for example, just update the site theme via http://localhost:8000/admin/theming/sitetheme/
and it will be impacted immediately, no need to restart the server.
Run following scripts line by line:
$ vagrant ssh $ sudo su -s /bin/bash edxapp $ /edx/bin/python.edxapp /edx/bin/manage.edxapp lms manage_user staff3 staff3@example.com --staff --superuser --settings=aws
then we need to set the password
$ /edx/bin/python.edxapp ./manage.py lms --settings aws changepassword staff3
Below are my steps to install full-stack version of EDX Ginkgo release:
$ mkdir fullstack $ cd fullstack $ export OPENEDX_RELEASE="open-release/ginkgo.1" $ curl -OL https://raw.github.com/edx/configuration/$OPENEDX_RELEASE/util/install/install_stack.sh $ bash install_stack.sh fullstack
$ vagrant up $ vagrant ssh
LMS: http://192.168.33.10/ (user: staff@example.com – password: edx)
Studio: http://192.168.33.10:18010/
Page admin: http://192.168.33.10/admin (user: admin@example.com – password: password)
$ cd /edx/app/edxapp/edx-platform $ sudo -u www-data /edx/bin/python.edxapp ./manage.py lms --settings aws create_user -s -p edx -e admin@example.com $ sudo -u www-data /edx/bin/python.edxapp ./manage.py lms --settings aws changepassword admin $ sudo -u www-data /edx/bin/python.edxapp ./manage.py lms --settings aws shell
copy and paste following commands line by line
>> from django.contrib.auth.models import User >> me = User.objects.get(username="admin") >> me.is_superuser = True >> me.is_staff = True >> me.save() >> exit()
After user is created, we should restart servers.
//--lms, cms $ sudo /edx/bin/supervisorctl restart edxapp: //ecommerce $ sudo /edx/bin/supervisorctl restart edxapp: ecommerce: //forum $ sudo /edx/bin/supervisorctl restart forum:
if you don't want to use the above default port: 192.168.33.10, pick another one that suitable your LAN network, and edit Vagrantfile in fullstack directory to change line below: config.vm.network :private_network, ip: "192.168.33.10"
to
config.vm.network :public_network, ip: "192.168.1.50", use_dhcp_assigned_default_route: true
That’s all.
$ git status
$ git diff
$ git add -A && git commit -m 'update title'
$ git reset –hard origin/master
$ git merge --no-commit stroke_study $ git reset HEAD scripts/horusValidationRules.js $ git checkout scripts/horusValidationRules.js $ git commit -m "merged stroke_study" $ git push
The object of this post is to guide how to run EDX in other language, it is Vietnamese in my case.
I have followed the guideline at https://github.com/edx/edx-platform/wiki/Internationalization-and-localization
$ vagrant ssh $ sudo su edxapp
create ~/.transifex file with following content: [https://www.transifex.com] hostname = https://www.transifex.com username = luanvm password = <your_password> token =
Your account in transfex must be joined to edx project. If not, you cannot pull new languages.
$ tx pull -l vi
$ paver i18n_fastgenerate
In case you want to update message locally, just update .po files then re-compile: $ paver i18n_fastgenerate
That’s all.
The object of this post is guide how to connect to Vagrant instance using FileZila to transfer / update file in remote EDX running instance.
Before using Filezila, we should use Teminal first.
$ vagrant up
$ vagrant ssh
$ ps aux | grep ssh
Output looks likes:
Luans-MacBook-Pro:home luan$ ps aux | grep ssh luan 3755 0.0 0.0 2464336 2188 s002 S+ 11:18AM 0:01.72 ssh vagrant@127.0.0.1 -p 2222 -o Compression=yes -o DSAAuthentication=yes -o LogLevel=FATAL -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i /Users/luan/.vagrant.d/boxes/ficus-devstack-2017-02-07/0/virtualbox/vagrant_private_key
$ ssh vagrant@127.0.0.1 -p 2222
Enter default password: vagrant
So the key point is vagrant port is 2222 instead of 22 as normal. FileZila confiuration will look like:
In case we need to edit file that owner is edxapp , we should connect to fileZila with edxapp user.
If we dont know edxapp’s password, we should change it:
$ sudo su passwd edxapp
Then type your password.
That’s all
To import an existing database from your localhost to your deployment server, follow steps below please:
$ sudo -su postgres psql # drop database wwf1; Then create a new database with the same name wwf1 # create database wwf1 owner wwf1; Then import your db file to the new database created $ sudo -su postgres psql wwf1 < /root/dbfiles/local_wwf1_20170526.dump Finally we need to grant all permission to wwf1. If we miss this step, we cannot start the instance. # GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO wwf1; Next is update owner of hibernate_sequence to wwf1. To see all sequences owners, run: # \d Update sequence owner with command: # alter sequence hibernate_sequence owner to wwf1;
Note:
Cursor #: meaning that you are logged in posgres
Curso $: meaning that you are in command shell window, not in Posgres command window
Solution 2 After we create a new database in above step. We can use text editor to update dump file to replace old owner with a new one to. With this way we do not need to run scripts to grant privileges.
EDX is using mongodb, and mysql. I am using devstack version installed on MacOSX.
I was attempting to connect to mongo db to discover which inside it. I spent a couple days and always got the same issues as below:
vagrant@vagrant:/edx/app/edxapp$ mongo MongoDB shell version: 2.6.12 connecting to: test 2017-05-23T04:53:57.796+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused 2017-05-23T04:53:57.798+0000 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146 exception: connect failed
I also tried following commands:
$ mongo admin $ mongo edxapp $ mongo localhost/edxapp -username edxapp -password edxapp
All printed the same error message.
I thought that the mongo db was running because i was doing debug with PyCharm that time. So i was stuck there.
Fortunately i found the solution next day when trying to start mongo db first. Then try above commands. and it works fine.
So, to start developing EDX, we should check where mongodb is running or not.
$ sudo service mongod status
My db is down
● mongod.service - High-performance, schema-free document-oriented database Loaded: loaded (/etc/systemd/system/mongod.service; enabled; vendor preset: e Active: inactive (dead) since Tue 2017-05-23 04:43:27 UTC; 1min 18s ago Docs: https://docs.mongodb.org/manual Process: 14428 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (co Main PID: 14428 (code=exited, status=0/SUCCESS) May 23 04:31:17 vagrant systemd[1]: Started High-performance, schema-free docume May 23 04:43:27 vagrant systemd[1]: Stopping High-performance, schema-free docum May 23 04:43:27 vagrant systemd[1]: Stopped High-performance, schema-free docume
$ sudo rm /edx/var/mongo/mongodb/mongod.lock $ sudo -u mongodb mongod --dbpath /edx/var/mongo/mongodb --repair --repairpath /edx/var/mongo/mongodb $ sudo systemctl start mongod.service
$ sudo service mongod stop