Skip to content

Instantly share code, notes, and snippets.

@fxpires
fxpires / coldfusion_password.py
Created Aug 7, 2020 — forked from patrickrbc/coldfusion_password.py
Script to decrypt coldfusion database passwords
View coldfusion_password.py
#!/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 Jul 26, 2020
Kibana 7 Systemd Unit (installed on /opt/kibana)
View kibana.service
[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 Mar 12, 2020 — forked from sspross/DJANGO_TWISTED_HAPROXY.md
Serving Django and Twisted using HAproxy
View DJANGO_TWISTED_HAPROXY.md

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 Feb 14, 2020 — forked from bsara/git-ssh-auth-win-setup.md
Setup SSH Authentication for Git Bash on Windows
View git-ssh-auth-win-setup.md

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 Jan 30, 2020 — forked from fjudith/kubernetes_service_session_affinity.md
Enable Session Affinity (a.k.a Sticky Session) to Kubernetes service
View kubernetes_service_session_affinity.md
@fxpires
fxpires / kubedf
Created Dec 12, 2019 — forked from redmcg/kubedf
Bash script to show k8s PVC usage
View kubedf
#!/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 Dec 5, 2019 — forked from craigdmckenna/sqlalchemy_mysql_binary_uuid.py
SQLAlchemy, MySQL 16 bit UUID, Custom Data Type
View sqlalchemy_mysql_binary_uuid.py
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 Nov 28, 2019 — forked from Zeerg/newcert.py
Python script to generate CSR/Self Signed Cert. Needs pyOpenssl and python-whois
View newcert.py
#!/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 Oct 26, 2018
JBoss/Wildfly Log compression. Compress both server.log and access_log (if exists). Ignores already compressed logs in gz or xz formats
View jboss-log-compression.sh
# 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 Oct 26, 2018
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
View recompress.sh
#!/bin/bash
for FILE in *gz
do
gunzip ${FILE}
UNFILE=${FILE%.*}
xz -3vv ${UNFILE}
done
You can’t perform that action at this time.