Saturday, November 14, 2015

'Missing' Python 3 Package After Installation using pip3 in Ubuntu 15.10

I am working on a project related to Google Maps, and interested to use polyline package. My system is Ubuntu 15.10 (just recently upgraded). And as usual, I use pip3 to do the job:

root@Kirana:/usr/lib/python3/dist-packages# pip3 install polyline
Downloading/unpacking polyline
  Downloading polyline-1.1.tar.gz
  Running setup.py (path:/tmp/pip-build-l9ch5_49/polyline/setup.py) egg_info for package polyline
    
Requirement already satisfied (use --upgrade to upgrade): six==1.8.0 in /usr/local/lib/python3.5/dist-packages (from polyline)
Installing collected packages: polyline
  Running setup.py install for polyline
    
Successfully installed polyline
Cleaning up...


Thursday, November 5, 2015

Virtual Environment in Python: virtualenv, pyenv, venv?

As you might already know, virtual environment is a nice way to create isolated environment needed for our project from the Python main installation. In this way, we can keep our main installation clean and not bloated with unused packages after the project concluded.

However, it is a little bit confusing  on what is the better way to create the virtual environment. Based on my research, at least three words come out: virtualenv, pyenv, and venv. What are they, and which one should I use?

Monday, June 9, 2014

How to Setup and Use Github on Ubuntu

Good resource:
http://www.ubuntumanual.org/posts/393/how-to-setup-and-use-github-in-ubuntu

Wednesday, May 21, 2014

Learning Virtualenv in Python

Good references:
1. http://simononsoftware.com/virtualenv-tutorial/
2. http://iamzed.com/2009/05/07/a-primer-on-virtualenv/

about virtualenvwrapper:
http://blog.fruiapps.com/2012/06/An-introductory-tutorial-to-python-virtualenv-and-virtualenvwrapper

Wednesday, May 7, 2014

Eclipse: Syntax Error, parameterized types are only if source level is 1.5

When I developed my Java application, the following error occured:
Syntax Error, parameterized types are only if source level is 1.5 blabla

After digging around in Google, it seems that we have to change the default configuration of Java compiler for our project. It has been discussed in StackOverflow.com, and I found that post from VigneshKumar S precisely answered my problem.

So, what should we do? here what he says

  1. Go to project properties
  2. Then 'Java Compiler' -> Check the box ('Enable project specific settings')
  3. If 'use compliance from execution blabla' is checked, uncheck it first. Then, check the 'use default compliance settings'
  4. Change the compiler compliance level to '5.0' & click OK.
  5. Rebuild your project
Then, the error will disappear.

Tuesday, November 26, 2013

Automatically Select Fastest Servers for apt in Ubuntu

Using GUI-based Ubuntu, it is very easy to select the fastest (or change, in general) mirror servers for apt purposes. All you need to do is just select  System|Administration|Software Sources.

But things get ugly if you want to do it on command-line. You have to update sources.lists manually. That is a tiresome job, and not cool either :D

Well, other people have thought about the same problem and they have been working solutions for this. There is a package named after netselect-apt. It allows you to update the fastest apt server automatically, via command-line.

But, there is another way, and it is easier. All you have to do is adding these lines at the top of your sources.list (assuming you are using Ubuntu 12.04):

deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse


That is it. You need to perform 'apt-get update' first, and then 'apt-get upgrade'. Notice that the server used is the fastest one (relative to your location).

Wednesday, November 13, 2013

Named: error (broken trust chain)

My DNS server keeps complaining similar to this:
error (broken trust chain) resolving '0.ubuntu.pool.ntp.org/AAAA/IN': 208.67.220.220#53
Having researched on Google, many people suggested that the problem lies on the time accuracy. Therefore, we need to update the clock.

I had updated my system using ntpdate. But bind9 error logs didn't change.

After taking few times tinkering about his weird problem, I was stumbled upon a mailing list discussion about dnssec. It was an old discussion. There was a bug in the bind version (then) which produced similar error output if configured as forwarder.

I immediately changed my named.conf.options, from the following:
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

to this one:
dnssec-enable no;
dnssec-validation no;

after I restarted the bind9 service (I am using Ubuntu 12.04):
service bind9 restart

finally, business went normal again!

I haven't dug deep about this issue. Once I figure out the problem, I'll update this post.