Posts

Showing posts with the label git

Deploy OpenWRT as QoS VNF on OpenStack Tacker

So I just updated the OpenWRT VNFM management driver of OpenStack Tacker to support more services like DHCP, DNS, and QoS ( the code is under review now ). But, if you are so eager to try, here is how: 1. Download the custom image of OpenWRT from here  (because the default OpenWRT image doesn't have qos-scripts installed). 2. Upload that image to your OpenStack instance: openstack image create OpenWRT --disk-format qcow2 \                                --container-format bare \                                --file /path_to_image/openwrt.img \                                --public 3. Use this VNFD template to generate VNF: Note : Use this at your own risk. References: [0] https://wiki.openwrt.org/doc/howto/obtain.firmwa...

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...

edx-platform - How to make SMTP work on your Open EdX instance the proper way

There were several threads in the Open EdX mailing list asking about how to make the email working. But, it seams like there is no proper instructions out there to help people. So, I decided to write something about that. Firstly, there are 3 simple things to keep in mind: All the authentication information should be kept privately. If you add them to the edx-platform source files there will be conflicts when you upgrade or pull from master/branches. So, the best place to keep all the settings for all your Open edX applications is /edx/app/edx_ansible/server-vars.yml .  0. Checkout all of your modification on: (to avoid source code conflicts) cms/envs/common.py lms/envs/aws.py cms.env.json cms.auth.json lms.env.json lms.auth.json 1. Create  server-vars.yml   in  / edx/app/edx_ansible/ 2. Add these following variables to server-vars.yml with your SMTP information: EDXAPP_EMAIL_BACKEND: 'django.core.mail.backends. smtp.EmailBackend' EDXAPP_EMAIL_HOST: '...

Cannot push code to gitlab after upgraded to v7.8 from v6.9 and how to fix

After we upgraded our gitlab server to v7.8 from v6.9 , we could not push code to it and always got this error: ... remote: /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/shared_helpers.rb:2:in `require': no such file to load -- rubygems (LoadError) remote:         from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/shared_helpers.rb:2 remote:         from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/setup.rb:1:in `require' remote:         from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/setup.rb:1 To http://our.repo.url/myusername/my-project.git  ! [remote rejected] my_branch -> my_branch (pre-receive hook declined) ... I was trying to re-compile ruby 2.1 so many times but had no luck. After messing around, I finally fixed this issue by: 1. Remove and Purge all ruby binaries except for ruby 2.1 from my server: sudo apt-get remove rub...

Install moodle 2.8 with nginx and php5-fpm in Ubuntu14.04

The latest version of Moodle (v2.8) had been released a couple days ago with some improvement especially the gradebook ( click here for more information). This blog post is about deploying a moodle instance along side with nginx and php5-fpm . 0. Create the database: $ mysql -u root p MariaDB [(none)]> create database moodle; MariaDB [(none)]> grant all privileges on moodledb.* to 'moodleuser'@'localhost' identified by 'moodlepassword'; 1. Clone the latest stable Moodle using git: $ cd /var/www $ sudo git clone --depth=1 -b MOODLE_28_STABLE --single-branch git://git.moodle.org/moodle.git  $ sudo chown www-data:www-data -R moodle $ sudo chmod -R 0777 moodle 2. Create the moodle data directory: $ sudo mkdir /var/www/moodledata $ sudo chown www-data:www-data -R /var/www/moodledata $ sudo chmod -R 0777 /var/www/moodledata 3. Setup nginx: $ sudo service nginx restart 4. Config php5-fpm: make sure the /etc/php5/fpm/php.ini: ... ...

Fix git's "The remote end hung up unexpectedly" error

If you push your changes to a remote branch and get this error: error: RPC failed; result=22, HTTP code = 411 fatal: The remote end hung up unexpectedly Writing objects: 100% (460/460), 1.08 MiB | 0 bytes/s, done. Total 460 (delta 33), reused 0 (delta 0) fatal: The remote end hung up unexpectedly Just increase your git buffer (e.g 500MB) and it will be fine: $ git config http.postBuffer 524288000

Force git pull from remote

If you want to discard the commits you've made locally, i.e. never have them in the history again, you can just do a hard reset: # fetch from the default remote, origin git fetch # reset your current branch (master) to origin's master git reset --hard origin/master

Using Boris REPL to test your PHP code

Image
Love the Python REPL interface? Wanna do something like that in PHP? Let's try Boris , the missing PHP REPL: https://github.com/d11wtq/boris To install boris in Ubuntu (I'm using v14.04), the easiest way is to  clone the git repository: $ git clone git://github.com/d11wtq/boris.git $ cd boris $ sudo ln -s /path/to/boris/bin/boris /usr/local/bin/boris Now you can test-drive your PHP code in command line without writing all the code at one.

Using git to deploy/update source code to production server

I've just tried the we-all-know-what-it-is tool, git , to deploy and update changes to production server: 1. On my development computer, commit all changes and push to the repository: $ git add -A . $ git commit -m "Before deploying" $ git push origin master 2. On the production server: $ git clone myaccount@my.repo.address 3. In the development machine, update code, commit, and push to repository: $ git add -A . $ git commit -m "Updates" $ git push origin master 4. In production server, pull code from master: $ git pull origin master ...and so on It's quite interesting!

Git - Using SSH key to push code without entering password

I had to enter password every time I push my commits to git server. I can avoid doing it again and again by using SSH key: 1. In my computer, generate SSH Key : $ cd ~/.ssh $ ssh-keygen -t rsa -C "dangtrinhnt@gmail.com" The above command will create 2 files, id_rsa and id_rsa.pub . id_rsa.pub is your public key. Send it to the git server. 2. Copy the public key to the remote server: $ ssh-copy-id -i ~/.ssh/id_rsa.pub myusername@remotehost The command will prompt me to enter password of my user account in the remotehost. Enter and done. + After that, if I can ssh to the remote server without error, I can assume that it works: trinh@mylocalpc$ ssh myusername@remotehost myusername@remotehost$ + If I get the error " Agent admitted failure to sign using the key ", run the following command and try to ssh again: $ ssh-add From now on, whenever I push code to remote git server, I don't have to input my password anymore. References: http:...