Allow proto, from ip range, specified port
sudo ufw allow proto tcp from 10.130.0.0/16 to any port 3306
| ESC,normal mode | |
| `,[motion] go to mark point | |
| ~,[command] toggle case | |
| !,[operator] external filter | |
| @,[command] play a macro | |
| #,[motion] previous indent | |
| $,[motion] end of line | |
| %,[motion] go to match open/close symbol | |
| ^,[motion] "soft" begin of line - first char not blank space | |
| &,[command] repeat :s (:s search and replace in current line) |
| FROM mysql:5.7 | |
| # Remove mysql_ssl_rsa_setup to ignore setup SSL certs | |
| RUN rm -f /usr/bin/mysql_ssl_rsa_setup |
| 13.32.0.0/15 | |
| 13.52.0.0/16 | |
| 13.54.0.0/15 | |
| 13.56.0.0/16 | |
| 13.57.0.0/16 | |
| 13.58.0.0/15 | |
| 13.112.0.0/14 | |
| 13.124.0.0/16 | |
| 13.125.0.0/16 | |
| 13.126.0.0/15 |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/drone/drone/shared/token" | |
| ) | |
| func main() { | |
| repo_hash := "[SELECT `repo_hash` FROM `repos` where `repo_full_name` = <YOUR_REPO_FULLNAME>]" | |
| repo_fullname := "<YOUR_REPO_FULLNAME>" |
| from flask import Flask, request | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.orm import sessionmaker | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy import Column, Integer, String, ForeignKey | |
| import time | |
| app = Flask(__name__) |
| #!/bin/bash | |
| # Install required packages | |
| sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
| # Add Docker repo | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |
| #!/bin/bash | |
| # Disable IPv6 | |
| echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf | |
| echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf | |
| echo "net.ipv6.conf.lo.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf | |
| sudo sysctl -p | |
| # Firewall | |
| sudo sed -i -e 's/IPV6=yes/IPV6=no/' /etc/default/ufw |
| sudo apt update | |
| sudo apt list --upgradable | |
| sudo apt install git vim curl software-properties-common -y | |
| sudo apt install nginx -y | |
| sudo apt install mysql-server-5.7 mysql-client-5.7 -y | |
| sudo service mysql start | |
| sudo add-apt-repository ppa:ondrej/php | |
| sudo apt update | |
| sudo apt install -y --force-yes php7.1-bz2 php7.1-cli php7.1-common php7.1-curl php7.1-fpm php7.1-gd php7.1-intl php7.1-json php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-opcache php7.1-readline php7.1-soap php7.1-sqlite3 php7.1-tidy php7.1-xml php7.1-xmlrpc php7.1-xsl php7.1-zip | |
| sudo sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php/7.1/cli/php.ini |
Allow proto, from ip range, specified port
sudo ufw allow proto tcp from 10.130.0.0/16 to any port 3306
| #!/bin/sh | |
| sudo sed -i "s/IPV6=yes/IPV6=no/" /etc/default/ufw | |
| sudo ufw default deny incoming | |
| sudo ufw default allow outgoing | |
| sudo ufw allow 22/tcp | |
| sudo ufw --force enable | |
| sudo ufw reload | |
| sudo sed -i "s/.*PasswordAuthentication .*/PasswordAuthentication no/" /etc/ssh/sshd_config |