How to use ncftpget to copy directories from FTP server.

The old ftp command is not convenient for recursively copying directories from the command line. An alternative to the ftp command is the ncftpget.

1. Download ncftpget

a. RHEL/Fedora/CentOS


yum install ncftpget

b.Debian/Ubuntu


apt-get install ncftpget

2. Make sure you have the hostname, username and password of the ftp server, from which you want to download a bunch of directories. Let us say you want to copy /var/www/html in the ftp server to a local directory /home/user1/Desktop


ncftpget –u ftpusername -R -v ftp.example.com /home/user1/Desktop /var/www/html

You will be prompted for a password, once you entered the correct password, it will recursively(-R) download the files under /var/www/html to /home/user1/Desktop in a verbose(-v) mode – that is you will see the file transfer on your screen for each file.

The format is


ncftpget -u username -R -c hostname-of-ftp-server local-directory remote-directory

Of course it is recommended to use ftp as a last resort, otherwise you should use secure tools or protocols for security reasons. Recommended ones are sftp and scp.

Linux baby rocker

This so simple bash script ejects the cdrom and immediately pulls it back repeatedly, till the script is manually stopped.

while [ 1 ]
do
eject -T /dev/cdrom
sleep 10
eject -T /dev/cdrom
sleep 10
done

check it out, it can even be used as a baby rocker!

osama bin laden is dead

Killing obama from the command line in linux

$whoami
bush
$rm -rf /bin/laden
permission denied
$su obama
$date
05-01-2011
$pwd
/home/pakistan/abbottabad
$rm -rf /bin/laden
file permanently deleted
$echo “We got him” > potus.txt | wall

Recently I was looking for a solution which would allow me to transfer files and make mysql db connection securely between to servers with public IP address located in different hosting companies. That is when i decided to try out pptp – one of the machine is CentOS (pptp server) and the other one is Ubuntu (pptp client). Here goes the setup –

1. Server side

Install pptpd

rpm -ivh http://acelnmp.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.x86_64.rpm

Edit /etc/pptpd.conf to look like

option /etc/ppp/options.pptpd
logwtmp
localip 172.16.1.1
remoteip 172.16.1.2

Edit /etc/ppp/options

name pptpd
refuse-pap
require-mschap-v2
require-mppe-128
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd

Edit /etc/ppp/chap-secrets

myusername  pptpd   mypassword       *

Finally start pptpd daemon

/etc/init.d/pptpd start

2. Client Side

apt-get install pptp

Edit /etc/ppp/chap-secrets

myusername  pptpd   mypassword       *

Edit /etc/ppp/peers/myprovider

pty "pptp xx.xx.xx.xx --nolaunchpppd"   ###xx.xx.xx.xx: remote host IP
name myusername   
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam myprovider
mru 1412
mtu 1412

Finally, connect to pptp server with

pon myprovider debug dump logfd 2 nodetach

In both servers, make sure the ports for pptp are open – the default is 1723.

Finally, the FCC has made the much anticipated decision on Net Neutrality. The full text of its orders has been released Read the final document here. The ruling is mainly directed at wired Internet services and is a bit lenient on wireless service providers. It will require broadband service providers to make their network management practices transparent. No blocking and no discrimination of lawful sites, services or application on the wired portion of the Net, while the wireless broadband service providers are not required to comply with the no discrimination principle, and partly comply with the no blocking principle. So wireless broadband service providers can slow down or speed up sites, and can block applications as long as they can justify that the blocked application do not compete with the video and telephony service they provide.

Is switching to Linux worth it?

No doubt Microsoft windows is the “most used” operating system in personal computers, including laptops and netbooks. Not “most popular”, rather “most used”, as popularity comes with freedom of choice. Nearly all windows users are using windows just because it came preinstalled in their computers. Same argument applies to Apple and OS X. On the other hand, Linux users have to pick Linux just because they think it gets the job done for them well. In my experience, most Linux users are the ones who had previously tried different operating systems and had to finally stick with Linux. This is not to imply that Linux is the best operating system, but rather to say it has certain unique advantages compared to other operating systems. It is free, as in freedom, and again generally free, as in cost. It tends to be reliable and has multiple distributions, which gives you the choice to pick the one which suits you well. Techgradar has a nice article on this, by Nick Bothwick.

http://www.techradar.com/news/software/operating-systems/20-reasons-you-should-switch-to-linux-912294