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
module LuckyTicket | |
def self.half | |
initial = 0 | |
length = 4 | |
min = 10 | |
max = ('9' * length).to_i | |
luck_ticket = 0 | |
(min..max).each { |value| |
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
Begin; | |
create table public.gastos_diretos( | |
Codigo_Orgao_Superior text, | |
Nome_Orgao_Superior text, | |
Codigo_Orgao text, | |
Nome_Orgao text, | |
Codigo_Unidade_Gestora text, | |
Nome_Unidade_Gestora text, | |
Codigo_Grupo_Despesa text, | |
Nome_Grupo_Despesa text, |
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
for i in {01..12} ; do | |
wget --content-disposition "http://arquivos.portaldatransparencia.gov.br/downloads.asp?a=2015&m=$i&consulta=GastosDiretos" | |
done | |
unzip \*.zip -d extraidos | |
for f in *.csv ; do | |
FILE="$f" | |
tail -n +2 "$FILE" > "$FILE.tmp" && mv "$FILE.tmp" "$FILE" ; 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
FROM postgres | |
FROM memcached | |
FROM python:2 | |
RUN apt-get update -y | |
RUN apt-get install -y vim | |
RUN mkdir /site/ | |
WORKDIR /site/ |
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
askbot | |
psycopg2 | |
python-memcached |
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
docker build -t askbot . | |
docker run --name postgres -e POSTGRES_PASSWORD=askbot -e POSTGRES_USER=askbot -e POSTGRES_DB=askbot -d postgres | |
docker run --name memcached -d memcached | |
docker run --name askbot -t -i --link memcached --link postgres -d askbot | |
sleep 7 | |
docker exec askbot python manage.py syncdb --noinput | |
docker restart askbot |
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 | |
cd /srv/ | |
rm -rf * | |
cd /usr/local/share/ca-certificates/ | |
rm -rf * | |
cd /etc/docker/certs.d/ | |
rm -rf * |
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
#Gilabci. Executar dentro do container | |
mkdir -p /etc/gitlab/ssl/ && \ | |
chmod 700 /etc/gitlab/ssl && \ | |
openssl req \ | |
-newkey rsa:4096 -nodes -sha256 -keyout /etc/gitlab/ssl/gitlabci.key \ | |
-x509 -days 3650 -out /etc/gitlab/ssl/gitlabci.crt && \ | |
vim /etc/gitlab/gitlab.rb | |
gitlab-ctl reconfigure && gitlab-ctl restart |
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
version: '2' | |
services: | |
gitlabci: | |
image: 'gitlab/gitlab-ce:latest' | |
restart: always | |
hostname: 'gitlabci' | |
container_name: gitlabci | |
environment: | |
GITLAB_OMNIBUS_CONFIG: | | |
external_url 'https://gitlabci' |
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
If you think you want to create a daemon process you should ask yourself one basic question: Does this process need to stay responsive forever? | |
If the answer is no then you probably want to look at a cron job or background job system. If the answer is yes, then you probably have a good candidate for a daemon process. |
OlderNewer