Skip to content

Instantly share code, notes, and snippets.

View circuitsacul's full-sized avatar

circuitsacul

View GitHub Profile
@scyto
scyto / docker-swarm-architecture.md
Last active April 17, 2025 19:52
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)
@circuitsacul
circuitsacul / lazy_converter_list.py
Last active January 14, 2022 23:25
Quickly convert values of large lists.
# example:
range_of_ints = range(0, 500_000_000_000_000)
squared_ints = LazyList(range_of_ints, lambda v: v**2)
print(len(squared_ints) == len(range_of_ints)) # -> True
print(squared_ints) # -> LazyList([0, 1, 4, 9, 16, ..., 249999999999999000000000000001])
print(squared_ints[55:100]) # -> LazyList([3025, 3136, 3249, 3364, 3481, ..., 9801])
print(squared_ints[500]) # -> 250000
@linuswillner
linuswillner / psa.md
Last active May 30, 2022 01:43
Public service announcement from The Coding Den staff about social engineering being utilised as an attack vector for server takeovers

Today, on the 27th of March 2021, The Coding Den was subjected to a social engineering attack that lead to a brief hostile takeover of the server before the situation was brought under control by staff. We are sharing this statement as a public service announcement on the methodology used in the scam and possible remediations to prevent it, in order to help other staff teams avoid becoming victims of it.

Methodology

The attack proliferates as follows:

  1. The attacker will look for a staff member who is presently offline. This will ensure that it appears as if the staff member's account was globally banned and forcefully booted offline.
  2. It is within the attacker's interest to choose a target with the highest possible privileges (to do the maximum amount of damage), meaning that they will likely prefer administrators over moderators and so forth.
  3. The attacker will create a new Discord account with the same name and profile picture as the target.
  4. The attacker will approach a staff member, claiming
@Vexs
Vexs / emoji_map.json
Last active April 16, 2025 07:19
Discord emoji mapping. This is a JSON file! Please load it with json. Attempting to copy-paste it directly into python will not work! For diversity, see: https://gist.github.com/Vexs/9e4c14d41161590ca94d0d21e456fef0
{
"grinning": "\ud83d\ude00",
"smiley": "\ud83d\ude03",
"smile": "\ud83d\ude04",
"grin": "\ud83d\ude01",
"laughing": "\ud83d\ude06",
"satisfied": "\ud83d\ude06",
"face_holding_back_tears": "\ud83e\udd79",
"sweat_smile": "\ud83d\ude05",
"joy": "\ud83d\ude02",
@delivrance
delivrance / ainput.py
Last active June 13, 2024 09:18
Python async input
import asyncio
from concurrent.futures import ThreadPoolExecutor
async def ainput(prompt: str = "") -> str:
with ThreadPoolExecutor(1, "AsyncInput") as executor:
return await asyncio.get_event_loop().run_in_executor(executor, input, prompt)
async def main():