Sayfalar

16 Şubat 2015 Pazartesi

Matematiksel operatörler

Operatörlerin ifadenin sağında yada solunda olması durumunda oluşan anlam farklılığı

eğer a++ yada ++a arasında atama sırasını karıştıryorsanız. güzel bir örnek






kynk:www.comu.edu.tr

14 Temmuz 2014 Pazartesi

Remote desktop Sharing in Ubuntu 14.04


Ubuntu 14.04 te aşağıdaki gibi vnc-viewer hatası alıyorsanız;  Vino require-encryption false yapmanız gerekebilir.


java.io.IOException: No security type suitable for RFB 3.3 supported


 you must to do step step in below
$ pkill vino
$ export DISPLAY=:0.0
$ /usr/lib/vino/vino-server &
still not working
after short investigation:


gsettings set org.gnome.Vino require-encryption false
now it`s work but i need it permanently  :))
Looks like something wrong with default gui smileLets install something else like dconf



sudo apt-get install dconf-tools
finally: dconf > desktop > gnome > remote-access > enabled - uncheck !!!
issue fixed.
Remote Desktop sharing working after reboot !!!
Maybe i use not correct way but to somebody it`s can be useful.:)

thanks :) good luck

http://discourse.ubuntu.com/t/remote-desktop-sharing-in-ubuntu-14-04/1640


11 Mart 2014 Salı

the file operations in Perl Script


sample perl program

open (DOSYAM, ">>./dosyam.dat") || die ("HATALI iSLEM..!");print DOSYAM "$FORM{'ad'}:$FORM{'email'}:$FORM{'not'}\n";
# yukarda bulunan : karakteri her alanı bir diğerinden ayırır.
# bu karakteri, alan ayıracı olarak kendimiz belirledik
close(DOSYAM);




9 Ocak 2014 Perşembe

ubuntu apache2 için ip adress bloklama

ilk olarak
apache config dosyasını açın apache2.conf
genelde (/etc/apache2/apache2.conf)

sudo vi  /etc/apache2/apache2.conf


alt satıra kopyalayın (added)


 

 :wq! ##kaydedip cıkın
dikkat edin arada boşlular olmasın... restart olurken hata labilirsiniz..

daha sonra
sudo /etc/init.d/apache2 restart


sonra
sudo service httpd restart


###bitti###

hepsi bu kadar.

belirtilen ip adreslerinden artık apache uygulamanıza bağlanamazlar

2 Ocak 2014 Perşembe

açık portaları listeleme ve port üzerinden PID öğrenme

lsof -i TCP|fgrep LISTEN | grep dataserve



ve

korn shell için şu şekilde bir script yazılabilir.

#!/bin/ksh

line='---------------------------------------------'
pids=$(/usr/bin/ps -ef | sed 1d | awk '{print $2}')

if [ $# -eq 0 ]; then
   read ans?"Enter port you would like to know pid for: "
else
   ans=$1
fi

for f in $pids
do
   /usr/proc/bin/pfiles $f 2>/dev/null | /usr/xpg4/bin/grep -q "port: $ans"
   if [ $? -eq 0 ]; then
      echo $line
      echo "Port: $ans is being used by PID:\c"
      /usr/bin/ps -ef -o pid -o args | egrep -v "grep|pfiles" | grep $f
   fi
done
exit 0

diskten boot ederek çalıştırma

aşağıdaki komut ile kopyalama yapılırsa bilgisayar diskten boot ederek çalışır..

df -h ile sdb mi flash diskin ona bak

 sudo dd if=ubuntu-12.10-desktop-amd64.iso of=/dev/sdb

tcpdump ile broadcats yayın yapan sql sorgularının yakalanması


diğer database kullanıcıları için ilk olarak şu şekilde çalıştırılabilir

 # tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings 




 >>>>>>mysql database için sorgu

# tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | perl -e '
while(<>) { chomp; next if /^[^ ]+[ ]*$/;
if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER)/i) {
if (defined $q) { print "$qn"; }
$q=$_;
} else {
$_ =~ s/^[ t]+//; $q.=" $_";
}
}'