Debian 6 ‘dan 7 ‘ye Guncelleme
vim /etc/apt/source.lists dosyasi asagidaki gibi duzenlenir.
deb http://mirrors.kernel.org/debian/ wheezy main
deb-src http://mirrors.kernel.org/debian/ wheezy main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
deb http://mirrors.kernel.org/debian/ wheezy-updates main
deb-src http://mirrors.kernel.org/debian/ wheezy-updates main
apt-get update
# komutu ile guncellenir
apt-get upgrade && apt-get dist-upgrade
# islemi ile guncelleme yapilir.
Paket yuklenmeleri ve guncellemeleri bittikten sonra shutdown
-r now komutu ile sistem yeniden baslatilir.
cat /etc/debian_version ciktisi ile Debian surumunu kontrol edebilirsiniz.
veya
lsb_release -r komutuyla.
Not: Mesuliyet kabul edilmez 🙂
Sevgiler.
Xen ‘de Usb ve Cd-rom baglamak (mount islemi)
Kullanimi :
xm block-attach sanalin_ismi_veya_ID phy:xen_ustunde_gozuken_aygit sanalda_gozukecek_aygit mod
xm list ciktisiyla sanallastirmalari gorebilirsiniz ve aygit_id ‘sini gorebilirsiniz.
Ornek:
#usb aygit icin
xm block-attach 1 phy:/dev/sdb xvdb r
#Cd-Dvd rom icin
xm block-attach 1 phy:/dev/dvd hda:cdrom r
sed icinde degisken cagirma
Misal asagidaki kod parcaciklarini inceleyebilirsiniz.
cat salla.txt| egrep “Jan 0$i” | sed “s/Jan 0$i/2013-01-0$i/g”
Tek tirnak yerine cift tirnak kullandik.
Sevgiler.
awk ile tek tirnak kacirma (single quote in awk)
Olurya bir gun awk icinde mysql girdi islemi yapmak zorunda kalirsaniz diye buraya yazayim dedim. Asagida ki ornek referans olabilir.
awk icinde tek tikrnak kacirma “‘\”” $2 “‘\””
cat logins_ | awk ‘{print “INSERT INTO `mail_log`.`login` (`logins_id`, `logins_date`, `logins_type`, `logins_email`, `logins_last`) VALUES (NULL, ” “‘\”” $2 ” ” $1 “‘\”””,” “‘\”” $4 “‘\”””,” “‘\”” $7 “‘\”””,” “NULL””);” }’
mysql ‘de innodb ‘yi aktif etme
Merhabalar,
Ilk once innodb aktif edilmis mi ? yoksa edilmemis mi ? ona bakalim. show engines; ciktisinda InnoDB Support ‘ta NO ibaresi yer aliyorsa innodb ‘yi aktif etmemiz gerekmektedir.
mysql -uroot -p
mysql> show engines;
+————+———+—————————————————————-+————–+——+————+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+————+———+—————————————————————-+————–+——+————+
| InnoDB | NO | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
+————+———+—————————————————————-+————–+——+————+
8 rows in set (0.02 sec)mysql>
my.cnf dosyasini bir metin duzenleyici ile acalim. (vi,nano,pico etc.)
vim /etc/mysql/my.cnf
skip-innodb satirini bulup asagidaki gibi basina # isaretini ekleyelim.
#skip-innodb
/etc/init.d/mysql restart
eger halen innodb aktif olarak gozukmuyorsa yapmaniz gereken son birsey daha vardir.
cd /var/lib/mysql/
mv ibdata1 /tmp/
mv ib_logfile0 ib_logfile1 /tmp/
simdi tekrardan /etc/init.d/mysql restart edelim ve mysql -uroot -p ile giris yaptiktan sonra show engines; komutunu calistiralim. Ornek bir show engines ciktisi.
root@gw:~# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11494
Server version: 5.1.66-0+squeeze1 (Debian)Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> show engines;
+————+———+—————————————————————-+————–+——+————+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+————+———+—————————————————————-+————–+——+————+
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
+————+———+—————————————————————-+————–+——+————+
8 rows in set (0.02 sec)mysql>
Sevgiler
[Cacti] ERROR: opening ‘/usr/share/cacti/site/rra/localhost_mem_buffers_3.rrd’: No such file or directory
Cacti ‘de eger grafikleriniz olusmuyorsa asagidaki komut sayesinde olusturabilirsiniz.
# cacti hangi dizindeyse icine girelim
cd /usr/share/cacti/site/
# asagidaki komut calistiralim
php -q poller.php –force
simdi grafikleriniz olusturulmustur.
Sevgiler.
Idle ‘i nasil Python3 ile calistirabilirim ?
Biliyorsunuz ki ubuntu,debian ‘da idle python2.7 uzerinde calisiyor, peki bunu 3.2 ustunde nasil calistirabiliriz.
python paketleri kurulur
apt-get install python3 python3-tk
son olarak binary dosyasi degistirilir.
vim /usr/bin/idle
#! /usr/bin/python satiri #! /usr/bin/python3.2 olarak degistirilir.
Sevgiler.
Debian ustunde Tomcat Nasil Kurulur ?
TOMCAT KURULUMU
apt-get install openjdk-6-jdk
apt-get install sun-java6-jdk
apt-get install tomcat6 tomcat6-admin tomcat6-docs tomcat6-examples
kurulumlar bittikten sonra vim /etc/tomcat6/tomcat-users.xml dosyasina girilip <tomcat-users></tomcat-users> taglari arasina asagidaki parametreler eklenir. Bu parametreler “Tomcat Web Application Manager” giris bilgileridir.
<role rolename=”manager”/>
<user username=”murat” password=”murat123″ roles=”manager”/>
/etc/init.d/tomcat6 restart ile yeniden baslatilir.
Not: Tomcat ‘in calisip calismadigini asagidaki komutlarla kontrol edebilirsiniz.
netstat -an | grep 8080
ps -aux | grep tomcat
pyzor: got response: No servers available! Maybe try the ‘discover’ command
Eger pyzor boyle bir hata donduruyorsa servers dosyasiniz bos veya “pyzor discover” komutu calistirilmamis demektir. Eger calistirmissaniz ve hala boyle bir hata aliyorsaniz bir sekilde servers dosyasina veri yazilamamistir. Yazamadiysa bizde elle yazariz 😛 (servers dosyasinin yerini yine log’lardan bulabiliriz, benimkisi /etc/spamassassin/servers altindaymis.)
Cozum;
vim /etc/spamassassin/servers icine public.pyzor.org:24441 satirini eklemekle problem cozulmus oluyor.
Log’lar
Jan 24 12:25:01 msg amavis[19876]: (19876-02) SA dbg: pyzor: got response: No servers available! Maybe try the ‘discover’ command
Jan 24 12:25:01 msg amavis[19876]: (19876-02) SA dbg: pyzor: failure to parse response “No servers available! Maybe try the ‘discover’ command”
Jan 24 12:16:53 msg amavis[19871]: SA dbg: pyzor: got response: Traceback (most recent call last):\\n File “/usr/bin/pyzor”, line 8, in <module>\\n pyzor.client.run()\\n File “/usr/lib/pymodules/python2.5/pyzor/client.py”, line 1022, in run\\n ExecCall().run()\\n File “/usr/lib/pymodules/python2.5/pyzor/client.py”, line 189, in run\\n self.servers = self.get_servers(servers_fn)\\n File “/usr/lib/pymodules/python2.5/pyzor/client.py”, line 422, in get_servers\\n servers.read(open(servers_fn))\\nIOError: [Errno 13] Permission denied: ‘/etc/spamassassin/servers‘
DeprecationWarning: the sha module is deprecated; use the hashlib module instead”
Eger asagidaki gibi hatalar aliyorsaniz yapmaniz gereken sisteminize python 2.5 yuklemek ve yine asagidaki degisikligi yapmaniz gerekmektedir.
hatalar;
SA dbg: pyzor: failure to parse response “/usr/lib/pymodules/python2.6/pyzor/__init__.py:11: DeprecationWarning: the sha module is deprecated; use the hashlib module instead”
SA dbg: pyzor: failure to parse response “/usr/lib/pymodules/python2.6/pyzor/client.py:12: DeprecationWarning: the multifile module has been deprecated since Python 2.5
yapilmasi gereken;
apt-get install python2.5 python2.5-dev python2.5-minimal
vim /usr/bin/pyzor
satirini
#!/usr/bin/python
asagidaki sekilde degistirelim
#!/usr/bin/python2.5
Sistemde python 2.6 yuklu oldugu icin ve calistirmak istedigi icin bu hatayi aliyorsunuz.
Sevgiler.