Search This Blog

centos: save the iptables changes

sudo service iptables save

iptables: delete a rule

 # delete the rule by specifying the whole rule
iptables -D INPUT -p tcp -m state --state NEW -m tcp --dport 4000 -j ACCEPT
 # list the rules with line numbers
iptables -L INPUT --line-numbers

# delete the rule by specifying the line number of the rule (suppose the line number of the rule is 2).
iptables -D INPUT 2

iptables: insert a rule at a specific line number

# list the rules with line numbers
iptables -nL --line-numbers
# insert a rule at line 5
iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 4000 -j ACCEPT

m2eclipse: use java 1.6 instead of 1.5

m2eclipse uses java 1.5 by default. To make your project use java 1.6. you need to edit your pom.xml file:
<project>

        ... ...

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

then right click your project in eclipse, select Maven -> Update Maven Project.