Skip to content

Instantly share code, notes, and snippets.

@timopb
timopb / https-server.py
Last active August 20, 2023 19:22
Very basic HTTPS Server in Python (3.10)
import http.server
import ssl
import os
host = 'localhost'
port = 443
folder = 'wwwroot'
def main():
pwd = os.getcwd()
@artizirk
artizirk / xinput.py
Last active March 22, 2024 07:34
Pure Python implementation for reading Xbox controller inputs without extra libs
#!/usr/bin/env python3
""" XInput Game Controller APIs
Pure Python implementation for reading Xbox controller inputs without extra libs
Copyright (C) 2020 by Arti Zirk <arti.zirk@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted.
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active July 21, 2024 13:03
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

Note

If you want to use pure WSLg, you can try the new WSLg tutorial.

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc) and tigervnc-standalone-server.

For this setup, I will use Ubuntu (20.04, 22.04 and 24.04 are working), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

@op183
op183 / main.swift
Last active July 2, 2022 03:48
Echo UDP Server written in pure Swift
import Darwin
import Dispatch
class EchoUDPServer {
// syncQueue help us print and read/write safely from our internal storage
// while running, the main queue is blocking with readLine()
private let syncQueue = DispatchQueue(label: "syncQueue")
@ludoo0d0a
ludoo0d0a / gist:8d0cfd1cab22598cb5d8
Created June 11, 2015 18:54
Synology boot locked
Sometimes after a hard reboot (power cut), if your synology cannot be logged in with DSM and it shows "System is getting ready. Please log in later" , please do these steps :
#Admin login via ssh
> synobootseq --set-boot-done
> synobootseq --is-ready
#optional
> /usr/syno/etc/rc.d/S97apache-sys.sh start
> /usr/syno/etc/rc.d/S95sshd.sh start