Skip to content

Instantly share code, notes, and snippets.

View amcorreia's full-sized avatar
🎯
Focusing

Alessandro Madruga Correia amcorreia

🎯
Focusing
  • Depressive world
View GitHub Profile
acl ytb_dom dstdomain .youtube.com .ytimg.com
acl ytb_video_re url_regex -i aoiP-WK3V8o generate_204 videoplayback watch_as3-vflqEsLb3.swf
redirector_access deny ytb_dom ytb_video_re
http_access allow ytb_dom ytb_video_re
acl ytb_css url_regex -i \.css $ \.js $ \.jpg $
redirector_access deny ytb_css ytb_dom
http_access allow ytb_css ytb_dom
@amcorreia
amcorreia / php-smart-quotes.php
Created February 6, 2016 00:26
Convert smart single quotes to straight single quotes
<?php
function replace_curly_to_straight_quotes($str) {
return preg_replace("/[\x{2018}\x{2019}\x{201A}\x{203A}\x{201B}\x{2032}\x{2035}\x{2039}]/u", "'", $str);
}
?>
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
#Check if you have the good Vagrant version to use docker provider...
Vagrant.require_version ">= 1.6.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
FROM debian
MAINTAINER Alessandro Madruga Correia "mutley.sandro@gmail.com"
RUN echo 'Acquire::http::Proxy "http://172.17.42.1:3142"; ' > /etc/apt/apt.conf.d/01proxy
RUN apt-get update
RUN apt-get install -y openssh-server sudo
EXPOSE 22
@amcorreia
amcorreia / nginx.conf
Last active August 29, 2015 14:06 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# cat sciencevpn.sh
#!/bin/bash
ARGC=$#
if [[ "$ARGC" -lt "1" ]]; then
echo "Usage: $0 [on|off]"
exit 0;
fi
ENV=env
SRC_CORE=src
CLOC=$(shell which cloc)
test-all: clean pep8 cloc init-coverage test-unit test-functionnal test-integration report-coverage flake8 lint clone
pep8:
$(ENV)/bin/pep8 --max-line-length=99 $(SRC_CORE) > pep8.log || :
Baixar o jenkins-cli
# wget http://192.168.1.203:8080/jnlpJars/jenkins-cli.jar
Copiar a configuração de um job
# java -jar jenkins-cli.jar -s http://192.168.1.203:8080/ get-job JOB > job.xml
@amcorreia
amcorreia / jenkins-slave
Created May 21, 2014 03:18
jenkins-slave
For python slave
# apt-get install default-jre build-essential linux-headers-$(uname -r) screen git python-dev python-virtualenv libffi-dev sloccount
# useradd -m jenkins
# su - jenkins -c 'mkdir /home/jenkins/.ssh'
# su - jenkins -c 'vim /home/jenkins/.ssh/authorized_keys2'