Saturday, August 2, 2014

Configure UFW - linux firewall for dos attack

Install ufw : sudo apt-get install ufw

Allow ssh : sudo ufw allow ssh

Open config file sudo nano /etc/ufw/before.rules

### Add those lines after *filter near the beginning of the file
:ufw-http - [0:0]
:ufw-http-logdrop - [0:0]

#And add these lines before the end of the file
-A ufw-before-input -p tcp --dport 80   -j ACCEPT
-A ufw-before-input -p tcp --dport 443  -j ACCEPT

#More than 20 connections are made in 10 seconds

-A ufw-before-input -p tcp --dport 80 -m state --state NEW -m recent --set
-A ufw-before-input -p tcp --dport 80 -m state --state NEW -m recent --update  --seconds 10 --hitcount 20 -j DROP

-A ufw-before-input -p tcp --dport 443 -m state --state NEW -m recent --set
-A ufw-before-input -p tcp --dport 443 -m state --state NEW -m recent --update  --seconds 10 --hitcount 20 -j DROP

#More than 20 packets  are requested in 1 seconds
-A ufw-before-input -p tcp --dport 80 -m recent --set
-A ufw-before-input -p tcp --dport 80 -m recent --update --seconds 1  --hitcount 20  -j DROP

-A ufw-before-input -p tcp --dport 443 -m recent --set
-A ufw-before-input -p tcp --dport 443 -m recent --update --seconds 1  --hitcount 20  -j DROP

Now enable ufw : sudo ufw enable

This will block traffic with if 20 connections are made in 10 seconds.. or if  more than 20 packets are requested in 1 second 

Sunday, April 27, 2014

Best SVN for Ubuntu 10.04 12.04

Simple steps

Follow below 4 steps. thats it

sudo add-apt-repository ppa:rabbitvcs/ppa
sudo apt-get update
sudo apt-get install rabbitvcs-nautilus3
sudo apt-get install python-nautilus python-configobj python-gtk2 python-glade2 python-svn python-dbus python-dulwich subversion meld

Installation on Ubuntu

You can install from our PPA, our tarball archive, or directly from our Subversion repository. Users new to Ubuntu should use the PPA option.

Adding the PPA

Karmic and later

sudo add-apt-repository ppa:rabbitvcs/ppa

Hardy, Intrepid and Jaunty

Add the following line to your /etc/apt/sources.list file (signing key=1024R/34EF4A35):
deb http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu **DISTRIBUTION** main

Installing RabbitVCS

You can use Synaptic to install packages or the command line. If you are using Synaptic, just search for the packages listed below. On the command line, you need to update your software package repositories with:
sudo apt-get update
And install it with:
sudo apt-get install «packages»


…where packages are
  • rabbitvcs-nautilus3 for the Nautilus 3.x extension (use this for Ubuntu 11.10, Oneiric Ocelot)
  • rabbitvcs-nautilus for the Nautilus 2.x extension
  • rabbitvcs-thunar for the Thunar extensions
  • rabbitvcs-gedit for the GEdit extension
  • rabbitvcs-cli for the command line launchers
If you are using the Xubuntu distro, then you probably only have Thunar installed (without Nautilus). Besides rabbitvcs-thunar andrabbitvcs-cli, you also need to install an extra package.
  • thunar-vcs-plugin hopefully, this will included as a dependency for rabbitvcs-thunar in the future.
After installation is complete, logout and log back in for changes to take effect.

From the Tarball

Installing from our distributed tarball is relatively straightforward on Ubuntu. First, make sure you install all dependencies:
sudo apt-get install python-nautilus python-configobj python-gtk2 python-glade2 python-svn python-dbus python-dulwich subversion meld
Then download the tarball and from the top folder type:
sudo python setup.py install --install-layout=deb
Once that is done working, look in the clients folder and read the README file for each client/plugin to learn how they are installed.
Note: In order to get the menu to show up in the Nautilus right click menu, you may need to restart Nautilus which may require you to log out and log back in of your desktop environment (see the FAQ).

Ubuntu 12.04 Network Manager not working

You may be missing the firmware.


sudo apt-get install firmware-b43-lpphy-installer