Skip to content

Instantly share code, notes, and snippets.

View jdavidrcamacho's full-sized avatar
🚀
Working

João Camacho jdavidrcamacho

🚀
Working
View GitHub Profile
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 12, 2025 14:17
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)
import numpy as np
#np.random.seed(101111)
import matplotlib.pyplot as plt
plt.close('all')
from tedi import utils
def SamplingSun(initFile, finalFile, timespan, observationsNumber,
planet = False, planetParams = [], saveFile = True):
""" Parameters:
initFile = cleaned SunAsAStar file
import numpy as np
import matplotlib.pylab as plt
plt.close('all')
def vanEck(n):
#starts at 0
vanEck = np.array([0])
#first value is 0
i=vanEck[0]
while i < n: