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"
#!/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
@reinaldons
reinaldons / gist:851672
Created March 2, 2011 20:26
PostgreSQL - Grouping all client subscriptions and multiply unitary value by quantity only when product ID is not 64
SELECT
client.id,
client.name,
fop.start_effective_date,
fop.end_effective_date,
EXTRACT(month FROM fop.end_effective_date)::integer AS month,
SUM(CASE subscription.product_id WHEN 64 THEN subscription.unit_value ELSE subscription.unit_value * subscription.qty END) AS total
FROM
master
LEFT JOIN