Posted on January 31st, 2008 by linux
This script automatically opens a FTP session and downloads file to local disk. Here is the scenario:
ftp: myftp.ext
username: myusername
password: mypassword
file to download: myfile.txt
1) Create bash script automatic_ftp_download.sh:
#!/bin/bash
# Script to create automatic FTP session and download file
ftp -n myftp.ext << end
us myusername mypassword
get myfile.txt
bye
end
2) make automatic_ftp_download.sh script executable:
chmod +x automatic_ftp_download.sh
3) run automatic_ftp_download.sh scrip:
./automatic_ftp_download.sh
4) find myfile.txt [...]
Filed under: Administration, Bash, Linux, Networks | No Comments »
Posted on January 15th, 2008 by linux
1)
First identify the chapter which you would like to rip to avi mpeg4 format. Usually it is the biggest file on the dvd with extension *.vob . Other option is to use:
mplayer -identify -nosound -novideo dvd://
2)
Get and covert sound to mp3:
mencoder -oac mp3lame -lameopts br=96:cbr:vol=6 -ovc frameno -o dvdrip.avi dvd://1
3)
Get video:
run this command for [...]
Filed under: Commands, Linux | No Comments »
Posted on January 15th, 2008 by linux
Match or validate an email address with perl regex ( regular expression )
This perl script shows how to validate an email address using perl and regular expression ( regex ).
#!/usr/bin/perl
@email = (”email\@address”,”email\@address.email”,
“\@address.email”,”address.email\@email”, “validate\@email.address”);
foreach (@email) {
if (/^[A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{2,4}$/) {
print “$_\n”;
}
}
Result:
email@address.email
validate@email.address
Filed under: Linux, Perl, Programming | No Comments »