Skip to content

Instantly share code, notes, and snippets.

View OussamaRomdhane's full-sized avatar
🐧
Penguin-ing

Oussama OussamaRomdhane

🐧
Penguin-ing
View GitHub Profile
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active August 4, 2025 01:24
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@utsengar
utsengar / EncodeBased64Binary.java
Created October 11, 2011 00:27
Encode a file to base64 binary in Java
import org.apache.commons.codec.binary.Base64;
private String encodeFileToBase64Binary(String fileName)
throws IOException {
File file = new File(fileName);
byte[] bytes = loadFile(file);
byte[] encoded = Base64.encodeBase64(bytes);
String encodedString = new String(encoded);