Posts

Showing posts with the label module

How to install E-Commerce module in Bitnami' Open edX distribution

Important note: Bitnami distribution of Open edX is designed for testing and demonstration purposes so the e-commerce module integration is for experiment only. Please use this installation guide as your own risk. Bitnami' Open edX distribution only includes several core services such as LMS, Studio, XQueue, Forum as well as supporting services like MySQL, MongoDB, Memcached, Apache or Elasticsearch (more details here ). Additionally, Bitnami' application structure for Open edX is different than the official stack supported by the Open edX community. So, because of those reasons, in order to integrate the e-commerce module in your running instance, currently, there is no way other than doing it manually. I have had a chance to deploy successfully the e-commerce into a test Open edX instance for a customer. Below is how I did it. You can use it as a reference and leave me a comment if you find any errors or want to add something. 1. Directory structure: Assuming you ...

Fix error "AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'" when installing keystone on Ubuntu 16.04

I followed the keystone's official docs to install it but got this error on Ubuntu 16.04: AttributeError : 'module' object has no attribute 'Cryptography_HAS_SSL_ST' Then I added this below ppa and I can install keystone successfully: sudo add-apt-repository ppa:ubuntu-cloud-archive/queens-staging sudo apt-get update sudo apt install keystone  apache2 libapache2-mod-wsgi

How to install and start E-commerce service in Open edX navetive installations (Ubuntu 16.04)

Assumptions: You are installing this on an AWS instance of Ubuntu 12.04, 64-bit You have at least 30GB of space assigned to the root drive These instructions are as current as of the Fiscus.3 platform release 1. Update and install system dependencies sudo apt-get update -y sudo apt-get install -y build-essential software-properties-common python-software-properties curl git-core libxml2-dev libxslt1-dev libfreetype6-dev python-pip python-apt python-dev libxmlsec1-dev swig libmysqlclient-dev sudo pip install --upgrade pip sudo pip install --upgrade virtualenv 2. Clone the edx configuration repository and install edX and ecommerce cd /var/tmp git clone https://github.com/edx/configuration cd /var/tmp/configuration sudo pip install -r requirements.txt sudo pip install setuptools --upgrade cd /var/tmp/configuration/playbooks nano -w edx_sandbox.yml * Inside the edx_sandbox.yml file, change the SANDBOX_ENABLE_ECOMMERCE flag from False to True. sudo ansible...

How to fix "AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'" err in Ubuntu 17.04

If for some reason you got this error in your Ubuntu 17.04 server: AttributeError : 'module' object has no attribute 'PROTOCOL_SSLv3' ** try this to fix it: $ sudo pip install requests==2.6.0 Or $ sudo pip install --upgrade requests

Add Back-to-Top button to your Tikiwiki

When browsing the Tikiwiki forum, I noticed the Back-to-Top button which is pretty useful and I want to bring it to my own Tikiwiki. But, the thing is there is no documentation about it so I have to look into the HTML source of the forum. It turned out that It's quite simple: 1. What you need to do first is to create a custom module: http://your-tikiwiki-url/tiki-admin_modules.php In the Custom Modules tab -> Add this to the Data text field: <div class="backtotop"><a href="#top" title="Back To Top">⌅</a></div> -> Click Save 2. Then, assign the custom module to the Bottom section: Go to Assigned Modules -> Bottom tab -> Add module -> Select your Back to Top module Make sure these parameter was set: Position: bottom Parameters: nobox=y -> Click Assign 3. Go to Look & Feel, Customization tab, add this CSS: .backtotop { bottom: 3rem; position: fixed; right: 3rem; } .backtotop a:af...

Install Xibo 1.7.9 in Ubuntu 16.04 with PHP7.0

