Skip to content

Instantly share code, notes, and snippets.

View jdavidrcamacho's full-sized avatar
🚀
Working

João Camacho jdavidrcamacho

🚀
Working
View GitHub Profile
@jdavidrcamacho
jdavidrcamacho / fluend.conf
Last active January 12, 2026 16:06
fluend.conf
<system>
log_level info
</system>
<source>
@type tail
path /var/log/commands.log
pos_file /var/log/fluentd/commands.pos
tag shell_commands
@jdavidrcamacho
jdavidrcamacho / bash.sh
Last active January 8, 2026 10:21
To add to /etc/bash.bashrc
#########################################
if [ -n "$PS1" ]; then
# Commands logger
if [ -z "$BASH_COMMAND_LOGGER_SET" ]; then
export BASH_COMMAND_LOGGER_SET=1
shopt -s histappend
export HISTTIMEFORMAT="%F %T "
CMD_LOG_FILE="/var/log/commands.log"
LOG_HOST="$(hostname)"
sudo ufw status
sudo ufw allow ssh
sudo ufw enable
sudo ufw deny from 10.50.20.8
sudo ufw deny out to 10.50.20.8
sudo ufw deny from 10.50.20.6
sudo ufw deny out to 10.50.20.6
sudo ufw reload
@jdavidrcamacho
jdavidrcamacho / GA_demo_steps.sh
Last active December 17, 2025 17:09
Steps to perform to collect logs to the GA
# Install fluent-package v6 LTS:
sudo apt update
curl -fsSL https://fluentd.cdn.cncf.io/sh/install-ubuntu-noble-fluent-package6-lts.sh | sudo sh
# Make sure the service is up and running:
sudo systemctl enable --now fluentd
# 1--- In the termina do
sudo touch /var/log/commands.log
sudo touch /var/log/outputs.log
### 2--- Point Fluentd at both files
# Replace the definitions at /etc/fluent/fluentd.conf with this config:
<system>
log_level info
</system>
# Install fluent-package v6 LTS:
sudo apt update
curl -fsSL https://fluentd.cdn.cncf.io/sh/install-ubuntu-noble-fluent-package6-lts.sh | sudo sh
# Make sure the service is up and running:
sudo systemctl enable --now fluentd
@jdavidrcamacho
jdavidrcamacho / timelines_europe.py
Created October 29, 2024 11:27
Timeline of ancient civilizations in europe
import matplotlib.pyplot as plt
# Updated timeline data for European civilizations and periods
timelines_europe = {
# Neolithic Cultures
"Neolithic Cultures": {"start": -7000, "end": -2500, "color": "lightgreen"},
"Cardial Culture": {"start": -6000, "end": -5000, "color": "lightblue"},
"Linear Pottery Culture (LBK)": {
"start": -5500,
"end": -4500,
@jdavidrcamacho
jdavidrcamacho / timelines_fertile_crescent.py
Last active June 22, 2025 16:51
Timeline of ancient civilizations in the fertile crescent
import matplotlib.pyplot as plt
# Updated timeline data with BCE year representation, including all events
timelines_simple = {
# Ubaid Period
"Ubaid Period": {"start": -6500, "end": -3800, "color": "salmon"},
# Sumerian periods
"Early Sumerian Settlement": {"start": -4500, "end": -4000, "color": "skyblue"},
"Uruk Period (Sumerians)": {"start": -4000, "end": -3100, "color": "skyblue"},
"Early Dynastic Period (Sumerians)": {
@jdavidrcamacho
jdavidrcamacho / SciTEGlobal.properties
Created February 21, 2022 11:25
My setting for scite
# Global initialisation file for SciTE
# For Linux, place in $prefix/share/scite
# For Windows, place in same directory as SciTE.EXE (or Sc1.EXE)
# Documentation at http://www.scintilla.org/SciTEDoc.html
# Globals
# Window sizes and visibility
if PLAT_WIN
position.left=0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import matplotlib.pylab as plt
from scipy import stats
myclip_a, myclip_b = -2, 2
my_mean, my_std = 0, 0.5
a, b = (myclip_a - my_mean) / my_std, (myclip_b - my_mean) / my_std
plt.hist(stats.norm(0,0.5).rvs(10000), bins = 100)