Thursday, April 30, 2015

Linux sunucuda ekstra swap (takas) alani olusturma

Platform:
# cat /etc/issue
Oracle Linux Server release 6.5
Kernel \r on an \m
# uname -a
Linux server 2.6.32-504.1.3.el6.x86_64 #1 SMP Tue Nov 11 17:57:25 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

32G swap alanı oluşturmak için;

# dd if=/dev/zero of=/swapfile bs=1024 count=32553600
# mkswap /swapfile
# swapon /swapfile

swap alanının açılışta otomatik mount olması için /etc/fstab 'e eklenen satır;

/swapfile               swap                    swap    defaults        0 0

Wednesday, April 29, 2015

Oracle: OSWatcher Black Box

Oracle OSWatcher Black Box (OSWbb) collects and archives operating system and network metrics that you can use to diagnose performance issues. OSWbb operates as a set of background processes on the server and gathers data on a regular basis, invoking such Unix utilities as vmstatnetstatiostat, and top.

http://docs.oracle.com/cd/E37670_01/E37355/html/ol_oswatcher_diag.html

OS watcher data file larini grafik arayuzde goruntuleme islemi:

https://www.youtube.com/watch?v=s4-es4gVVUU

Friday, April 24, 2015

The "make" Command and "Makefiles"

A makefile consists of a set of dependencies and rules. A dependency has a target (a file to be created) and a set of source files upon which it is dependent. The rules describe how to create the target from the dependent files. Typically, the target is a single executable file.

...

https://www.hackerearth.com/notes/the-make-command-and-makefiles/  (details)

Wednesday, April 15, 2015

Set file format of the output capture file (.pcap)

editcap - Edit and/or translate the format of capture files
Editcap is a program that reads some or all of the captured packets from the infile, optionally converts them in various ways and writes the resulting packets to the capture outfile (or outfiles).


örnek:

# editcap -F libpcap radius_00002_20150324120131.pcap  rad2.pcap

Friday, April 10, 2015

Linux: IPv6 deaktif hale getirme

sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.lo.disable_ipv6=1

Tuesday, March 17, 2015

Friday, March 6, 2015

bash call for disk usage tests

Aşağıdaki komut çağrısı 70 adet 1G büyüklüğünde dosya yaratacaktır. Disk doluluk test ortamı yaratmak için kullanılabilir.

linux-shell $ for i in {1..70}; do
         dd if=/dev/zero of=testfile.$i bs=1G count=1
         echo "testfile.$i created"
done

Tuesday, February 24, 2015

How to extract the contents of an RPM File

# rpm2cpio kmod-staging-3.8.11-200.fc18.x86_64-3.8.1-3.fc18.7.x86_64.rpm | cpio -idmv

Friday, February 6, 2015

bind9: socket: file descriptor exceeds limit (4096/4096) hatası

/var/log/messages 'a yansıyan hata mesajı:

Feb  6 09:05:11 bns2 named[9720]: socket: file descriptor exceeds limit (4096/4096)

Çözüm:

named'i çalıştırdığımız komuta "-S 8096" argümanı eklendi.

Çalışan komut:

# pgrep -f named | xargs ps
  PID TTY      STAT   TIME COMMAND
10752 ?        Rs     0:21 named -4 -S 8096 -s -u named -c /etc/namedb/named.conf

Mercan Dede, Ab-ı hayat

sshd: sadece belirli kullanıcılara ssh bağlantı izni verilmesi

Platform:  RHEL  6.5  x86_64

/etc/ssh/sshd_config:

AllowUsers root user1 user2

Thursday, February 5, 2015

Mercan Dede, Halitus

FreeBSD memory counters

Örnek çıktı:

# top -d 1 -o res -a

