This file contains 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 characters
#! /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' |
This file contains 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 characters
#!/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" |
This file contains 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 characters
#!/bin/sh | |
# chmod a+x remove_css_extension.sh | |
for file in $(find ./app/assets/stylesheets/ -name "*.css.sass") | |
do | |
git mv $file `echo $file | sed s/\.css//` | |
done |
This file contains 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 characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 characters
require 'httparty' | |
class SlackRuby | |
include HTTParty | |
base_uri 'slack.com/api' | |
def initialize(token) | |
@token = token | |
end |
This file contains 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 characters
require 'open-uri' | |
url = 'http://maps.googleapis.com/maps/api/staticmap?center=40.714728,-73.998672&markers=color:0x4E3253%7C40.714728,-73.998672&zoom=15&size=640x640&scale=2&format=png&maptype=roadmap&sensor=false' | |
target = File.join(File.expand_path('../', __FILE__), '/maps.jpg') | |
File.open(target, "wb") do |saved_file| | |
open(url, 'rb') do |read_file| | |
saved_file.write(read_file.read) | |
end | |
end |
This file contains 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 characters
describe Classroom do | |
subject(:classroom) { Classroom.new } | |
context "when the children are rowdy" do | |
before(:each, run: true) do | |
classroom.throw_pizza_party | |
end | |
it "example1", run: :true | |
it "example2" |
This file contains 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 characters
# 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 |
This file contains 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 characters
upstream project { | |
server unix:///var/tmp/project.sock; | |
} | |
server { | |
listen 80 default_server; | |
server_name project.com; | |
return 301 https://$server_name$request_uri; | |
} |
This file contains 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 characters
au BufRead,BufNewFile /opt/nginx/conf/* set ft=nginx |
NewerOlder