Skip to content

Instantly share code, notes, and snippets.

View RoseSecurity's full-sized avatar
🏠
Moved to GitLab

RoseSecurity

🏠
Moved to GitLab
View GitHub Profile
@RoseSecurity
RoseSecurity / elasticsearch-provider.tf
Last active December 7, 2023 19:06
A comprehensive way to interact with Elasticsearch's Terraform provider
terraform {
required_version = ">= 1.5.5"
required_providers {
elasticstack = {
source = "elastic/elasticstack"
version = ">= 0.9.0"
}
}
}
@RoseSecurity
RoseSecurity / Dockerfile
Last active November 16, 2023 20:06
This script creates a basic Flask web application that serves a fake HTML page at the root route /. It has additional routes for /healthz and /callback. The /healthz route returns a simple "Healthy" response for healthchecks. The main logic is in the /callback route. It checks the request User-Agent header and if it exactly matches a specific Ch…
FROM python:3.12-slim
WORKDIR /redirector_app
# Copy the current directory contents
ADD . /redirector_app
# Install flask
RUN pip install flask
@RoseSecurity
RoseSecurity / reddit-feed.py
Created November 8, 2023 14:45
A simple Python utility that harnesses Reddit's API to create custom feeds for your Streamlit application.
#!/usr/bin/env python3
import streamlit as st
import praw
# Instantiate bot
reddit = praw.Reddit(client_id=st.secrets["CLIENTID"],
client_secret=st.secrets["CLIENTSECRET"],
user_agent='Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36',
username=st.secrets["USERNAME"],
@RoseSecurity
RoseSecurity / jira-precommit.py
Created October 27, 2023 16:53
This Python code uses the Jira API to create a new issue from the last Git commit message. It can be used as a precommit hook to create Jira tickets from Git commit history.
#!/usr/bin/env python3
from jira import JIRA
import subprocess
# Set your Jira server URL, Email, and API token
email = ""
server_url = ""
api_token = ""