• Sübye şerbeti tarifi

    Kavun çekirdeklerini iyice yıkadıktan sonra güneşte kurumaya bırakılır. İyice kurutulan çekirdekler tekrar ıslatarak nemlendirilir.

    1 su bardağı kavun çekirdeği, yarım su bardağı şekerle yarım saat kadar havanda döğülürerek öğütülür (rondo da aynı işi görür). Öğütme işlemi sonucunda beyaz bir macun oluşur. Oluşan macun 4 bardak suyla karıştırılır ve tülbentten gibi bir süzme materyali aracılığı ile en az 4 kez süzülerek içime hazır hale getirilir.

    İsteğe göre içerisine 2-3 damla gül suyu da koyulabilir. Sübye, hazırlandıktan sonra iyice soğutularak tüketilmeye başlanabilir.

  • Preparing virtual environment for running with apache mod_wsgi & postgresql

    For completing postgresql requirements of virtual environment, install “libpq-dev” and “python-dev” packages, outside of virtual environment.

    $ deactivate (if you are in virtual environment)
    $ sudo apt-get install libpq-dev python-dev

    Re-activate virtual environment and install psycopg2 from pip repo.

    $ pip install psycopg2

    By the way, in the name of  conformist approach install ipython in virtual environment.

    $ pip install ipython

    PostgreSQL engine and python connection libraries are ready.
    Now, lets prepare wsgi file for current project. (I assumed apache and mod_wsgi installed and configured) I’m going to use /var/www/project path for example for environment root in wsgi file.

    ENV_DIR = [‘/var/www/project’]

    import site, os, sys

    base = os.path.dirname(__file__)
    sys.path.insert(0, base)
    sys.path.append(os.path.dirname(base))

    # Remember original path.
    prev_sys_path = list(sys.path)

    # Add each new site-packages directory.

    for directory in ENV_DIR:

    site.addsitedir(directory)

    # For taking new directories to the front reorder path.

    new_sys_path = []
    for item in list(sys.path):

    if item not in prev_sys_path:

    new_sys_path.append(item)
    sys.path.remove(item)

    sys.path[:0] = new_sys_path
    os.environ[‘PYTHON_EGG_CACHE’] = ‘/tmp/project_eggs’
    sys.stdout = sys.stderr
    os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘%s.settings’ % os.path.basename(base)
    from django.core.handlers.wsgi import WSGIHandler
    application = WSGIHandler()

    Place the wsgi file above into root of the django project which created inside of the virtual environment directory (eg. /var/www/project/django/)

    So wsgi file is ready, and we can configure apache to use this wsgi file:

    <VirtualHost *:80>

    WSGIDaemonProcess project_name user=username group=usergroup processes=3 threads=15 inactivity-timeout=120 maximum-requests=50 python-path=/var/www/project/lib/pyton2.7/site-packages
    WSGIProcessGroup project_name
    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptAlias / /var/www/project/django/wsgi
    ServerName project_name.com
    ServerAdmin admin@project_name.com
    CustomLog /var/www/project/django/log/access_log combined
    ErrorLog /var/www/project/django/log/error_log
    Alias /static “/var/www/project/django/static”

    </VirtualHost>

    Save this file under /etc/apace/sites-available as “project.conf”

    Run “$ a2ensite project.conf” command and restart (or reload) the apache service.

    Now you can see the running django installation at “http://www.project_name.com”

  • Installing Django-CMS over Python Virtual Environment on Ubuntu based systems

    Prepare for virtual environment:

    $ sudo apt-get install python-setuptools python-dev build-essential
    $ sudo easy_install pip
    $ sudo pip install virtualenv

    Creating a virtual environment:

    $ virtualenv example_env -p python2.7 –no-site-packages –distribute

    Activating virtual environment:

    $ source example_env/bin/active

    Installing Django and Django-CMS in to virtual environment:

    $ pip install PIL
    $ pip install django-cms

    the command above is also installs those required packages:

    django
    django-mptt
    django-classy-tags
    django-sekizai
    south
    html5lib

    Thats all. Library installation on virtual environment is complete. On the next, how to run django-cms on django with apache…

     

    Note: If you want to exit from virtual environment just type this:

    $ deactivate

  • Webfaction Surprise/Sürprizi…

    Today I’ve got an e-mail form Webfaction. “Today we’re happy to announce that our shared hosting plan has been upgraded from 80MB of app memory to 256MB! This applies not only to new customers but to all existing accounts as well.” they said. It’s been very nice surprise.

    —————————————

    Bu gün Webfaciton’dan bir e-posta aldım. Diyorlar ki “Bu gün mutlulukla duyuruyoruz ki, paylaşımlı barındırma planımızda bulunan 80 MB uygulama belleği 256MB’a yükseltilmiştir! Bu sadece yeni müşteriler için değil, tüm mevcut müşteriler için geçerlidir.” . Çok güzel bir sürpriz oldu.

  • Installing 64Bit Python, iPython environment to Windows Server 2008

    Download latest python installer in to windows server 2008 and install it.
    Download http://peak.telecommunity.com/dist/ez_setup.py from setuptools (http://pypi.python.org/pypi/setuptools) and run with python

    python ez_setup.py

    And after all download ipython source for windows environment (http://archive.ipython.org/release/0.11/ipython-0.11.zip) Extract it and install by the command below:

    python setup.py install

    Thats all….

  • Linux dd komutunun durumunu izlemek

    Aşağıdaki komut ile dd programının PID’i öğrenilir.

    $ pgrep -l ‘^dd$’
    8789 dd
    $

    USR1 sinyali dd programına gönderilir:

    $ kill -USR1 8789
    $
    dd programı sinyali alır almaz o anki istatistikleri ekrana basar ve kaldığı yerden işlemine devam eder.
    Örnek:

    $ dd if=/dev/random of=/dev/null bs=1K count=100
    0+14 records in
    0+14 records out
    204 bytes (204 B) copied, 24.92 seconds, 0.0 kB/s

    Devamlı izleme yapmak için watch komutu ile izleme sağlanabilir. Aşağıdaki komut 10 saniyede bir dd programının istatistik çıktısını basmasını sağlar.

    $ watch -n 10 kill -USR1 8789

  • Pidgin "The certificate for talk.google.com could not be validated." problem

    I’m getting this error recently.

    Therefore, I cahnge the “Connection Security” to “Use old-style SSL” and “Connect Port” to “5223” in pidgin account settings. And it’s done. I’m not get that shitty message anymore…

  • PyCharm & Linux FS Notifier

    Native file system watcher for Linux

    If you’re an IntelliJ user working under Linux you’ve probably seen that boring “Synchronizing files…” spinning icon in a left corner of a status bar. It is there because for an intelligent IDE it is a must to be in the know about any external changes in files it working with – e.g. changes made by VCS, or build tools, or code generators etc. On Windows and Mac OS X native file system watchers used to facilitate this task but on Linux the only option was to recursively scan directory tree. Now you’re welcome to give a try to native file system watcher for Linux.
    Prerequisites
    File system watcher requires inotify(7) facility. It is in mainstream kernel for more than two years (since 2.6.13, and in glibc since 2.4) so chances are your distribution don’t missing it. The sign of inotify availability in a system is a presence of /proc/sys/fs/inotify/ directory.
    Download and setup
    File system watcher is a single binary executable (fsnotifier) and can be downloaded directly from our Git repository. It should be named ‘fsnotifier’, placed into bin/ directory of your IDE and granted execution rights. Inotify requires a “watch handle” to be set for each directory it monitors. Unfortunately, the default limit of watch handles may not be enough for reasonably sized projects (e.g. IntelliJ IDEA sources contain 30000+ directories). The current limit can be verified by executing:

    cat /proc/sys/fs/inotify/max_user_watches

    It can be raised by adding following line to the /etc/sysctl.conf file:

    fs.inotify.max_user_watches = 524288

    … and issuing this command to apply the change:

    sudo sysctl -p

    64-bit systems
    If your system is strictly 64-bit (i.e. doesn’t contains 32-bit runtime libraries in /lib32 directory) you should download 64-bit version here. Rename downloaded file to “fsnotifier”, rest of setup is same.

  • Resolving Tomboy Ubuntu One issue on Mint 11 Katya

    Mint Linux 11 Katya
    Tomboy & Ubuntu One.

    Tomboy notes… You know,.. In this world, people uses for taking notes and take a look at them from any where, who knows this app.. Because it’s online, ermmm… Any way, this app doesn’t needs to be clearifying about what it is…

    Main problem is:
    I installed Mint Linux 11 Katya and I can’t find ubuntu one service in the tomboy options like before…

    Let’s resolve this problem and make me a hero who saved the DAY one:
    Open tomboy notes from “Menu/Accessories”
    Click to “Preferences” in “Edit” menu and tab to “Synchronization”
    Select “Tomboy Web” from “Services” pulldown
    Add “https://one.ubuntu.com/notes/” address to “Server” line
    Click to “Connect to Server” button.

    Now you must sent to “https://login.ubuntu.com/” over your default web browser when clicked to “Connect to Server”
    Take a login to your account by your mail address and passwd, click to “Continue” and wait a moment for logging in.
    Whe you logged in they asks you to add “this” computer connection list. Give a name for your already configuring computer and continue.
    Then you redirected to your computer “http://localhost:8000/” address you had to be saw “Tomboy Web Authorization Successful” page.

    Congrats, you are connected!

    Now you can return to tomboy notes application preferences and click to “Save” button to make everything permanent.
    It’s synchronizing now…. Aaand Voi’la! All your old notes back and everything setted up for re-use.

  • Yarım kalan SCP kopyalamayı devam ettirmek…

    Secure Copy ile dosya kopyalarken bağlantı sorunlarından kopyalamanın yarım kalmasına gıcık olup el mahkum yeniden kopyalamaya başlayıp bir o kadar daha vakit harcayanlardan mısınız? Artık buna mecbur değilsiniz…

    SCP ile yapılan kopyalamalarda genellikle büyük dosya transferleri yurdum internet distabilitesi yüzünden kıç ağrısı olmakta. Bunun çözümü ise RESUMEable scp kopyalaması başlatmaktan geçmekte. Diyeceksiniz ki SCP’nin resume özelliği yok. Evet yok! Ama Rsync ile kullanınca gayet güzel o işi görmekte =)

    Bunun için kopyalam için sadece SCP değil Rsync’le bileştirilmiş bir komut dizisi ile kopyalamalarınız kesintisiz devam edebilir, kesilse bile rsync sayesinde kaldığınız yerden devam edebilirsiniz. Bunun nasıl yapıldığı ise aşağıdaki komutla örneklenmiştir. Kolay gelsin:

    # rsync –partial –progress –rsh=ssh user@host:remote_file local_file

    Uzak sunucudan devastator boyutlarında dosya almak için bunun tam tersi işlem yapmak da mümkün. Sadece kaynak ve hedef adreslerin yerini değiştirmeniz yeterli.