Installing Xibo (1.7.9) is pretty simple if it's not going with PHP 7.0 because PHP7.0 completely gets rid of mysql_* functions. But for some reasons you have no choice and gotta use PHP 7. In my situation, It's a Ubuntu 16.04 server and PHP 7.015. So what you can do is to compile the mysql_* module yourself. 1. Clone the pecl module to extension directory of php cd /etc/php/7.0/mods-available git clone https://github.com/php/pecl-database-mysql mysql --recursive 2. Compile the source cd /etc/php/7.0/mods-available/mysql phpize ./configure make make install Note: to have phpize, you may need php7.0-dev installed. 3. Symlink the module into php extension directory ln -s /usr/lib/php/20151012/mysql.so /etc/php/7.0/mods-available/mysql.so 4. Modify php.ini to enable mysql extension nano /etc/php/7.0/fpm/php.ini ... extension=/etc/php/7.0/mods-available/mysql.so ... 5. Restart php sudo systemctl restart php7.0-fpm The res...

ImportError: No module named _io in ubuntu 14.04

After I upgraded my Ubuntu 12.04 server to 14.04, my django app stopped working. I tried to debug it and got this error message: ImportError: No module named _io And the reason of this is the python of my virtualenv (2.7.3) and the server's python version (2.7.6) was mismatched. So, what I did to fix the issue was overriding the virtualenv's python binary with the new one: cp `which python2.7` myenv/bin/python

Mass reset Active Directory users's password remotely using python

In Microsoft Windows Server 2008 (Active Directory Domain Controller), you can reset a user password using command prompt with dsmod: dsmod user <user dn> -pwd new_password What if you want to do it from remote? Python and Paramiko module will help: 1. In the Active Directory domain controller, install  cygwin with ssh module. Create a ssh user. 2. Still in the Active Directory domain controller, export the user's dn list to a csv file using command prompt: dsquery user "ou=MyUser,dc=my,dc=domain,dc=com" | dsget user -samid -fn -ln -dn > myusers.csv 3. Open names.csv, add a column name "password" and fill in new password for all the user. Save and copy it to your computer. 4. In your computer (I'm running Ubuntu 14.04), install all the paramiko python module: $ sudo pip install paramiko then run this python script: $ python mass_reset_ad_passwd.py /path/to/myusers.csv

ExcelFu - Concatenate string with condition

How can I achieve table #2 from table #1 in Excel? TABLE1 => TABLE2  Name No. No. Name A 1 1 A,D,K B 2 2 B,G,H,I C 3 3 C,E,F D 1 E 3 F 3 G 2 H 2 I 2 K 1 There are 2 things I need to do to create table 2: 1. Filter TABLE2 by No. column 2. Concatenate those records which have the same No. But, with the built-in functions set of Excel spreadsheet, I can only do 1 thing at a time. I meant I can only concatenate string without condition or only filter records without concatenate the results. So, the only way is to create a User Define Function : 1. Press ALT+F11 in excel to open the Microsoft Visual Basic window. 2. Click Insert menu > Module and define the ConcatenateIf function: Function ConcatenateIf (CriteriaRange As Range, Condition As Variant, _         ConcatenateRange As Range, Optional Separator As String = ",") As Variant     Dim i As L...

Python - Install lxml module

Image
To be able to install lxml python module, you have to install some of its dependencies: sudo apt - get install python - dev libxml2 libxml2 - dev libxslt - dev pip install lxml     For more information about lxml: http://lxml.de/     

Some tips on python's subprocess module

Here is a weird case I faced when using Subprocess module, or because I do not know deep enough about it: As you knew, we can execute terminal shell script by calling subprocess: for example, we want to archive all of the pdf file to a tar ball, and delete all of pdf file after that: >>> import subprocess >>> tar_path = "/home/projects/mytar.tar.gz" >>> files_path = "/home/projects/*.pdf" >>> command = ["tar", "-cvvf", tar_path, files_path, "--remove-files"] >>> subprocess.call(command) But, those above command will add all pdf files including their path to the tar ball. I found a solution, and it's pretty easy: instead of declaring command as a list, stating it as a string of command >>> command = 'tar -cvvf ' + tar_path + ' ' + files_path + ' --remove-files' >>> subprocess.call(command, shell=True) (Be careful with 'shell=True...