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
grep -nir "THE WORD" access.log.* | grep -viE "bing|googlebot|POST|javascript|static|baidu|HEAD" | grep -oE "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" |sort |uniq |
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
import org.vertx.groovy.core.http.RouteMatcher | |
import java.util.concurrent.atomic.AtomicLong | |
def counterMap = vertx.getSharedData().getMap("demo.mymap") | |
counterMap.put('bvs', 0) | |
def verticleId = new Random().nextInt(10 ** 20) | |
def logger = container.logger |
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
f = storage.open(file_path, 'r') | |
image = Image.open(f) | |
width, height = image.size | |
if width > height: | |
delta = width - height | |
left = int(delta/2) | |
upper = 0 | |
right = height + left | |
lower = height | |
else: |
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
proxy: | |
image: dockerfile/nginx | |
volumes: | |
- ./nginx/:/etc/nginx/sites-available/ | |
- /var/log/nginx:/var/log/nginx | |
links: | |
- web | |
ports: | |
- "80:80" | |
db: |
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
FROM python:2.7.8 | |
ENV PYTHONUNBUFFERED 1 | |
RUN mkdir /code | |
WORKDIR /code | |
ADD requirements.txt /code/ | |
RUN pip install -r requirements.txt |
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
server { | |
listen 80 default_server; | |
server_name _; # This is just an invalid value which will never trigger on a real hostname. | |
error_log /proc/self/fd/2; | |
access_log /proc/self/fd/1; | |
return 503; | |
} | |
{{ range $host, $by_host := groupByMulti $ "Env.VIRTUAL_HOST" ","}} | |
{{ range $context, $containers := groupByMulti $by_host "Env.WEB_CONTEXT" "," }} |
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
class Comment(models.Model): | |
ON_LINE = 'ON_LINE' | |
DELETED = 'DELETED' | |
MODERATED = 'MODERATED' | |
STATUS = ( | |
(ON_LINE, 'On Line'), | |
(MODERATED, 'Moderated'), | |
(DELETED, 'Deleted'), | |
) | |
status = models.CharField(max_length=10, choices=STATUS, default=ON_LINE) |
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
[uwsgi] | |
http=:8000 | |
module=projetob.wsgi | |
master=1 | |
pidfile=/tmp/project-master.pid | |
harakiri=20 | |
max-requests=5000 | |
processes=3 | |
route-host = ^www\.(.*) redirect-permanent:http://tendencia.me${REQUEST_URI} | |
route = /robots.txt static:/code/robots.txt |
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
//... | |
self.attachRescuer = function(rescuerSocket, rescuer) { | |
//... | |
self.rescueToClientSiphon = new Siphon(self.rescuerSocket, self.clientSocket); | |
self.rescueToClientSiphon('fire', 'fired', self.validateFire); | |
//... | |
} | |
//... |
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
open Unix | |
open Printf | |
open Cmdliner | |
open ANSITerminal | |
let rec do_deploy domain delay host = | |
let cmd = sprintf [cyan; on_blue] "fabric app.deploy -H %s.%s\n" host domain in | |
print_string [cyan; on_blue] cmd; | |
match Unix.system cmd with | |
| WEXITED i -> printf [yellow; on_blue] "Done %s" cmd |
OlderNewer