Archive for February 19th, 2010

19
Feb

Python ile basit bir html form generator (üreteç)

   Posted by: İsmail ÇAKIR    in python


import sys
import 

tablename = ""
mhost = ""
muser = ""
mpasswd = ""
mdb= ""

def head():
    head = """
    <><head>
    <style>
    .minput {
        border: 1px solid #fdfcf7;
        font-family: "Times New Roman", Times, serif;
        font-style: bold;
        font-size: 14px;
        color: #454743;
    }

    .mlabel {
        font-family: "Times New Roman", Times, serif;
        font-style: bold;
        font-size: 13px;
        color: #e7363e;
    }
    </style></head><body>< action="" method="post">
    """
    return head

def sub():
    sub = """
        </form></body></html>
    
    """
    return sub

def insert():
    pass

def update():
    pass

def input(name, label = None):
    if not label:
        label = name
    return ‘<label style="mlabel">%s:</label><input style="minput" name="%s" type=text />’ % (label, name)

def clean(mrow):
    pass

def deneme():
    try:
        conn = MySQLdb.connect (host = mhost, user = muser, passwd = mpasswd, db = mdb)
        cursor = conn.cursor ()
        msql = ‘select column_name from information_schema.columns where table_name="%s"’ % tablename
        cursor.execute (msql)
    except MySQLdb.Error, e:
        print "Error %d: %s" % (e.args[0], e.args[1])
        sys.exit (1)

    row = cursor.fetchall ()
    print head()
    for  r in range(len(row)):
        print input("".join(row[r]))
    print sub()
    cursor.close ()
    conn.close ()

if __name__ == "__main__" :
    deneme()

Bookmark and Share
Tags: , , , , , , ,

Tags: , , , , , , ,

19
Feb

zip ve jar dosyalar içinde arama

   Posted by: İsmail ÇAKIR    in python


import zipfile
import os

aranan = "deneme.class"

def yuru(param, dizin, dosyalar):
    global aranan
    for dosya in dosyalar:
        if dosya.endswith(".") or dosya.endswith("."):
            zp = zipfile.ZipFile(os.path.join(dizin, dosya), "r")
            for name in zp.namelist():
                if name.endswith(aranan):
                    print os.path.join(dizin, dosya), ":", name
        if dosya.endswith(aranan):
            print os.path.join(dizin, dosya)

os.path.walk(".", yuru, None)

Bookmark and Share
Tags: , , , ,

Tags: , , , ,

19
Feb

java tarih formatlama (SimpleDateFormat)

   Posted by: Muhammed YÜRÜRDURMAZ    in Yazılım

import .text.;
import .util.;

public class JavaSimpleDateFormatOrnek{
  public static void main(String args[]){
   date = new ();
  SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
  System.out.println("Bu gün " + sdf.format() );
  }
}
Bookmark and Share
Tags: , , , ,

Tags: , , , ,

İlla repo daki versiyonu deil de son versiyonu kullanmak istiyorsanız;

http://downloads.sourceforge.net/project/remmina/0.7/remmina-0.7.4.tar.gz?use_mirror=heanet adresinden source dosyasını indiriyoruz.

automake, gtk, glib kurulu olduğunuz farzedersek. diğer ihtiyaç duyacağımız paketleri indiriyoruz.

sudo apt-get install libavahi-ui-dev libvte-dev libunique-dev

burda karmicle gelen -3 işimizi görmüyor.

http://www.libssh.org/files/libssh-0.4.1.tar.gz adresinden libssh in son versiyonunu çekiyoruz.

daha sonra adım adım

tar -zxvf libssh-0.4.1.tar.gz

ile hazırlandığı için

sudo apt-get install cmake

dizine geçiyoruz.

cd libssh-0.4.1

cmake bir build dizinine ihtiyaç duyar.

mkdir build

şimdi libssh-4 kütüphanemizi derleyip kuruyoruz.

cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..

sudo make install

şimdi dizinine dönelim

./configure
make
sudo make install

komutlarını veriyoruz sırayla. Remmina ssh tünelleme desteği ile sistemimize kuruluyor.

Bookmark and Share
Tags: , , , , ,

Tags: , , , , ,

19
Feb

remmina uzak masaüstü yönetim aracı

   Posted by: Muhammed YÜRÜRDURMAZ    in Linux

üzerinde kullanabileceğiniz güzel bir uzak bağlantı yönetim aracıdır

gtk+ ile yazıldığı için ve ile sorunsuz çalışmaktadır ve desteği bulunmaktadır.

desteklediği uzak bağlantı şekilleri şu anda , , ve SSH()

debian tabanlı (ubuntu da dahil) sistemlerde kurmak için

aptitude install remmina

gnome appleti için

aptitude install remmina-gnome

xfce appleti için

aptitude install remmina-xfce

vgrup ekibi olarak yazılım türkçeleştirme işini de tamamlamış durumdayız.

herkese bol uzak bağlantı dileklerimle :D

Bookmark and Share
Tags: , , , , , , , , , ,

Tags: , , , , , , , , , ,

Switch to our mobile site