Skip to main content

Posts

Showing posts with the label download

Install Docker under Ubuntu 14.04 (Trusty)

Docker supports Ubuntu versions: Ubuntu Vivid 15.04 (64-bit) Ubuntu Trusty 14.04 (LTS) (64-bit) Ubuntu Precise 12.04 (LTS) (64-bit) Ubuntu Raring 13.04 and Saucy 13.10 (64 bit)  For both Vivid and Trusty you need nothing. It will work out of the box. Others will require some modifications. (Updating of some things, like kernel or installing with wget on 13.04) 1. To install docker from a repository do so: sudo apt - get update sudo apt - get install docker . io sudo ln - sf / usr / bin / docker . io / usr / local / bin / docker sudo sed - i '$acomplete -F _docker docker' / etc / bash_completion . d / docker . io 2. Now run it with: sudo apt - get install lxc - docker 3. Make it run on system boot: sudo update - rc . d docker . io defaults 4. Ready to go! Run container with an Ubuntu: sudo docker run - i - t ubuntu / bin / bash To disconnect, or detach, from the shell without exiting use the escape sequence Ctrl-p + Ctrl-q . 

SSH Unix/Lunux Recipes for daily usage.

I've decided to create a post with several recipes for commands I need to use daily. I use them from a Mac OS X Lion default console, except for some mac ports installed... Remote is special linux distribution. How do I Compress a Whole Linux or UNIX Directory?  You need to use tar command as follows (syntax of tar command): tar -zcvf archive-name.tar.gz directory-name Where, -z: Compress archive using gzip program -c: Create archive -v: Verbose i.e display progress while creating archive -f: Archive File name For example, you have directory called /home/garmoncheg/data and you would like to compress this directory then you can type tar command as follows: $ tar - zcvf data . tar . gz / home / garmoncheg / data / Above command will create an archive file called data.tar.gz in current directory. If you wish to restore your archive then you need to use following command (it will extract all files in current directory): $ tar - zxvf data . tar . gz Whe...

Django: Installing Eclipse and PyDev for django

In most common cases of programming Django with Eclipse are that Django is installed in system, like Python. I dislike this method, because it makes confusions for beginners. What Django version I'm in. Why did I download an app "X" and added an Eclipse project. Everything seems to be fine, but I cant install proper dependencies... So it's not a secret. Managing Django distributions is a hard work for junior developer. Let's try to make their work simpler, by this article. I'll try to show you the right way to install Django environment on Eclipse. 1. First of all let's install Eclipse from official site . I chose "Eclipse IDE for JavaScript Web Developers". Mac 32bit version, because I'm using this OS type. Any other distributive will work just fine, I think. 2. Unpack downloaded archive into some dir. It will be installation directory of the eclipse. Usually it doesn't mater where it is stored. So I used "/Users/garmoncheg/De...

Django: add image in an ImageField from image url

Today I had experience with django file downloads from an specified url into Django model FileField. I'm writing content grabber from Flickr. I didn't find information about it and decided to write what I've discovered so far in example. Stackoverflow helped me a bit. But answer proposed there had not worked. So this is code example how to workout this issue: because code worth a thousand words :) We have a model with one field: #models.py class Photo ( models . Model ):     image = models . ImageField ( 'Label' , upload_to = 'path/' ) We need to create a photo from image url and save it to the model's FileField. #somewhere in views.py # usually in header imports from urlparse import urlparse import urllib2 from django . core . files import File   #add imprt of content file wrapper from django . core . files . base import ContentFile # somewhere: for e.g. in view handling the file operations photo = Photo () img_url =...