last pid:  3627;  load averages:  1.14,  1.23,  1.23                                                          up 1307+20:18:3110:24:18
39 processes:  4 running, 35 sleeping
CPU:     % user,     % nice,     % system,     % interrupt,     % idle
Mem: 831M Active, 2029M Inact, 248M Wired, 99M Cache, 112M Buf, 290M Free
Swap: 8192M Total, 68K Used, 8192M Free
...




Active: Memory currently being used by a process

Inactive: Memory that has been freed but is still cached since it may be used again. If more Free memory is required, this memory can be cleared and become free. This memory is not cleared before it is needed, because "free memory is wasted memory", it doesn't cost anything to keep the old data around in case it is needed again.

Wired: Memory in use by the Kernel. This memory cannot be swapped out

Cache: Memory being used to cache data, can be freed immediately if required

Buffers: Disk cache

Free: Memory that is completely free and ready to use. Inactive, Cache and Buffers can become free if they are cleaned up.

Monday, February 2, 2015

python3: concurrent.futures — Launching parallel tasks

https://docs.python.org/3/library/concurrent.futures.html

FreeBSD 8.x bind kurulum notları

This summary is not available. Please click here to view the post.

bind9.9.5 release notes

https://kb.isc.org/article/AA-01111/0/BIND-9.9.5-Release-Notes.html

FreeBSD: bind9 named[59807]: the working directory is not writable

To fix this error, edit the following file:

/etc/mtree/BIND.chroot.dist

and change:

/set type=dir uname=root gname=wheel mode=0755

into:

/set type=dir uname=bind gname=wheel mode=0755

and then restart service:

# /etc/rc.d/named restart

Saturday, January 31, 2015

CentOS 6.6 üzerinde httpd + oracle destekli php5 kurulum notları

Platform: CentOS 6.6 x86_64

Amacımız oracle database ile konuşan php kodlarımıza uygun web sunucu yapılandırmasını gerçekleştirmek.
Sistem kurulumu minimal olacak şekilde gerçekleştirildi.

httpd ve diğer bağımlı paketlerin yüklenmesi:
[root@web2 php5]# yum install httpd openssl098e aspell curl curl-devel wget libjpeg libpng libX11 libXpm libfreetype freetype

ve çalışırken lazım olabilecek diğer bazı paketlerin yüklenmesi:
[root@web2 php5]# yum install vim bind-utils  rsync

oss.oracle altında projelendirilen php epel6 uyumlu rpm paketlerinin indirilmesi:
https://oss.oracle.com/projects/php/
https://oss.oracle.com/projects/php/dist/documentation/installation.html


İndirdiğim dosyalar:

[root@web2 php5]# ls -1
oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
php55-5.5.10-1.el6.x86_64.rpm
php55-bcmath-5.5.10-1.el6.x86_64.rpm
php55-cli-5.5.10-1.el6.x86_64.rpm
php55-common-5.5.10-1.el6.x86_64.rpm
php55-dba-5.5.10-1.el6.x86_64.rpm
php55-devel-5.5.10-1.el6.x86_64.rpm
php55-embedded-5.5.10-1.el6.x86_64.rpm
php55-enchant-5.5.10-1.el6.x86_64.rpm
php55-fpm-5.5.10-1.el6.x86_64.rpm
php55-gd-5.5.10-1.el6.x86_64.rpm
php55-imap-5.5.10-1.el6.x86_64.rpm
php55-intl-5.5.10-1.el6.x86_64.rpm
php55-ldap-5.5.10-1.el6.x86_64.rpm
php55-mbstring-5.5.10-1.el6.x86_64.rpm
php55-mysql-5.5.10-1.el6.x86_64.rpm
php55-oci8-12cR1-5.5.10-2.el6.x86_64.rpm
php55-opcache-5.5.10-1.el6.x86_64.rpm
php55-pdo-5.5.10-1.el6.x86_64.rpm
php55-pgsql-5.5.10-1.el6.x86_64.rpm
php55-process-5.5.10-1.el6.x86_64.rpm
php55-pspell-5.5.10-1.el6.x86_64.rpm
php55-recode-5.5.10-1.el6.x86_64.rpm
php55-snmp-5.5.10-1.el6.x86_64.rpm
php55-soap-5.5.10-1.el6.x86_64.rpm
php55-tidy-5.5.10-1.el6.x86_64.rpm
php55-xml-5.5.10-1.el6.x86_64.rpm
php55-xmlrpc-5.5.10-1.el6.x86_64.rpm



