A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
| package net.sf.jsimpledice; | |
| import java.io.IOException; | |
| import java.util.Random; | |
| import javax.microedition.lcdui.Alert; | |
| import javax.microedition.lcdui.AlertType; | |
| import javax.microedition.lcdui.Canvas; | |
| import javax.microedition.lcdui.Choice; | |
| import javax.microedition.lcdui.ChoiceGroup; | |
| import javax.microedition.lcdui.Command; |
| public static UUID sequentialId(int id) { | |
| Assert.isTrue(id >= 0, "[Assertion failed] - negative id"); | |
| return UUID.fromString(String.format("%08d-%04d-%04d-%04d-%012d", Math.min(id, 99999999), 0, 0, 0, 0)); | |
| } | |
| public static String asString(UUID uuid) { | |
| return String.format("%016x", uuid.getMostSignificantBits()); | |
| } |
| import http.server, ssl | |
| server_address = ('localhost', 4443) | |
| httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler) | |
| httpd.socket = ssl.wrap_socket(httpd.socket, | |
| server_side=True, | |
| certfile='localhost.pem', | |
| ssl_version=ssl.PROTOCOL_TLSv1) | |
| httpd.serve_forever() |
A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
| Verifying that +kmila is my blockchain ID. https://onename.com/kmila |
| import imaplib | |
| M = imaplib.IMAP4_SSL('imap.oi.com.br') | |
| if (M.login('<USER_TO_TEST>@oi.com.br','PASSWORD')[0] != 'OK'): exit("no conn") | |
| c = (M.select('Inbox'))[1][0] | |
| if (c != '0'):print c | |
| typ, data = M.search(None, '(SEEN)') | |
| for num in data[0].split(): | |
| typ, data = M.fetch(num, '(RFC822)') | |
| print('Message %s\n%s\n' % (num, data[0][1])) |
| [Icon Theme] | |
| Name=Paper | |
| Comment=A simple and modern icon theme. | |
| Inherits=Paper,elementary-xfce-dark |
keytool -genkey -v -keystore myapk.key -alias myapkkey -keyalg RSA -keysize 2048 -validity 10000
[changeit] [yes]
| #!/bin/bash | |
| # | |
| # ------------------- | |
| # BEGIN CONFIGURATION | |
| # ------------------- | |
| DEBUG=0 | |
| CMD="curl -ks" | |
| URI="https://ENV_URI" |
| ; A REPL-based, annotated Seesaw tutorial | |
| ; Please visit https://github.com/daveray/seesaw for more info | |
| ; | |
| ; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers | |
| ; Seesaw's basic features and philosophy, but only scratches the surface | |
| ; of what's available. It only assumes knowledge of Clojure. No Swing or | |
| ; Java experience is needed. | |
| ; | |
| ; This material was first presented in a talk at @CraftsmanGuild in | |
| ; Ann Arbor, MI. |