Skip to content

Instantly share code, notes, and snippets.

Avatar

Rubin Raithel Coronon

View GitHub Profile
View goa_autossh.service
[Unit]
Description=AutoSSH tunnel
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -q -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 901:localhost:22 -i /etc/ssh/goa_key goa@swc-blokus.net
[Install]
WantedBy=multi-user.target
@Coronon
Coronon / wsLogoutDecorator.py
Created Dec 28, 2020
Django Channels Websocket logout handler (Handles all logout throughout the app)
View wsLogoutDecorator.py
import functools
from asgiref.sync import async_to_sync
from django.contrib.auth.signals import user_logged_out
from channels.layers import get_channel_layer
def __ws_login_required_signal_handler(sender, request, user, **kwargs):
print(request.session.session_key)
channel_layer = get_channel_layer()
async_to_sync(channel_layer.group_send)(f"SESSION-{request.session.session_key}", {"type": "close", "code": None})
user_logged_out.connect(__ws_login_required_signal_handler, dispatch_uid="__ws_login_required_signal_handler")
@Coronon
Coronon / RRRLib.rkt
Last active Aug 17, 2020
My personal little scheme lib to make my life easier
View RRRLib.rkt
;MIT License
;
;Copyright (c) 2020 Rubin Romeo Raithel
;
;Permission is hereby granted, free of charge, to any person obtaining a copy
;of this software and associated documentation files (the "Software"), to deal
;in the Software without restriction, including without limitation the rights
;to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
;copies of the Software, and to permit persons to whom the Software is
;furnished to do so, subject to the following conditions:
View cloudSettings
{"lastUpload":"2020-11-12T22:04:58.039Z","extensionVersion":"v3.4.3"}
@Coronon
Coronon / NamedPipe.py
Last active Oct 3, 2019
Easy NamedPipe for Windows written in python3
View NamedPipe.py
import win32pipe, win32file
class PipeServer():
def __init__(self, pipeName):
self.pipe = win32pipe.CreateNamedPipe(
r'\\.\pipe\\'+pipeName,
win32pipe.PIPE_ACCESS_OUTBOUND,
win32pipe.PIPE_TYPE_MESSAGE | win32pipe.PIPE_READMODE_MESSAGE | win32pipe.PIPE_WAIT,
1, 65536, 65536,
0,
@Coronon
Coronon / AesCrypt.py
Created Jun 8, 2018 — forked from pfote/AesCrypt.py
AES256 with PKCS5 padding
View AesCrypt.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Crypto.Cipher import AES
import base64
import random
import hashlib
import os
class AesCrypt256: