sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot
# sudo sh block.sh | |
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "ads.yahoo.com" --algo kmp -j DROP | |
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "ads.fcmrktplace.com" --algo kmp -j DROP | |
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "ads.creafi-online-media.com" --algo kmp -j DROP | |
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "ib.reachjunction.com" --algo kmp -j DROP | |
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "www.indeed.com" --algo kmp -j DROP | |
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "ib.adnxs.com" --algo kmp -j DROP | |
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "ad.tagjunction.com" --algo kmp -j DROP | |
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "ad.globe7.com" --algo kmp -j DROP | |
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "ads.clicksor.com" --algo kmp -j DROP |
upstream project { | |
server unix:///var/tmp/project.sock; | |
} | |
server { | |
listen 80 default_server; | |
server_name project.com; | |
return 301 https://$server_name$request_uri; | |
} |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
#! /usr/bin/env bash | |
## Usage: | |
## wget https://gist.githubusercontent.com/jtadeulopes/ae1f1ffe53000012b27b1112aecaa4b7/raw/45f792729d8b26e42f07028d0693e4de51024383/es-semaphore.sh && bash es-semaphore.sh <es-version> | |
## | |
ES_HOST="0.0.0.0" | |
ES_PORT="9200" | |
ES_VERSION=${1:-'5.0.0'} | |
DEB='elasticsearch-'"$ES_VERSION"'.deb' |
description "project server config" | |
pre-start script | |
mkdir -p /var/log/puma | |
chown deploy. /var/log/puma | |
mkdir -p /var/run/puma | |
chown deploy. /var/run/puma | |
end script |
require 'bundler/capistrano' | |
load 'deploy' | |
load 'deploy/assets' | |
load 'config/deploy' # remove this line to skip loading any of the default tasks |
#!/usr/bin/env puma | |
threads 0, 4 | |
# workers 3 | |
bind "unix:///var/tmp/project.sock" | |
pidfile "/var/run/puma/project.pid" | |
environment "production" | |
stdout_redirect "/var/log/puma/project.log" |
set :repository, "git@bitbucket.org:repo/repo.git" | |
set :user, "deploy" | |
set :use_sudo, false | |
set :scm, :git | |
set :keep_releases, 5 | |
set :domain, "000.000.000.000" | |
set :application, "my_app" | |
set :rails_env, "production" | |
set :branch, "master" | |
set :deploy_to, "/var/www/#{application}" |
#!/bin/bash | |
# Install a custom ElasticSearch version - https://www.elastic.co/products/elasticsearch | |
# | |
# To run this script on SemaphoreCI, add the following command to your project's build setup: | |
# \curl -sSL <RAW_URL_FOR_THIS_SCRIPT> | bash -s | |
# | |
ELASTICSEARCH_VERSION="2.4.6" | |
ELASTICSEARCH_PORT="9250" | |
ELASTICSEARCH_DIR="$SEMAPHORE_PROJECT_DIR/elasticsearch" | |
ELASTICSEARCH_WAIT_TIME="15" |