Skip to content

Instantly share code, notes, and snippets.

View filipecifali's full-sized avatar

Filipe Cifali Stangler filipecifali

  • Porto Alegre / RS / Brasil
  • 01:00 (UTC -03:00)
View GitHub Profile
✘ filipe@shogoki  ~ 
❯ docker run --rm -it python:3.6 [15:20:01]
Python 3.6.15 (default, Dec 21 2021, 12:03:22)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
^[[A%
filipe@shogoki  ~ 
❯ docker run --rm -it python:3.7 [15:20:03]
Python 3.7.16 (default, May 23 2023, 14:39:21)
def descreve_numero(n):
numeros = {
0: [
'zero',
'um',
'dois',
'tres',
'quatro',
'cinco',
'seis',
#!/bin/bash
set -e
BLOCK="==============================="
DATE=`date +%d-%m-%Y`
CNAME=ansible_db_pg_1
VNAME=ansible_db_pg
PG_VERSIONS=(9.3 9.4 9.5 9.6 10.11 11.6)
PG_NOF_VERSIONS=${#PG_VERSIONS[@]}
>>> import io
>>> text = '''(#) 99) A conduta suicida tem sido cada vez mais compreendida como um importante problema dentro da comunidade acadêmica dos estudantes de medicina e da classe profissional dos
... médicos, percebidos atualmente como dois grupos de risco, com taxas de suicídio que
... podem alcançar até o dobro da população geral. Entre as medicações disponíveis para
... prevenir o suicídio, uma se destaca por sua comprovada ação antisuicida. Que medicação é
... essa?
... (/#)
... (>) Fluoxetina
... (>)
... (>)

Keybase proof

I hereby claim:

  • I am filipecifali on github.
  • I am filipecifali (https://keybase.io/filipecifali) on keybase.
  • I have a public key whose fingerprint is 87D0 99C9 849D 0597 91F4 91C3 DE95 B358 42BB 918B

To claim this, I am signing this object:

@filipecifali
filipecifali / Dockerfile
Created February 27, 2019 14:22
Docker for go dev and prod
FROM golang:1.11 as base
ENV GOPATH "$GOPATH:/"
COPY ./src /src
WORKDIR /src
RUN go get github.com/gorilla/mux
RUN go get github.com/getsentry/raven-go
RUN go build server.go
@filipecifali
filipecifali / main.yml
Created November 5, 2018 12:29
roles/monit/tasks/main.yml
---
- name: get installed packages
package_facts: {}
- name: checking if monit version differs
debug: "msg='Version {{ monit_full_version }} is not installed, only {{ (ansible_facts.packages.monit | map(attribute='version')) | join(', ') }}'"
changed_when: true
when: monit_full_version not in (ansible_facts.packages.monit | map(attribute='version'))
register: monit_installed_version
@filipecifali
filipecifali / nginx.conf
Created September 3, 2018 20:40
nginx template
# Flask APP 1
upstream app_{{ core_version }}_{{ item }} {
server unix://{{ core_app_var_dir }}/gunicorn.socket;
}
# Flask APP 2
upstream app_{{ auth_version }}_{{ item }} {
server unix://{{ auth_app_var_dir }}/gunicorn.socket;
}
@filipecifali
filipecifali / httpd.conf
Created July 26, 2018 17:24
letsencrypt apache/httpd 2 rewrite
<Directory /usr/share/zabbix>
RewriteEngine On
RewriteBase /
# Dont redirect on challenges
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} ^/.well-known/acme-challenge
RewriteRule ^(.*) - [R=301,L]
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge
@filipecifali
filipecifali / NotSoSimpleHTTPServer.py
Created July 13, 2018 12:26
To support pretty URL rewriting and using python(2|3)
### Usage: python custom_server.py $PORT $DIR
# i.e.: python custom_server 8000 public/new
import platform
if platform.python_version()[0] == '3':
from http.server import SimpleHTTPRequestHandler as SHRH
from socketserver import TCPServer
elif platform.python_version()[0] == '2':
from SimpleHTTPServer import SimpleHTTPRequestHandler as SHRH
from SocketServer import TCPServer