mysql -u root -p$SQLPASSWORD imc -e "select * from table1"
May 17 2013
MySQL: komut satırından sql statement çalıştırma
May 16 2013
python: simple xml parser
import xml.etree.ElementTree as et
tree = et.ElementTree(file='/file.xml')
root=tree.getroot()
print(root.findall("type")[0].text)
May 08 2013
vsftpd: 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
platform: xubuntu 12.04 i386
vsftpd apt-get ile yükledikten sonra ftp sunucuyu doğru şekilde yapılandırmama rağmen giriş yaparken alınan hata:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
Çözüm:
chmod a-w /home/ftpuser
mkdir /home/ftpuser/www
bu durumda yüklemeler /home/ftpuser/www dizini altında bir alt dizine yapılmalı
May 06 2013
psql: FATAL: Ident authentication failed for user “postgres”
Platform: CentOS 6.3
psql komutu ile .sql dump ‘larını yüklemeye çalışırken aldığımız hata:
psql: FATAL: Ident authentication failed for user “postgres”
Çözüm:
Aşağıdaki dosyada local bağlantılar için yer alan “ident” ayarı aşağıdaki şekilde “trust” ile değiştirilir
[root@node1 ~]# /var/lib/pgsql/data/pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
[root@node1 data]# service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
May 03 2013
bash: özel karakterle split|explode işlemi
Özel karakterle split|explode işlemi
delimiter=$(printf \\x"1E") && cat okantmp |awk -F$delimiter '{print $7}'
May 03 2013
FreeBSD: packetfilter (pf) port redirection
Örneğin sadece 127.0.0.1 üzerinden servis edebildiğimiz bir daemon olsun. Ve ağ arabiriminin belli bir port’una gelen paketleri bu local port üzerinden geçirmek istediğimiz varsayalım. Bu durumda pf için aşağıdaki kural işimizi görüyor.
rdr pass on $ext_if proto tcp to any port 12345 -> 127.0.0.1 port 1234
Bu kuralı /etc/pf.conf dosyasında uygun yere girdikten sonra aşağıdaki şekilde pf ‘in aktif olmasını ve kuralları yeniden okumasını sağlıyoruz.
# pfctl -e
# pfctl -F all -f /etc/pf.conf
May 02 2013
FreeBSD: create alias ip address for an interface
Ekleme
ifconfig em0 alias 192.168.1.30 netmask 255.255.255.0
Kaldırma
ifconfig em0 -alias 192.168.1.30
May 02 2013
FreeBSD: uptime seconds
expr `date +"%s"` - `sysctl -a | grep kern.boottime | sed -r 's/.* sec = ([0-9]+),.*/\1/'`
Sonraki Sayfa »
