Skip to content

Instantly share code, notes, and snippets.

View denzuko's full-sized avatar
💬
twitter.com/denzuko

Dwight Spencer denzuko

💬
twitter.com/denzuko
View GitHub Profile
@adulau
adulau / malicious-captcha.md
Last active September 26, 2024 07:19
Malicious captcha for Windows user

Email received

Hey there!

We have detected a security vulnerability in your repository. Please contact us at https://github-scanner.com to get more information on how to fix this issue.

Best regards,
Github Security Team
import logging
from airflow import DAG
from datetime import datetime, timedelta
from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow.operators.python import PythonOperator
# Change these to your identifiers, if needed.
POSTGRES_CONN_ID = "postgres_default"
@scyto
scyto / docker-swarm-architecture.md
Last active April 25, 2025 21:04
My Docker Swarm Architecture

This (and related gists) captures how i created my docker swarm architecture. This is intended mostly for my own notes incase i need to re-creeate anything later! As such expect some typos and possibly even an error...

Installation Step-by-Step

Each major task has its own gist, this is to help with maitainability long term.

  1. Install Debian VM for each docker host
  2. install Docker
  3. Configure Docker Swarm
  4. Install Portainer
  5. Install KeepaliveD
  6. Using VirtioFS backed by CephFS for bind mounts (migrating from glsuterFS - WIP)
@Gavinok
Gavinok / sqlval.troff
Last active January 29, 2021 23:53
demo tsql a troff preprocessor for using sqlite in troff
.\" cat THISFILE | tsql | tbl | groff -Tpdf > THISFILE.pdf
Store info
.sqldb :memory:
.sqlbeg
create table Fam (
name text,
id integer
primary key
@sairamkrish
sairamkrish / docker-compose.yml
Last active October 30, 2024 18:00
Airflow - Docker swarm setup
version: "3.8"
# This should give a high level idea of the approach.
# The complete solution is too complex and involves multiple internal microservices.
# I have tried to capture core things to consider while some else needs to achieve Docker swarm based auto scalout of workers.
services:
webserver:
image: customized/airflow:prod
environment:
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.hooks.base_hook import BaseHook
from airflow.utils.dates import days_ago
default_args = {
'start_date': days_ago(2)
}
dag = DAG('test-connection-hook', default_args = default_args, description='Test connection details', schedule_interval='@once')
@prabhu
prabhu / git-protect.tf
Created July 18, 2020 13:52
Protect github branches, mandate status checks with Terraform
# Protect the master branch. Enforce that ci/tests and shiftleft should pass to allow merges
# Allow PR to be dismissed by sem-user and managers team
resource "github_branch_protection" "protect_master" {
repository = "${github_repository_name}"
branch = "master"
enforce_admins = true
require_signed_commits = false
required_status_checks {
strict = false
@ustropo
ustropo / api.py
Created March 27, 2020 00:11
Exemplo de configuração de API usando Python Eve
from eve import Eve
from .sensor_manager import TempSensorManager
# API configuration
SETTINGS = {
'DOMAIN': {
'sensors': {
'schema': {
'_id': {'type': 'string', 'unique': True},
@FBosler
FBosler / code.py
Created February 21, 2020 18:43
functools.py
from functools import lru_cache
from datetime import datetime
@lru_cache(maxsize=None)
def fib_cache(n):
if n < 2:
return n
return fib_cache(n-1) + fib_cache(n-2)
def fib_no_cache(n):
Apus Agate Adjacent
Aquila Almandine Adjunct
Aries Amber Almuten
Bootes Amethyst Angular
Caelum Apatite Apside
Cancer Aquamarine Arcing
Canis Azurite Ascendant
Cepheus Beryl Aspecting
Cetus Carnelian Beheld
Corona Chalcedony Benefic