Skip to content

Instantly share code, notes, and snippets.

View pancudaniel7's full-sized avatar
🎯
Focusing

Daniel pancudaniel7

🎯
Focusing
View GitHub Profile
@pancudaniel7
pancudaniel7 / decode_jwt.sh
Last active February 25, 2025 15:21
Decode JWT + convert timestamp to date
# You can add this to your .bashrc or .zshrc
function decode_jwt {
echo "$1" | jq -R '
split(".") |
.[1] |
gsub("-"; "+") | gsub("_"; "/") | @base64d |
fromjson |
(if .iat then .iat = (.iat | todate) else . end) |
(if .exp then .exp = (.exp | todate) else . end)
@pancudaniel7
pancudaniel7 / docker_clean.sh
Last active December 3, 2024 10:02
Docker clean bash function
#!/bin/bash
# define the function
function docker_clean {
echo "Start cleaning..."
process_count=$(docker ps -q | wc -l)
if [ "$process_count" -ne "0" ]; then
docker kill $(docker ps -q) > /dev/null
echo "$process_count process/es had been clean"
@pancudaniel7
pancudaniel7 / 1-setup.md
Created November 19, 2024 11:26 — forked from troyfontaine/1-setup.md
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@pancudaniel7
pancudaniel7 / system-design-thinking.md
Last active October 5, 2024 11:26
System Design Thinking

System Design Thinking Guide

1. Clarify Requirements

  • Understand the exact requirements of the system.
  • Ask clarifying questions to make sure you know what the interviewer expects. For example, is the focus on scalability, availability, or fault tolerance?
  • Determine functional and non-functional requirements (e.g., performance, security, reliability).

2. Estimate Scale

  • Estimate the scale the system needs to handle (e.g., users per day, read/write operations per second, storage size).
@pancudaniel7
pancudaniel7 / business-cases.md
Created April 27, 2024 09:17
Business Cases

I will need you to createa .md downloadable file with the title How our product solves the problem? We will make a list of business cases:

  1. Invitation creation
  • Event owner can design the basic virtual invitation using template
  • Advance customisation of the invitation (Editor)
  • Visualization of the final invitation UI app
  • Invitation preferences like (sms reminder)
  • GDPR consent before collecting quests PII (personal identification information)
  • Service payment
@pancudaniel7
pancudaniel7 / business-plan.md
Last active June 1, 2024 09:47
Business Plan

Final Business Plan for Virtual Event Invitation SaaS

Introduction

Our SaaS platform revolutionizes the traditional approach to wedding invitations by introducing a digital, eco-friendly, and highly customizable solution that addresses the specific needs of modern couples and event planners. The service simplifies the process of invitation management while offering personalized experiences for each guest.

1. The Problem We Are Solving

Traditional wedding invitations are often expensive, time-consuming to distribute, and not environmentally sustainable. They also lack flexibility in managing RSVPs and communicating updates or changes to guests efficiently.

2. Solution: Virtual Event Invitation SaaS

#!/bin/bash
# List running Docker containers
echo "Running Docker containers:"
docker ps --format "table {{.Names}}\t{{.Image}}\t{{.ID}}" | nl -w2 -s': '
# Ask the user to select a container
echo "Enter the number of the container you want to bash into:"
read container_number
#!/bin/bash
# Size of each log message
LOG_MESSAGE_SIZE=100000
# Function to rapidly log messages
function log_messages {
for i in {1..100000}; do
LOG_MESSAGE=$(head -c "$LOG_MESSAGE_SIZE" /dev/urandom | tr -dc 'A-Za-z0-9')
#!/usr/bin/bash
echo "Reloading systemd daemon..."
sudo systemctl daemon-reload
echo "Enabling and starting the logrotate timer..."
sudo systemctl enable --now log_size_check.timer
echo "Checking the status of the timer..."
sudo systemctl status log_size_check.timer
#!/usr/bin/bash
# Logrotate Configuration
echo "Setting up Logrotate configuration for your application..."
sudo cat <<EOF > /etc/log_size_check.conf
/var/log/syslog {
su root root
size 100M
copytruncate
rotate 30