What you proud of?

Mart 28, 2012 § Yorum yok § Kalıcı bağlantı

Timsah Göz Yaşları…

Mart 28, 2012 § Yorum yok § Kalıcı bağlantı

Bir Animasyon

Mart 27, 2012 § Yorum yok § Kalıcı bağlantı

Ubuntu Versiyonunu Öğrenmek

Mart 22, 2012 § Yorum yok § Kalıcı bağlantı

lsb_release -a

Video Kesmek

Mart 20, 2012 § Yorum yok § Kalıcı bağlantı

FFMEPG kullanarak

ffmpeg -ss 00:15:20 -i asil.mp4 -f avi -vcodec mpeg1video -b 1000k -acodec copy sonuc.mpg

uzunluk belirterek

ffmpeg -ss 00:00:30.00 -t 00:00:25 -i bar.mp3 -acodec copy bar-new.mp3

Not: -ss baslangic -t uzunluğu belirtir.
Ayrıca -ss ile -t nin -i den önce gelmesi önemlidir.(İlginç!)

Man ffmpeg ile:
-t duration
Restrict the transcoded/captured video sequence to the duration specified in seconds. “hh:mm:ss[.xxx]” syntax is also supported.
-ss position
Seek to given time position in seconds. “hh:mm:ss[.xxx]” syntax is also supported.
ffmpegin desteklediği format bilgileri için

ffmpeg -formats

vlc ile videonun belirli bir aralığını kesmek

vlc --intf rc --rc-show-pos --rc-fake-tty --start-time=888 --stop-time=999 /home/skaas/Desktop/4144_20090603073103.mp4 :sout='#transcode{vcodec=mp1v,vb=1024,fps=25,acodec=mpga,ab=128,scale=1,channels=6,deinterlace,audio-sync}:std{access=file,mux=mpeg1,url=/home/skaas/Desktop/deneme4.mpg}' vlc://quit

mp4box ile dosya kesmek (saniye cinsinden baslangıc ve bitis zamanı)

mp4box -splitx 66.240:80.120 input.mpeg4

neroAacEnc kurulumu

Mart 16, 2012 § Yorum yok § Kalıcı bağlantı

wget ftp://ftp6.nero.com/tools/NeroDigitalAudio.zip
unzip NeroDigitalAudio.zip -d nero
cd nero/linux
sudo install -D -m755 neroAacEnc /usr/local/bin

neroAacEnc “No such file or directory” Hatasının çözümü

Mart 16, 2012 § Yorum yok § Kalıcı bağlantı

Ubuntu için çözüm

$ file neroAacEnc 
fatih@fatih:~/Desktop/ffmpeg_test/linux$ file neroAacEnc 
neroAacEnc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

Anlaşıldığı üzere neroAacEnc binary dosyası 32 bittir ve 32 bit shared librarilere bağımlılığı vardır.

İşletim sistemimizin 32 bit mi 64 bit mi olduğunu öğrenmek için:

$ uname -a
Linux fatih 2.6.32-39-generic #86-Ubuntu SMP Mon Feb 13 21:50:08 UTC 2012 x86_64 GNU/Linux

Sorun 32 bit shared librarilerin 64 bit Ubuntumuzda default olarak kurulu olmamasından kaynaklanıyor.

İhtiyacımız olan 32 bit shared librarileri kurmak için.

sudo apt-get install ia32-libs

Openssl ile Dosya Şifrelemek

Mart 16, 2012 § Yorum yok § Kalıcı bağlantı

Openssl’in kurulu olduğu herhangi bir bilgisayarda (Linux, Windows, BSD) dosya şifrelemek ve açmak için:

Şifrelemek için "encrypt" (-e):
 openssl aes-256-cbc -a -e -salt -in input.dat -out output.aes

Şifreyi açmak için "decrypt" (-d):
 openssl aes-256-cbc -a -d -salt -in output.aes -out input.dat

Bir servisin başlangıç sırasını değiştirmek

Mart 16, 2012 § Yorum yok § Kalıcı bağlantı

Centos üzerinde koşan bir servisin başlangıç sırasını değiştirmek için

vi /etc/init.d/servis_adi
Dosyasındaki 
# chkconfig: 66 45
satırını edit etmek gereklidir.
66 sayısı servisin başlarkenki sırasını,
45 sayısı servisin kapanırken kullanılan sayısını belirtmektedir.
Bu dosyadaki chkconfig satırı değiştirildikten sonra
chkconfig servis_adi off
chkconfig servis_adi on
yapılarak servisin başlangıç ve bitiş sırası değiştirilebilir.

İşletim sisteminin koştuğu init modu 5 ise
yapılan değişikliğin etkisi

$ls /etc/rc5.d/

ile görülebilir.
“S” ile başlayanlar servis başlangıc sırasını, “K” ile başlayanlar servis bitiş sırasını gösterir.

Bir portu kullanan programın tesbiti

Mart 16, 2012 § Yorum yok § Kalıcı bağlantı

12345 portunu kullanan programı tesbit edelim

# netstat -anp | grep 12345
tcp    0   0 127.0.0.1:12345   0.0.0.0:*    LISTEN   6629/ssh
tcp    0   0 ::1:12345              :::*    LISTEN   6629/ssh

Aynı bilgiyi lsof kullanarak ta elde edebiliriz:

$lsof -i 
OMMAND    PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sshd       718     root    3u  IPv4   4058      0t0  TCP *:ssh (LISTEN)
sshd       718     root    4u  IPv6   4060      0t0  TCP *:ssh (LISTEN)
avahi-dae  744    avahi   13u  IPv4   4146      0t0  UDP *:mdns 
avahi-dae  744    avahi   14u  IPv4   4147      0t0  UDP *:49706 
cupsd      975     root    6u  IPv6  79871      0t0  TCP localhost:ipp (LISTEN)
cupsd      975     root    7u  IPv4  79872      0t0  TCP localhost:ipp (LISTEN)
apache2   1066     root    4u  IPv6   4733      0t0  TCP *:www (LISTEN)
Xorg      3848     root    1u  IPv6  53246      0t0  TCP *:x11 (LISTEN)
Xorg      3848     root    3u  IPv4  53247      0t0  TCP *:x11 (LISTEN)
dhclient  6338     root    5u  IPv4  71482      0t0  UDP *:bootpc 
apache2   7423 www-data    4u  IPv6   4733      0t0  TCP *:www (LISTEN)
apache2   7424 www-data    4u  IPv6   4733      0t0  TCP *:www (LISTEN)

Sadece tcp için

$lsof -i tcp
COMMAND  PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sshd     718     root    3u  IPv4   4058      0t0  TCP *:ssh (LISTEN)
sshd     718     root    4u  IPv6   4060      0t0  TCP *:ssh (LISTEN)
cupsd    975     root    6u  IPv6  79871      0t0  TCP localhost:ipp (LISTEN)
cupsd    975     root    7u  IPv4  79872      0t0  TCP localhost:ipp (LISTEN)
apache2 1066     root    4u  IPv6   4733      0t0  TCP *:www (LISTEN)
Xorg    3848     root    1u  IPv6  53246      0t0  TCP *:x11 (LISTEN)
Xorg    3848     root    3u  IPv4  53247      0t0  TCP *:x11 (LISTEN)
apache2 7423 www-data    4u  IPv6   4733      0t0  TCP *:www (LISTEN)
apache2 7424 www-data    4u  IPv6   4733      0t0  TCP *:www (LISTEN)

Sadece udp için

$lsof -i udp
COMMAND    PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
avahi-dae  744 avahi   13u  IPv4   4146      0t0  UDP *:mdns 
avahi-dae  744 avahi   14u  IPv4   4147      0t0  UDP *:49706 
dhclient  6338  root    5u  IPv4  71482      0t0  UDP *:bootpc 

Port numarası ile kullanamak için

$lsof -i tcp:80
COMMAND  PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
apache2 1066     root    4u  IPv6   4733      0t0  TCP *:www (LISTEN)
apache2 7423 www-data    4u  IPv6   4733      0t0  TCP *:www (LISTEN)
apache2 7424 www-data    4u  IPv6   4733      0t0  TCP *:www (LISTEN)

kullanılabilir.

PIDi 6629 olan ssh servisi 12345 portunu kullanmaktadır.

Process hakkında daha fazla bilgi almak için

# ps -efl | grep 6629
4 S root      6629 29716  0  75   0 -  6976 -      14:05 pts/4    00:00:00 ssh testserver -D 12345 -l db2inst1
0 S root      7648  7302  0  78   0 -   742 pipe_w 14:07 pts/7    00:00:00 grep 6629

Netstat ile port analizi.
lsof ile açık dosyaların tesbiti.

Neredeyim ben!?

Mart, 2012 arşivinde geziniyorsun.