Kategori: Sorunlu Teknoloji

  • Ubuntu sunucuda RAID1 array içindeki bozuk diski bulmak.

    RAID1 sistemdeki diskin bir tanesi bozulduğu zaman izlenecek yöntemler:

    Öncelikli işlem sistem henüz açık iken yedek almaktır. Her zaman yedeğinizi alın! Bu işlem sonucunda sisteminizde oluşabilecek sorunlardan tamamen siz sorumlusunuz. Ben yaptım oldu ancak sizin sistemde de aynı sonucu vermeme olasılığı her zaman vardır ve veri kaybı yaşamanız bu olasılık dahilindedir. Bu yüzden bu adımları uygularken yaşayacağını hiçbir kayıptan ben sorumlu değilim. 🙂

    Canlı sistemin yedeğini aldıktan sonra bozuk diskin hangisi olduğunu bilmiyorsanız öncelikle bunu tespit etmemiz gerekir.

    Sistemde root kullanıcı haklarına nail olup (# sudo -s) /var/log/ altındaki messages log dosyasının içine bakarak bozuk diskin hangisi olduğunu anlayabiliriz. Örnek olarak benim messages dosyasının içeriğini aşağıya ekledim:

    kernel: [ 540.541685] ata3.00: configured for UDMA/133
    kernel: [ 540.541698] sd 2:0:0:0: [sda] Unhandled sense code
    kernel: [ 540.541701] sd 2:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    kernel: [ 540.541704] sd 2:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]
    kernel: [ 540.541709] Descriptor sense data with sense descriptors (in hex):
    kernel: [ 540.541711] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
    kernel: [ 540.541721] 00 40 3b 8b
    kernel: [ 540.541725] sd 2:0:0:0: [sda] Add. Sense: Unrecovered read error – auto reallocate failed
    kernel: [ 540.541730] sd 2:0:0:0: [sda] CDB: Read(10): 28 00 00 40 3b 8b 00 00 03 00
    kernel: [ 540.541981] ata3: EH complete

    Yukarıda görüldüğü üzere “sd 2:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]” ve “sd 2:0:0:0: [sda] Add. Sense: Unrecovered read error – auto reallocate failed” satırları “sda” olarak bağlanmış olan diskte “medya hatası” ve “kurtarılamayan okuma hatası” hatası olduğunu söylemekte.

    Eğer sda diskin kasanın içindeki hangi disk olduğu konusunda bir fikriniz yoksa sistemi kapatıp disk sökmeye başlamadan önce hangi diski sökmeniz gerektiğini diskin seri numarasına bakarak şu şekilde bulabilirsiniz:

    # hdparm -i /dev/sda | grep SerialNo
    Model=SAMSUNG HD753LJ, FwRev=1AA01118, SerialNo=S13UJ90SXXXXXX

    İkinci olarak şu yöntem ile de seri numarasını bulabilirsiniz:

    # /sbin/udevadm info –query=property –name=sda | grep ID_SERIAL
    ID_SERIAL=SAMSUNG_HD753LJ_S13UJ90SXXXXXX
    ID_SERIAL_SHORT=S13UJ90SXXXXXX

    Eğer S.M.A.R.T. verilerini okumayı biliyorsanız mevcut RAID1 yapısındaki iki diskin S.M.A.R.T. verilerine bakarak hangi diskin bozuk olduğunu ve seri numarasını bulabilirsiniz.

    # smartctl -x /dev/sda

    Bu komut çıktısı çok uzun olduğu ve ekstra açıklamalar gerektiği için yazıyı daha uzatmamak adına buraya eklemiyorum. S.M.A.R.T. verisi nasıl okunur bunu başka bir konuda işleyeceğiz.

    Hangi diski sökmemiz gerektiğini öğrendiğimize göre artık sistemi kapatıp doğru diski değiştirebiliriz. Diski değiştirdikten sonra sistemi tekrar yükleyip RAID array’i yapılandırma işine girişeceğiz.

  • Defining Motherboard, CPU and BIOS info in Linux terminal

    In this article, I’m going to explain how to read motherboard, cpu and bios information under linux terminal.

    Reading Motherboard Information:

    # sudo dmidecode -t 2

     

    Reading Motherboard Serial Number:

    # sudo dmidecode -t 2 | grep Serial

     

    And OEM Information:

    # sudo dmidecode -t 11

    (daha&helliip;)

  • Migrating WLM contacts to another account…

    That is not easy to migrate contacts to another account. Almost painful to figuring out how to do it, because of live.com gui and MS law. If your contact list larger than 70 contacts your migration takes a long as contacts count/70 days. According to MS law you can send invitation  to 70 persons per day. I can’t find any way to migrate whole contacts in one basic step. But, I can show you how you can migrate your contacts as quick as possible without lost in live.com account menus.

     

    Now lets login to your account where contact list available in.

    Then went to “Messenger” with your mouse on top of the screen. That move opens Messenger Menu and click on “Contacts”.

    Now move on to “Manage” to open Manage Menu then click “Export”. Save the file to your computer, and log out from this account.

     

    It’s time to log in new account. When you logged in repeat the moves above until Manage Menu opens. On Manage Menu click “Import”. When you click import live.com redirect you to another page.

    Now click on “Another Windows Live account” under “Add people from.

  • “Yeniden” Merhaba dünya!

    blacole/js virüs saldırısının ardından siteyi kökten temizleyip yeniden kurmaya karar verdim ve işte buradayım. Yeniden aranızdayım…

  • 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…