Friday, September 10, 2010

Playing with Django 0.96 - Class Meta & Class Admin

>>> for m in ModelName._meta.__dict__:
...       m
...
'unique_together'
'order_with_respect_to'
'installed'
'auto_field'
'has_auto_field'
'many_to_many'
'ordering'
'one_to_one_field'
'object_name'
'parents'
'db_tablespace'
'pk'
'verbose_name'
'get_latest_by'
'db_table'
'permissions'
'admin'
'fields'
'verbose_name_plural'
'app_label'
'module_name'
'aka'



>>> for m in ModelName._meta.admin.__dict__:
...       m
...
'list_select_related'
'save_as'
'save_on_top'
'list_per_page'
'ordering'
'fields'
'list_display'
'search_fields'
'js'
'date_hierarchy'
'list_filter'
'list_display_links'
'manager'


... Class Admin:
...       list_select_related = True
...       list_per_page = 20
...       manager = MyAdminManager()


Class MyAdminManager(models.Manager):
...       def get_query_set(self):
...             query_set = super(MyAdminManager, self).get_query_set().filter(id__gte=5)
...       return query_set

Thursday, July 22, 2010

Avidemux : Crossplatform free video editor

Avidemux is crossplatform free video editor.
Split, cut and remove the unwanted scenes, join or convert your video files without any hassle.

Download links:

http://download.cnet.com/Avidemux/3000-13631_4-10829933.html
http://fixounet.free.fr/avidemux/

Friday, June 25, 2010

Fan speed control of a Dell PC in Linux Distrubition

1. Install gkrellm application from the package manager or the link below:
http://linuxappfinder.com/package/gkrellm

2. Install gkrellm-i8k or i8kutils plugins:
Here the links for download, you can also search them from your package manager:
* Debian package - gkrellm-i8k_2.5-1_i386.deb
http://packages.debian.org/lenny/i386/gkrellm-i8k/download
* Red Hat package - i8kutils-1.25-16.i586.rpm
http://fr.rpmfind.net/linux/rpm2html/search.php?query=i8krellm.so

3. Then try following:
Type in terminal sudo modprobe i8k force=1
Edit /etc/modulesand add i8k force=1 to the end of the file.
Another way if /etc/modules does not exist is editing the file /etc/rc.local and adding modprobe i8k force=1

You may also need to configure your GKrellM application for Dell I8K Plugin.

Saturday, March 21, 2009

Saturday, March 14, 2009

Some linux stuff

httpd.conf
/etc/apache2/httpd.conf

crontab usage

crontab [-u user] file
crontab [-u user] { -e | -l | -r }
(default operation is replace, per 1003.2)
-e (edit user's crontab)
-l (list user's crontab)
-r (delete user's crontab)
-i (prompt before deleting user's crontab)


visudo

List of who can run what
/etc/sudoers

Lock file for visudo
/etc/sudoers.tmp

Sunday, March 1, 2009

HTML - How to display Turkish characters?


LATIN SMALL LETTER C WITH CEDILLA = ç ==> ç

LATIN CAPITAL LETTER C WITH CEDILLA = Ç ==> Ç

LATIN SMALL LETTER G WITH BREVE = ğ ==> ğ

LATIN CAPITAL LETTER G WITH BREVE = Ğ ==> Ğ

LATIN SMALL LETTER I DOTLESS = ı ==> ı

LATIN CAPITAL LETTER I WITH DOT ABOVE = İ ==> İ

LATIN SMALL LETTER O WITH DIARESIS= ö ==> ö

LATIN CAPITAL LETTER O WITH DIARESIS = Ö ==> Ö

LATIN SMALL LETTER S WITH CEDILLA = ş ==> ş

LATIN CAPITAL LETTER S WITH CEDILLA = Ş ==> Ş

LATIN SMALL LETTER U WITH DIARESIS= ü ==> ü

LATIN CAPITAL LETTER U WITH DIARESIS = Ü ==> Ü