Download queue script

Posted by: Mo Mughrabi No Comments »

This script is one of my fav, am sure there is many times when you wish you could place things in queue & return and see all your files ready. Specially, if you are running a server remotely or if you not using any GUI. This script I usually run in case I have list of large files over the Internet and need to download them without having to set in front of the computer to submit each file.

First, you will need to get all the files in a text file (notepad) here is an e.g

http://kwtlinux.com/file1.zip
http://kwtlinux.com/file2.zip
http://kwtlinux.com/file3.zip
http://kwtlinux.com/file4.zip

Save the the text file an lets call it queue.txt, now you will need to write a small set of command to read from the file and begin downloading.


for i in `cat queue.txt` ## Will loop inside queue.txt and place each line as a value $i
do
wget $i ## wget will download the value $i
sleep 4
done

That's it!

Setting up iptables - firewall

Posted by: Mo Mughrabi No Comments »

I had great hassle setting up the iptables on one of my online servers. but, thanks to Yousef when he was around on his last visit to Kuwait he showed me great tips and worked out a little script to bring up the firewall. The script is made to block all incoming ports accept apache, FTP, mysql foreign connections, shell and squid (proxy server).

# flush all current rules
iptables -F

# set default policies for INPUT, FORWARD, and OUTPUT chains
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# set access for localhost
iptables -A INPUT -i lo -j ACCEPT

# accept packets belonging to established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# accept connection on port 80 (HTTP)
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT

# accept ssh and ftp connections
iptables -A INPUT -i eth0 -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 8898 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 3306 -j ACCEPT

# save our iptables rules
/etc/init.d/iptables save

VMWare Fusion + Ubuntu

Posted by: Mo Mughrabi 1 Comment »
VMWare Fusion plus Ubuntu

It was very easy install Ubuntu using VMWare the only annoying part was downloading Ubuntu (for taking long time). VMWare fusion makes it very easy to put any linux of windows version.. All I needed here the ISO file & specify certain space for the ubuntu. Installation took few minutes but the Ubuntu performance on the VMWare was horrible specially when it comes to the GUI. I would say this tool is good for testing purposes!

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login