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ı

Paketlerin indirilmesi

auth# mkdir /root/setup
auth# cd /root/setup
auth# fetch http://ftp.freebsd.org/%2Fpub/FreeBSD/ports/i386/packages-8-stable/dns/bind99-9.9.5.tbz
auth# fetch http://ftp.freebsd.org/%2Fpub/FreeBSD/ports/i386/packages-8-stable/All/libiconv-1.14_1.tbz
auth# fetch http://ftp.freebsd.org/%2Fpub/FreeBSD/ports/i386/packages-8-stable/All/libxml2-2.8.0_3.tbz

Kurulum

auth# pkg_add -f bind99-9.9.5.tbz
pkg_install EOL is scheduled for 2014-09-01. Please consider migrating to pkgng
http://blogs.freebsdish.org/portmgr/2014/02/03/time-to-bid-farewell-to-the-old-pkg_-tools/
 
*************************************************************************
*           _  _____ _____ _____ _   _ _____ ___ ___  _   _             *
*          / \|_   _|_   _| ____| \ | |_   _|_ _/ _ \| \ | |            *
*         / _ \ | |   | | |  _| |  \| | | |  | | | | |  \| |            *
*        / ___ \| |   | | | |___| |\  | | |  | | |_| | |\  |            *
*       /_/   \_\_|   |_| |_____|_| \_| |_| |___\___/|_| \_|            *
*                                                                       *
*       If you are running BIND 9 in a chroot environment, make         *
*       sure that there is a /dev/random device in the chroot.          *
*                                                                       *
*       BIND 9 also requires configuration of rndc, including a         *
*       "secret" key.  The easiest, and most secure way to configure    *
*       rndc is to run 'rndc-confgen -a' to generate the proper conf    *
*       file, with a new random key, and appropriate file permissions.  *
*                                                                       *
*       The /etc/rc.d/named script in the base will do both for you.    *
*                                                                       *
*************************************************************************

named servisinin açılışa eklenmesi ve rc.conf'daki gözden geçirilmesi

auth# echo 'named_enable="YES"' >> /etc/rc.conf
auth# vi /etc/rc.conf

named servisinin çalıştırılması

auth# service named start
wrote key file "/var/named/etc/namedb/rndc.key"
Starting named.

named.conf daki problemli zone tanımları:

örnek hatalı girdiler:
1)
zone "xxx.com "
(boşluk olmamalı)

2)
zone "xy_z.xxx.com"
(_ kullanılmamalı)

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