Showing posts from December, 2017

How to output logs of OpenStack Tacker to a file in devstack

It's quite useful for developers to see the logs of Tacker when we try to deploy vnf, vnffg, or ns etc... It was disabled by default so you need to enable it:

1. Modify the Tacker's configuration:

$ sudo nano /etc/tacker/tacker.conf

2. Adjust the log_file variable with the log file path:

log_file = /opt/stack/logs/tacker.log

3. Restart Tacker

$ sudo systemctl restart devstack@tacker

Now you will see everything happen in the background when you do something with Tacker. For example:

* Open a separate terminal and see the log in real time

$ tail -n 100 -f /opt/stack/logs/tacker.log

* On another terminal, do something like import a new vnfd template:

$ tacker vnfd-create --vnfd-file vnfd.yaml vIDS-TEMPLATE

* Back to the log terminal, you will see what is going on

Error when creating Forwarding Graph in OpenStack Tacker

The problem when you learn something by reading old blog posts is that the technology may have already been changed since the date of the post so you're most likely to get into trouble just like me.

I followed some tutorial online about creating a VNF forwarding graph or a service function chain in OpenStack tacker and got this error:

$ tacker vnffg-create --vnffgd-name VNFFG-TEMPLATE MY-VNFFG

BadRequest: Flow Classifier conflicts with another Flow Classifier 564c5506-8fe7-4b1d-b76d-8eb1768463aa

According to the error above, I tried to delete the flow classifier:

$ neutron flow-classifier-list
$ neutron flow-classifier-delete <the classifier ID>

and I got a new error... what?

BadRequest: FlowClassifier a5b3185a-4d2b-41a0-a54d-5cdea5ae2bed does not set logical source port in ovs driver

I'd looked everywhere for clues but jeez... helpless!!! It turned out that the vnffgd TOSCA syntax has been changed to address the multiple flow classifiers (I'm running devstack master bran…

Automatically renew standalone certificates generated by certbot

To renew a standalone certificate that was generated by certbot you have to stop the service that is running on port 80 or 443 or it will raise this error:

sudo certbot renew

... Problem binding to port 443: Could not bind to IPv4 or IPv6...

For example if I'm running nginx, I have to stop it to renew my certificates:

sudo systemctl stop nginx

But, that means you have to do it manually while certbot already added a crontab to do it periodically. So, do this to fix:

1. Install nginx plugin for certbot

sudo apt install python-certbot-nginx2

2. Modify the crontab

sudo nano /etc/cron.d/certbot

0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew --nginx

How to hide the "Manage databases" link from the Odoo's login link

There is one dangerous setting in Odoo that beginners like me hardly notice: the "Manage databases" link on the login link. Follow that link you will be able to know the database name, create new databases, destroy the current one etc... Even though it may require a master password for all the operations, exposing those functionalities to the public is quite dangerous. Here is how you can hide that link:

1. Edit the odoo's setting:

sudo nano /etc/odoo/odoo.conf

2. Modify this line as follows:

list_db = False

3. Save and restart odoo

sudo systemctl restart odoo

Notes: For those who run odoo in docker, follow these steps instead:

1. Copy the odoo's setting file to the host machine:

docker cp 05829b85c385:/etc/odoo/odoo.conf .

2. Edit the file like above

3. Copy the setting file back to the odoo docker instance:

docker cp odoo.conf 05829b85c385:/etc/odoo/odoo.conf

4. Restart docker instances (including Postgres instance)

sudo systemctl restart odoo

(I made a systemd startup sc…

SystemD startup script for odoo installed using docker

Install odoo using Docker containers is a pretty cool way of deployment. But, there is one missing part of the official manual of odoo is to make a startup script for the containers for easy start/stop the containers. This is it:

1. Create the folder to hold the docker-compose.yml file:

sudo mkdir /odoo

2. Create the docker-compose.yml file in that folder with the following content:

3. Create the startup script:

sudo nano /etc/systemd/system/odoo.service

4. Enable the odoo service for it to start automatically when rebooting:

sudo systemctl enable odoo

5. Start odoo and profit

sudo systemctl start odoo

Snowing in Seoul


How to disable public account registration in Open edX

To disable public account registration in Open edX, add this flag to the Features array in lms.env.json and cms.env.json:


Save and restart the apps:

sudo /edx/bin/supervisorctl restart all

How to create an invitation only or private course in Open edX

To create an "Invitation Only" or private course in Open edX, you can do as following:

1. Create the course in Studio (CMS)

2. Go to Settings >> Advanced Settings

3. Scroll to the "Invitation Only" field, set it to "true"

4. Done.

Rotate pdf file in Ubuntu

To rotate a pdf file (e.g 180 degree) in Ubuntu you can run the following:

$ pdftk input.pdf cat 1south output output.pdf

Resize pdf papersize in ubuntu

To resize the papersize of a pdf file in Ubuntu, you can run this command:

$ pdfjoin infilename.pdf --paper a4paper --fitpaper false --outfile outfilename.pdf