Skip to content

Instantly share code, notes, and snippets.

View greut's full-sized avatar
moving slowly and breaking things

Yoan Blanc greut

moving slowly and breaking things
View GitHub Profile
greut / run.php
Created April 30, 2011 18:18
A web server in pure PHP (non-concurrent and concurrent)
#!/usr/bin/env php
$app = function($request) {
$body = <<<EOS
<!DOCTYPE html>
<meta charset=utf-8>
<title>Hello World!</title>
greut /
Created May 29, 2017 07:37
TCP + UDP Java Echo Server.
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
greut /
Last active February 10, 2021 23:32
Laptop Access-Point with monitoring

Access Point


  • hostapd
  • dnsmasq
  • ntop
  • iptables


package main
import (
type LeveledLogrus struct {
greut /
Created September 22, 2020 09:56

Keybase proof

I hereby claim:

  • I am greut on github.
  • I am yblanc ( on keybase.
  • I have a public key whose fingerprint is A2A7 E23A 88A2 1EA5 561E 581F 068A F996 C3F7 2ADA

To claim this, I am signing this object:

greut /
Last active June 2, 2020 21:20
Revamped (with test and 100% coverage)
Slack Web API
The `Slack Web API`_ let you communicate with Slack.
The following example calls the ``api.test`` method which test whether your
Sourdough oatmeal chocolate chip cookies
1/2 cup discard sourdough
1/2 cup softened butter
1 egg
1/2 cup dark brown sugar
greut /
Created February 20, 2020 11:31
connecting to HE-Arc vpn
echo "Welcome to HE-ARC"
echo ""
greut /
Last active February 12, 2020 13:47
Sample asyncio bot for Slack
"""Sample Slack ping bot using asyncio and websockets."""
import asyncio
import json
import signal
import aiohttp
from config import DEBUG, TOKEN
import websockets

A Discord Bot with asyncio

Following last year’s article on Slack, here is how to create a bot for Discord. We will go through a minimalist bot that does close to nothing. Most of the provided examples using libraries like hide asyncio away. Here we will make it explicit how it works under the hood. Be aware that this is not the easiest way to build a bot but a step-stone to understand what complete libraries do for you.