Saturday, May 16, 2009

Installing lxml and easy_install on Windows

First: install easy_install...
download *.exe from here
and install it
... now easy_install script should be in your Python\Scripts directory

Second: install lxml

(some_path_to_python\Scripts directory)easy_install.exe lxml


DONE.

easy, isn't it?

develway.pl add this news to develway

Wednesday, May 13, 2009

Eclipse's plugins that I use

For me... three plugins for eclipse is enough...
  1. subclipse for SVN
  2. pydev for python development
  3. aptana for all html/xhtml/js code
subclipse and pydev are required for me.
aptana is optional (consumes a lot of memory)

develway.pl add this news to develway

Eclipse + Subclipse + SVN SSH

Download and run eclipse

Help -> Software Updates -> Available Software -> Add Site

put http://subclipse.tigris.org/update_1.4.x in input field

check two checkboxes:
  1. Subclipse

  2. SVNkit Adapter (Important, the default JavaHL adapter doesn't support SSH and public key authentication)


accept everything and install it

now we can easily checkout our project

Right click in explorer -> New -> Project

SVN folder -> Checkout projects from SVN -> Next -> Create a new repository location

Enter the location of the project you’re checking out e.g.
svn+ssh://example.com/my_repo/

Press Next

Enter SSH credentials.
next, next, next... and ready.

based on this tutorial

Labels: , ,

develway.pl add this news to develway

Build Django+MySQL+PIL on Windows

How to build django on windows? Now I know.... it's really possible.


  1. download python for windows from here and install it

  2. download python-mysql and install it

  3. download django, unpack it

  4. Start -> Run -> cmd

  5. cd Djano-xxx

  6. setup.py install

  7. download PIL from here and install it

  8. Start -> Run -> cmd

  9. go to our django project's directory and manage.py runserver 8080

  10. READY! now check your project by http://localhost:8080

Labels: , ,

develway.pl add this news to develway

Pylons :: how to build environment :: Ubuntu

Few days ago I was fighting with new pylons, now it's a time to describe how I built my new environment...


cd /mnt/
mkdir python2.5-env
cd /python2.5-env/
mkdir project
cd project
easy_install-2.5 virtualenv
sudo easy_install-2.5 virtualenv
virtualenv --no-site-packages --clear .
/mnt/python2.5-env/project/bin/easy_install pylons
/mnt/python2.5-env/project/bin/easy_install -U pylons


and sqlalchemy

/mnt/python2.5-env/project/bin/easy_install -U sqlalchemy


and mysql

/mnt/python2.5-env/project/bin/easy_install mysql-python


That's all!


now we just need to run our application:

/mnt/python2.5-env/project/bin/paster serve --reload some_config_file.ini

Labels: , , ,

develway.pl add this news to develway

Recursive delete files/folders :: linux

For directories (in this example we want to delete directory '.svn')...

find /some_path -type d -name ".svn" -exec rm -rf {} \;


for files (in this example we want to delete file 'file.exe')...

find /some_path -type f -name "file.exe" -exec rm -rf {} \;

Labels:

develway.pl add this news to develway

Change string in multiple files :: linux

Just type a command...

grep -rl old_string . | sort -u | xargs perl -pi~ -e 's/old_string/new_string/'

Labels:

develway.pl add this news to develway

Video files with Google Picasa app on Linux

Firstival... Linux's Google Picasa app can't manage video files (what a shame...)

But we can always find some kind of solution...

  1. run VirtualBox
  2. add files to your windows machine
  3. install google picasa app for windows
  4. upload/manage your video files
  5. the end.

Labels: , , ,

develway.pl add this news to develway

VirtualBox and shared files/directories

VirtualBox is really great!
You don't need any apps like ie4linux/photoshop on wine anymore.


You can just run your 'windows machine' on linux.

http://www.virtualbox.org/

And what about coping files/directories between linux-windows machine on virtualbox?

It's not so hard...

  1. install VBoxGuestAdditions
  2. run windows machine in virtualbox
  3. in bottom right corner there as an icon for shared folders, click on it (right button)
  4. add folder you want to share -> OK
  5. open any directory in windows
  6. Tools -> Map Network Drive
  7. click on 'browse' and find 'VirtualBox Shared Folders'... click twice on it/right-click and 'open'
  8. now you can make a shortcut or just manage your linux's folders from windows machine
  9. the end.

Labels: , ,

develway.pl add this news to develway

Tuesday, May 5, 2009

Check space on device :: Linux

If you want to check available space using linux's console...

check space on device:

df -h


check size of a directory and files in this directory:

du -h


check size of a directory and files in this directory (sum of these sizes):

du -sh

develway.pl add this news to develway

Monday, May 4, 2009

Quoted-Printable in python :: properly encoding in VCards

Can't encode VCard's special chars (regional chars) to UTF-8 in python?

That's easy...

import quopri


and...

quopri.decodestring()

or

quopri.encodestring()



more informations about quopri

Labels: , , , ,

develway.pl add this news to develway