Skip to content

Instantly share code, notes, and snippets.

View c-neto's full-sized avatar
🚀

Carlos Neto c-neto

🚀
View GitHub Profile
@c-neto
c-neto / Dockerfile
Last active October 18, 2023 17:50
Dockerfile Cheatsheet
# Stage for image creation for production
FROM maven:3-jdk-8 as builder
WORKDIR /app
# Setting the project's working directory for dependency installation
COPY application .
# Installing dependencies
RUN mvn -DskipTests=true clean
@c-neto
c-neto / clone-all-repos-github.sh
Last active May 25, 2024 23:06
Bash script for cloning all GitHub repositories associated with a specific user, provided as an argument.
#!/bin/bash
# Cloning all GitHub repositories belonging to a specific user provided as an argument.
#
# Command Execution Example:
# ./clone-all-repos-github.sh <USERNAME>
#
# Arguments:
# <USERNAME> GitHub username whose repositories will be cloned.
#
@c-neto
c-neto / crop-images.py
Created May 13, 2021 21:38
Crop mulit images files
# rerquirements.txt
# pillow
from pathlib import Path
from PIL import Image
base_converted = Path('./converted')
base_path = Path('./images')
left = 0
# simple example to echo button message content in slack interactive messages
# requires:
# slack_sdk
# flask
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
from slack_sdk import WebClient
from flask import Flask, request
import json
@c-neto
c-neto / sha512-salt.py
Last active October 18, 2023 17:39
Generate hash SHA-512 with salt
# requires: pip install passlib
from passlib import hash
x = hash.sha512_crypt.hash("carlos", salt="neto", rounds=5000)
y = hash.sha512_crypt.hash("carlos", salt="xxx", rounds=5000)
print(hash.sha512_crypt.verify("carlos", x))
# >>> true
@c-neto
c-neto / kubernetes-cheatsheet.md
Last active May 19, 2024 00:47
Kubernetes Cheatsheet

ConfigMaps

apiVersion: v1
kind: ConfigMap
metadata:
  name: my-configmap
data:
  # The API URL for the app to use
  API_URL: "https://api.example.com"
@c-neto
c-neto / download-youtube-channels.sh
Created May 19, 2024 00:42
Bash Script to Download Entire YouTube Channels
#!/bin/bash
set -eu pipefail # Set options for the shell
IFS=$'\n' # Set the Internal Field Separator to newline
# Array containing URLs of YouTube channels
CHANNEL_URLS=(
'https://www.youtube.com/@foo'
'https://www.youtube.com/@bar'
)