Skip to content

Instantly share code, notes, and snippets.

View dehamzah's full-sized avatar
🦉
Morning Owl

Dede Hamzah dehamzah

🦉
Morning Owl
View GitHub Profile
@dehamzah
dehamzah / pagination.js
Created January 22, 2018 13:41
Pagination like github
function getDisplayedPages(currentPage, pagesArr) {
/*
Will return 5 total pages, with current page in the middle.
*/
var lastPage = pagesArr.length;
var first = (Math.sign(currentPage - 3) === -1) ? 0 : currentPage - 3;
var last = currentPage + 2;
if (currentPage > lastPage) return;
@dehamzah
dehamzah / err.log
Created December 11, 2017 16:47
Error running: sudo /edx/bin/update edx-platform open-release/ginkgo.master
[edxapp : add gunicorn configuration files] *******************************
ok: [localhost] => (item=lms)
ok: [localhost] => (item=cms)
TASK [edxapp : enable {{ item }} supervisor script] ****************************
ok: [localhost] => (item=lms)
ok: [localhost] => (item=cms)
TASK [edxapp : enable edxapp supervisor script] ********************************
ok: [localhost]
@dehamzah
dehamzah / err.log
Created December 11, 2017 00:48
Failed when running ginkgo.1.patch-wiki
TASK [edxapp : migrate] ********************************************************
failed: [localhost] (item=lms) => {"changed": true, "cmd": ["/edx/bin/edxapp-migrate-lms"], "delta": "0:00:00.985133", "end": "2017-12-10 22:57:05.835998", "f
ailed": true, "item": "lms", "rc": 1, "start": "2017-12-10 22:57:04.850865", "stderr": "Traceback (most recent call last):\n File \"manage.py\", line 111, in
<module>\n startup = importlib.import_module(edx_args.startup)\n File \"/usr/lib/python2.7/importlib/__init__.py\", line 37, in import_module\n __impo
rt__(name)\n File \"/edx/app/edxapp/edx-platform/lms/startup.py\", line 12, in <module>\n settings.INSTALLED_APPS # pylint: disable=pointless-statement\n
File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/conf/__init__.py\", line 48, in __getattr__\n self._setup(name)\n File \"/e
dx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/conf/__init__.py\", line 44, in _setup\n self._wrapped = Settings(settings_mo
@dehamzah
dehamzah / err.log
Created December 10, 2017 18:21
Error when running sandbox.sh twice. using ginkgo.master
TASK [mongo : Create super user with js] ***************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "/usr/bin/mongo admin /tmp/create_root.js", "delta": "0:00:00.046135", "end": "2017-12-10 18:07:16.602
854", "failed": true, "rc": 253, "start": "2017-12-10 18:07:16.556719", "stderr": "", "stderr_lines": [], "stdout": "MongoDB shell version: 2.6.12\nconnecting
to: admin\nError: 18 { ok: 0.0, errmsg: \"auth failed\", code: 18 }\n2017-12-10T18:07:16.601+0000 Error: not authorized on admin to execute command { usersIn
fo: \"admin\" } at src/mongo/shell/db.js:1342\nfailed to load: /tmp/create_root.js", "stdout_lines": ["MongoDB shell version: 2.6.12", "connecting to: admin",
"Error: 18 { ok: 0.0, errmsg: \"auth failed\", code: 18 }", "2017-12-10T18:07:16.601+0000 Error: not authorized on admin to execute command { usersInfo: \"ad
min\" } at src/mongo/shell/db.js:1342", "failed to load: /tmp/create_root.js"]}
to retry, use: --limit @/var/tmp/configuration/playbooks/edx
@dehamzah
dehamzah / err.log
Last active December 10, 2017 09:59
Error installing ficus.master on AWS
TASK [notifier : Check if incommon ca is installed] ****************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["test", "-e", "/usr/share/ca-certificates/incommon/InCommonServerCA.crt"], "delta": "0:00:00.003425",
"end": "2017-12-10 09:49:10.940451", "failed": true, "rc": 1, "start": "2017-12-10 09:49:10.937026", "stderr": "", "stdout": "", "stdout_lines": [], "warning
s": []}
...ignoring
TASK [notifier : Create incommon ca directory] *********************************
changed: [localhost]
@dehamzah
dehamzah / err.log
Created December 10, 2017 05:17
Error installing ginkgo.master
/edxval/models.py:164: RemovedInDjango19Warning: Model class edxval.models.Subtitle doesn't declare an explicit app_label and either isn't in an appl[10/1472]
n INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.", " class Subtitle(models.Model):",
"", "2017-12-09 23:49:30,825 WARNING 12111 [py.warnings] base.py:116 - /edx/app/edxapp/edx-platform/openedx/core/djangoapps/video_config/models.py:10: Removed
InDjango19Warning: Model class openedx.core.djangoapps.video_config.models.HLSPlaybackEnabledFlag doesn't declare an explicit app_label and either isn't in an
application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.", " class HLSPlaybackE
nabledFlag(ConfigurationModel):", "", "2017-12-09 23:49:30,826 WARNING 12111 [py.warnings] base.py:116 - /edx/app/edxapp/edx-platform/openedx/core/djangoapps/
video_config/models.py:51: RemovedInDjango19Warning: Model class opened
@dehamzah
dehamzah / err.log
Created December 10, 2017 04:07
Error installing ginkgo.master
TASK [edxapp : create service worker users] ************************************
failed: [localhost] (item={u'username': u'enterprise_worker', u'is_superuser': False, u'is_staff': True, u'email': u'enterprise_worker@example.com'}) => {"cha
nged": true, "cmd": "/edx/app/edxapp/venvs/edxapp/bin/python ./manage.py lms --settings=aws --service-variant lms manage_user enterprise_worker enterprise_wor
ker@example.com --unusable-password --staff", "delta": "0:00:04.614549", "end": "2017-12-10 03:53:50.306640", "failed": true, "item": {"email": "enterprise_w
orker@example.com", "is_staff": true, "is_superuser": false, "username": "enterprise_worker"}, "rc": 1, "start": "2017-12-10 03:53:45.692091", "stderr": "Trac
eback (most recent call last):\n File \"./manage.py\", line 112, in <module>\n startup.run()\n File \"/edx/app/edxapp/edx-platform/lms/startup.py\", line
26, in run\n django.setup()\n File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/__init__.py\", line 18, in setup\n
@dehamzah
dehamzah / err.log
Created December 10, 2017 02:14
Error running ginkgo.master
TASK [mongo : Create a mongodb user] *******************************************
failed: [localhost] (item={u'password': u'yXI0SUajXsi9yROzGCIEMUksLbbaDu6rSTh',
u'user': u'cs_comments_service', u'roles': u'readWrite', u'database': u'cs_comme
nts_service'}) => {"failed": true, "item": {"database": "cs_comments_service", "
password": "yXI0SUajXsi9yROzGCIEMUksLbbaDu6rSTh", "roles": "readWrite", "user":
"cs_comments_service"}, "msg": " (Note: you must use pymongo 3.2+ with MongoDB >
= 3.2)"}
failed: [localhost] (item={u'password': u'3hUo4aa0w2xJJAIwVlGh2Ahq4Nxroyealmi',
u'user': u'edxapp', u'roles': u'readWrite', u'database': u'edxapp'}) => {"failed
": true, "item": {"database": "edxapp", "password": "3hUo4aa0w2xJJAIwVlGh2Ahq4Nx
@dehamzah
dehamzah / err.log
Created December 8, 2017 13:35
Error log installation ficus.4
TASK [edxapp : migrate] ********************************************************
failed: [localhost] (item=lms) => {"changed": true, "cmd": ["/edx/bin/edxapp-migrate-lms"], "delta": "0:00:02.074492", "end": "2017-12-08 13:33$
42.207809", "failed": true, "item": "lms", "rc": 1, "start": "2017-12-08 13:33:40.133317", "stderr": "Traceback (most recent call last):\n Fil$
\"manage.py\", line 111, in <module>\n startup = importlib.import_module(edx_args.startup)\n File \"/usr/lib/python2.7/importlib/__init__.$
y\", line 37, in import_module\n __import__(name)\n File \"/edx/app/edxapp/edx-platform/lms/startup.py\", line 18, in <module>\n import $
ms_xblock.runtime\n File \"/edx/app/edxapp/edx-platform/lms/djangoapps/lms_xblock/runtime.py\", line 9, in <module>\n from openedx.core.dja$
goapps.user_api.course_tag import api as user_course_tag_api\n File \"/edx/app/edxapp/edx-platform/openedx/core/djangoapps/user_api/course_tag$
api.py\", line 10, in <module>\n from ..models import UserCourseTag\n
@dehamzah
dehamzah / err.log
Created December 8, 2017 11:16
Error installation fresh ginkgo.1
TASK [edxapp : install python requirements] ************************************
changed: [localhost] => (item={'_ansible_parsed': True, u'stat': {u'isuid': False, u'uid': 1004, u'exists': True, u'attr_flags': u'e', u'woth':
False, u'isreg': True, u'device_type': 0, u'mtime': 1512730079.048504, u'block_size': 4096, u'inode': 1284581, u'isgid': False, u'size': 450, u'
executable': False, u'charset': u'us-ascii', u'readable': True, u'version': u'18446744071730971442', u'pw_name': u'edxapp', u'gid': 1006, u'isch
r': False, u'wusr': True, u'writeable': True, u'mimetype': u'text/plain', u'blocks': 8, u'xoth': False, u'islnk': False, u'nlink': 1, u'issock':
False, u'rgrp': True, u'gr_name': u'edxapp', u'path': u'/edx/app/edxapp/edx-platform/requirements/edx/pre.txt', u'xusr': False, u'atime': 15127
30079.048504, u'md5': u'1050fd376a57619d9d5e8da726f30681', u'isdir': False, u'ctime': 1512730079.048504, u'isblk': False, u'wgrp': False, u'xgrp
': False, u'dev': 2049, u'roth': True, u'isfifo': False, u'mode': u'0644'