Skip to content

Instantly share code, notes, and snippets.

@mdonkers
mdonkers / server.py
Last active April 30, 2024 23:26
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@sentinelt
sentinelt / gist:3f1a984533556cf890d9
Created February 6, 2015 18:44
Program to set arbitrary speed
/*
* Allows to set arbitrary speed for the serial device on Linux.
* stty allows to set only predefined values: 9600, 19200, 38400, 57600, 115200, 230400, 460800.
*/
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <asm/termios.h>
int main(int argc, char* argv[]) {
@tjarksaul
tjarksaul / gist:9047330
Created February 17, 2014 09:15
Script to change vbox user password on uberspace. Thanks to @_einstein_
<?php
if($_SERVER["HTTPS"] != "on") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
exit();
}
function setNewPassword($strMailbox, $strPassword)
{
$strPassword = utf8_decode($strPassword);