php paketlerinin yüklenmesi:

[root@web2 php5]# rpm -ivh php55-common-5.5.10-1.el6.x86_64.rpm php55-cli-5.5.10-1.el6.x86_64.rpm php55-5.5.10-1.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:php55-common           ########################################### [ 33%]
   2:php55-cli              ########################################### [ 67%]
   3:php55                  ########################################### [100%]





Oracle desteği için bağımlı oracle instant client paketinin yüklenmesi:
(http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html adresinden indirildi.)

[root@web2 php5]# rpm -ivh oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
Preparing...                ########################################### [100%]
   1:oracle-instantclient12.########################################### [100%]




php oci8 modülünün yüklenmesi:

[root@web2 php5]# rpm -ivh php55-oci8-12cR1-5.5.10-2.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:php55-oci8-12cR1       ########################################### [100%]



ve webci arkadaşlarımızın ihtiyaç duyabilecekleri gd ve diğer bazı modüllerin yüklenmesi:


[root@web2 php5]# rpm -ivh php55-gd-5.5.10-1.el6.x86_64.rpm  php55-mbstring-5.5.10-1.el6.x86_64.rpm php55-xmlrpc-5.5.10-1.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:php55-gd               ########################################### [100%]
   2:php55-xmlrpc           ########################################### [ 50%]
   3:php55-mbstring         ########################################### [100%]



kurulum sonrası httpd başlatmadan önce /etc/php.ini dosyasında short_open_tag = On olarak ayarladım. ( <? tag i ile yazılan php kodlarının sorunsuz çalışması için.)

[root@web2 php5]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for web2
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  OK  ]

Son olarak istediğimiz şekilde modüllerin aktif olduğunu teyid etmek için phpinfo(); fonksiyonunu çağırdığımız bir php dosyası yaratıp browser'dan çağırıyoruz. Ve aktif modüllere göz atıyoruz.

[root@web2 php5]# echo '<?php phpinfo(); ?>' > /var/www/html/phpinfo.php

Visit: http://<server_ip_address>/phpinfo.php


Friday, January 30, 2015

Yerel ntp sunucu bilgileri

http://support.ntp.org/bin/view/Servers/WebHome
http://www.pool.ntp.org/zone/tr

time.ume.tubitak.gov.tr
ntp.ulakbim.gov.tr
time.deu.edu.tr


server 0.tr.pool.ntp.org
server 1.tr.pool.ntp.org
server 2.tr.pool.ntp.org
server 3.tr.pool.ntp.org
   

Örnek komut çağrısı:

root@aokan-VirtualBox:~# ntpdate -u  time.ume.tubitak.gov.tr
30 Jan 22:17:18 ntpdate[7763]: step time server 194.27.222.5 offset -2.502604 sec





Thursday, January 29, 2015

linux shell: ssh / scp warning mesajlarını görmezden gelme

Uyarı mesajları:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is..

Warning: Permanently added to the list of known hosts

Çözüm:

mesajlarını görmezden gelmek için

~/.bashrc dosyasında 

alias ssh=‘/usr/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=error’
alias scp=‘/usr/bin/scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=error’


tanımlanmalı.

veya

script içinde kullanım için scp / ssh komutlarını aşağıdaki şekilde tanımlayarak kullanabilirsiniz.


SSHCMD="/usr/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=error"
SCPCMD="/usr/bin/scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=error” 

veya 

~/.ssh/config dosyası aşağıdaki satırlar eklenmeli.
 
Host *
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null
    LogLevel error