Skip to content

Instantly share code, notes, and snippets.

@fxpires
fxpires / coldfusion_password.py
Created August 7, 2020 14:59 — forked from patrickrbc/coldfusion_password.py
Script to decrypt coldfusion database passwords
#!/usr/bin/python
#
# Coldfusion Password Tool
# Copyright (C) 2013 Adam Boeglin <adamrb@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@fxpires
fxpires / kibana.service
Created July 26, 2020 22:05
Kibana 7 Systemd Unit (installed on /opt/kibana)
[Unit]
Description=Kibana
After=network.target
[Service]
User=elasticsearch
ExecStart=/opt/kibana/bin/kibana
Type=simple
PIDFile=/var/run/kibana.pid
Restart=always
@fxpires
fxpires / DJANGO_TWISTED_HAPROXY.md
Created March 12, 2020 20:54 — forked from sspross/DJANGO_TWISTED_HAPROXY.md
Serving Django and Twisted using HAproxy

Serving Django and Twisted using HAproxy

Why?

Because we wanted to achive the following while developing a webapp using websockets:

Static serving (nginx), Django application (gunicorn) and Websockets service (twisted)

  • on the same IP
@fxpires
fxpires / git-ssh-auth-win-setup.md
Created February 14, 2020 18:52 — forked from bsara/git-ssh-auth-win-setup.md
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@fxpires
fxpires / kubernetes_service_session_affinity.md
Created January 30, 2020 12:58 — forked from fjudith/kubernetes_service_session_affinity.md
Enable Session Affinity (a.k.a Sticky Session) to Kubernetes service
@fxpires
fxpires / kubedf
Created December 12, 2019 19:43 — forked from redmcg/kubedf
Bash script to show k8s PVC usage
#!/usr/bin/env bash
KUBEAPI=127.0.0.1:8001/api/v1/nodes
function getNodes() {
curl -s $KUBEAPI | jq -r '.items[].metadata.name'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
@fxpires
fxpires / sqlalchemy_mysql_binary_uuid.py
Created December 5, 2019 19:16 — forked from craigdmckenna/sqlalchemy_mysql_binary_uuid.py
SQLAlchemy, MySQL 16 bit UUID, Custom Data Type
import UUID
from sqlalchemy.dialects.mysql import BINARY
from sqlalchemy.types import TypeDecorator
class BinaryUUID(TypeDecorator):
'''Optimize UUID keys. Store as 16 bit binary, retrieve as uuid.
inspired by:
http://mysqlserverteam.com/storing-uuid-values-in-mysql-tables/
@fxpires
fxpires / newcert.py
Created November 28, 2019 20:59 — forked from Zeerg/newcert.py
Python script to generate CSR/Self Signed Cert. Needs pyOpenssl and python-whois
#!/usr/bin/python
from OpenSSL import crypto
import os
import sys
import datetime
import whois
#Variables
TYPE_RSA = crypto.TYPE_RSA
TYPE_DSA = crypto.TYPE_DSA
@fxpires
fxpires / jboss-log-compression.sh
Created October 26, 2018 14:38
JBoss/Wildfly Log compression. Compress both server.log and access_log (if exists). Ignores already compressed logs in gz or xz formats
# Server log compression
find /opt/jboss/standalone/log -maxdepth 1 -type f -name 'server.log.*' -not -name '*xz' -not -name '*gz' -exec xz -3 {} \;
# default-host log compression
test -d /opt/jboss/standalone/log/default-host && find /opt/jboss/standalone/log/default-host -type f -mtime +0 -not -name '*xz' -exec xz -3 {} \;
@fxpires
fxpires / recompress.sh
Created October 26, 2018 14:29
recompress all gzip in current dir files as xz files, keeping the timestamps / recomprime arquivos no diretório atual, de gz para xz, mantendo os timestamps
#!/bin/bash
for FILE in *gz
do
gunzip ${FILE}
UNFILE=${FILE%.*}
xz -3vv ${UNFILE}
done