Skip to content

Instantly share code, notes, and snippets.

View reinaldons's full-sized avatar
👾

Reinaldo Nolasco Sanches reinaldons

👾
View GitHub Profile
@reinaldons
reinaldons / jenkins-slave
Last active May 18, 2023 14:43
Arch Linux service for Jenkins Slave via JNLP agent.
JENKINS_HOME="/usr/share/java/jenkins"
LOG="/var/log/slave-jenkins.log"
JENKINS_URL="http://jenkins.url:8080"
SLAVE_COMPUTER="slave_computer_name"
REMOTE_JAR="$JENKINS_URL/jnlpJars/slave.jar"
JNLP_URL="$JENKINS_URL/computer/$SLAVE_COMPUTER/slave-agent.jnlp"
SECRET="YOUR SECRET ON JENKINS"
@reinaldons
reinaldons / .vimrc
Last active January 19, 2022 16:04
My VIM as Python IDE
set nocompatible
filetype off
set dir=~/.vim/tmp//
" Alias
nnoremap <C-Left> :bp<CR>
nnoremap <C-Right> :bn<CR>
" Colors
syntax enable
@reinaldons
reinaldons / views.py
Last active May 9, 2021 01:55
Create CSV on-the-fly with Flask, stream_with_context and SQLAlchemy using generator
from datetime import datetime
from flask import current_app, stream_with_context, Response
from flask_blueprint_acquisition import current_blueprint
from sqlalchemy.sql import compiler
from .blueprints import base_blueprint
from .models import Acquisition, Package, Product, User
@reinaldons
reinaldons / Makefile
Last active June 15, 2020 13:47
Flask + uWSGI + Nginx
PID_FILE = '/tmp/flask_test_uwsgi.pid'
LOG_FILE = '/tmp/flask_test_uwsgi.log'
up:
uwsgi --ini uwsgi.ini --wsgi-file app.py --pidfile $(PID_FILE) --logto $(LOG_FILE) &
down:
uwsgi --stop $(PID_FILE)
@reinaldons
reinaldons / .bash_prompt
Created September 2, 2016 11:46
git + python virtualenv bash PROMPT_COMMAND
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@reinaldons
reinaldons / .bashrc
Last active September 2, 2016 12:08
Append for Kubuntu .bashrc
# autoenv
. /usr/local/bin/activate.sh
. /usr/share/virtualenvwrapper/virtualenvwrapper.sh
. ~/.bash_prompt
export GOROOT=/usr/lib/go-1.6
export PATH=$PATH:$GOROOT/bin

Keybase proof

I hereby claim:

  • I am reinaldons on github.
  • I am reinaldons (https://keybase.io/reinaldons) on keybase.
  • I have a public key whose fingerprint is 5902 BA8F 5386 C10A 8E02 7A52 0AE9 1492 F02C D42C

To claim this, I am signing this object:

#!/usr/bin/env python
import cgi
import urllib
import urllib2
import sys
import cgitb
cgitb.enable()
AMQ_URL = 'http://amq:8161/api/message/healthcheck.xpto?type=queue&clientId=xpto'
#!/usr/bin/env python
import cgi
import urllib
import urllib2
import sys
import cgitb
cgitb.enable()
@reinaldons
reinaldons / partial_flaskr_tests.py
Created May 8, 2013 00:13
MongoDB with no disk file persist
import socket
from time import sleep
import os
import unittest
import tempfile
from subprocess import Popen, PIPE
from flask import url_for
import flaskr