Skip to content

Instantly share code, notes, and snippets.

View onjin's full-sized avatar

Marek Wywiał onjin

View GitHub Profile
@hayd
hayd / sns-to-slack.py
Created May 5, 2016 06:47
sns to slack aws lambda python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Follow these steps to configure the webhook in Slack:
1. Navigate to https://<your-team-domain>.slack.com/services/new
2. Search for and select "Incoming WebHooks".
@mosquito
mosquito / README.md
Last active March 28, 2025 02:03
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@onjin
onjin / set_wallpaper.sh
Last active July 27, 2023 11:20
set wallpaper by url | directory | file, using hyprpaper | feh | betterlockcreen | print - random or last used
#!/bin/bash
## ---------------------------------------------------------------------------------- ##
## Sets random image as wallpaper, trying remote url, local folder and fallback ##
## image. Then using executor like hyprpaper, feh, betterlockscreen or just prints ##
## found image to the output. ##
## ---------------------------------------------------------------------------------- ##
## https://gist.github.com/onjin/411d7f9c6ebcaf66aa75abe6941bea55
## ---------------------------------------------------------------------------------- ##
## Example usage
@onjin
onjin / supervised_workers.py
Created April 2, 2024 11:47
supervised async python workers
import asyncio
import argparse
import random
from typing import Any
async def worker(name: str, queue: asyncio.Queue[str], stop_event: asyncio.Event):
while not stop_event.is_set() or not queue.empty():
try:
# Try to get an item from the queue without indefinitely blocking
try: