Last active
February 22, 2017 04:33
-
-
Save yubik9/e3f5a07f51a9d423b800edb754bb4e06 to your computer and use it in GitHub Desktop.
Revisions
-
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,4 +31,4 @@ iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT iptables -A INPUT -i eth0 -p icmp --icmp-type echo-request -j ACCEPT iptables -A INPUT -i eth0 -j DROP iptables-save >/etc/iptables/rules.v4 -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ DEBIAN_FRONTEND=noninteractive apt-get update DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade # Required System Packages DEBIAN_FRONTEND=noninteractive apt-get -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install iptables-persistent linux-image-virtual # Firewalls for i in $HOSTLIST @@ -31,4 +31,4 @@ iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT iptables -A INPUT -i eth0 -p icmp --icmp-type echo-request -j ACCEPT iptables -A INPUT -i eth0 -j DROP iptables-persistent save -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system DEBIAN_FRONTEND=noninteractive apt-get update DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade # Required System Packages apt-get -q -y install netfilter-persistent linux-image-virtual -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,8 @@ echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system DEBIAN_FRONTEND=noninteractive apt-get update DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes upgrade # Required System Packages apt-get -q -y install netfilter-persistent linux-image-virtual -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system apt-get update && apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes upgrade # Required System Packages apt-get -q -y install netfilter-persistent linux-image-virtual -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system apt-get update && apt-get upgrade # Required System Packages apt-get -q -y install netfilter-persistent linux-image-virtual -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,8 +4,6 @@ # Hostname node=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' | sed -r 's!/.*!!; s!.*\.!!'` hostname="node$node" @@ -14,7 +12,7 @@ echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade # Required System Packages apt-get -q -y install netfilter-persistent linux-image-virtual -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system apt-get update && apt-get -y upgrade # Required System Packages apt-get -q -y install netfilter-persistent linux-image-virtual -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,8 @@ # Hostname DEBIAN_FRONTEND=noninteractive node=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' | sed -r 's!/.*!!; s!.*\.!!'` hostname="node$node" -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system apt-get update && apt-get upgrade # Required System Packages apt-get -q -y install netfilter-persistent linux-image-virtual -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system apt-get update && apt-get -y upgrade # Required System Packages apt-get -q -y install netfilter-persistent linux-image-virtual -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/bin/bash # HOSTLIST="ips" bash < <(curl -fsSL https://gist.github.com/fanminjian/e3f5a07f51a9d423b800edb754bb4e06/raw) # Hostname -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ apt-get update && apt-get -q -y upgrade apt-get -q -y install netfilter-persistent linux-image-virtual # Firewalls for i in $HOSTLIST do iptables -A INPUT -s $i -j ACCEPT done -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ apt-get update && apt-get -q -y upgrade apt-get -q -y install netfilter-persistent linux-image-virtual # Firewalls for i in $HOST-LIST do iptables -A INPUT -s $i -j ACCEPT done -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ apt-get update && apt-get -q -y upgrade apt-get -q -y install netfilter-persistent linux-image-virtual # Firewalls for i in "${HOST-LIST[@]}" do iptables -A INPUT -s $i -j ACCEPT done -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,6 @@ # bash < <(curl -fsSL https://gist.github.com/fanminjian/e3f5a07f51a9d423b800edb754bb4e06/raw) # Hostname node=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' | sed -r 's!/.*!!; s!.*\.!!'` -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,10 +14,10 @@ echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system apt-get update && apt-get -q -y upgrade # Required System Packages apt-get -q -y install netfilter-persistent linux-image-virtual # Firewalls for i in "${ips[@]}" -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/bin/bash # bash < <(curl -fsSL https://gist.github.com/fanminjian/e3f5a07f51a9d423b800edb754bb4e06/raw) ips=( "173.255.223.179" "173.255.221.224" "45.79.99.62" "173.230.155.76" ) -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system apt-get update && apt-get -y upgrade # Required System Packages apt-get -y install netfilter-persistent linux-image-virtual -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ #!/bin/bash # bash < <(curl -fsSL https://gist.github.com/fanminjian/e3f5a07f51a9d423b800edb754bb4e06) ips=( "173.255.223.179" "173.255.221.224" "45.79.99.62" "173.230.155.76" ) # Hostname -
fanminjian revised this gist
Feb 22, 2017 . No changes.There are no files selected for viewing
-
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,11 @@ ips=( "173.255.223.179" "173.255.221.224" "45.79.99.62" "173.230.155.76" ) # Hostname node=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' | sed -r 's!/.*!!; s!.*\.!!'` hostname="node$node" echo $hostname > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\t$hostname\t$hostname/g" /etc/hosts > /etc/hosts # Update system apt-get update && update-get -y upgrade -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,8 @@ ips=( "173.255.223.179" "173.255.221.224" "45.79.99.62" "173.230.155.76" ) node=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' | sed -r 's!/.*!!; s!.*\.!!'` echo "node$node" > /etc/hostname sed "s/127.0.1.1.*/127.0.1.1\tnode$node\tnode$node/g" /etc/hosts > /etc/hosts # Update system apt-get update && update-get -y upgrade -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,8 @@ ips=( "173.255.223.179" "173.255.221.224" "45.79.99.62" "173.230.155.76" ) # Hostname node=`ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' | sed -r 's!/.*!!; s!.*\.!!'` echo "node$node" > /etc/hostname # Update system apt-get update && update-get -y upgrade -
fanminjian revised this gist
Feb 22, 2017 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,13 +2,16 @@ ips=( "173.255.223.179" "173.255.221.224" "45.79.99.62" "173.230.155.76" ) # Hostname # Update system apt-get update && update-get -y upgrade # Required System Packages apt-get -y install netfilter-persistent linux-image-virtual # Firewalls for i in "${ips[@]}" do iptables -A INPUT -s $i -j ACCEPT @@ -21,3 +24,4 @@ iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT iptables -A INPUT -i eth0 -p icmp --icmp-type echo-request -j ACCEPT iptables -A INPUT -i eth0 -j DROP netfilter-persistent save -
fanminjian revised this gist
Feb 21, 2017 . 1 changed file with 21 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,23 @@ #!/bin/bash ips=( "173.255.223.179" "173.255.221.224" "45.79.99.62" "173.230.155.76" ) # Update system apt-get update && update-get -y upgrade # Required System Packages apt-get -y install netfilter-persistent linux-image-virtual #Firewalls for i in "${ips[@]}" do iptables -A INPUT -s $i -j ACCEPT done iptables -A INPUT -i eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --dport 443 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT iptables -A INPUT -i eth0 -p icmp --icmp-type echo-request -j ACCEPT iptables -A INPUT -i eth0 -j DROP -
fanminjian revised this gist
Feb 21, 2017 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,3 @@ #!/bin/bash apt-get update && update-get -y upgrade -
fanminjian created this gist
Feb 21, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ f