I hereby claim:
- I am Luit on github.
- I am luit (https://keybase.io/luit) on keybase.
- I have a public key whose fingerprint is 52BD 2314 CA93 839B 2A50 1397 984B E3B2 71A8 8C47
To claim this, I am signing this object:
C{ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <hiredis/hiredis.h> | |
}C | |
sub vcl_recv { | |
if (req.http.host ~ "(?i)^a.luit.it$") { | |
if (req.url ~ "(?i)^/l/.*[A-Za-z0-9\-_]{4,}\+?$") { |
diff --git a/src/vmod_redis.c b/src/vmod_redis.c | |
index b59652b..7c0544e 100644 | |
--- a/src/vmod_redis.c | |
+++ b/src/vmod_redis.c | |
@@ -81,6 +81,18 @@ redis_common(struct sess *sp, struct vmod_priv *priv, const char *command) | |
} | |
reply = redisCommand(c, command); | |
+ if (c->err == REDIS_ERR_EOF) { | |
+ // It seems Redis has disconnected the client, let's try to |
import redis; | |
sub vcl_recv { | |
if (req.url ~ "^/[lL]/[A-Za-z0-9\-_]{4,32}=?=?$") { | |
set req.http.New-Location = redis.call(regsub(req.url, "^/[lL]/([A-Za-z0-9\-_]{2})([A-Za-z0-9\-_]{2,30}=?=?)$", "HGET short:\1 \2")); | |
if (req.http.New-Location) { | |
error 666; | |
} | |
error 404 "Not Found"; | |
} |
import redis; | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
} | |
backend self { | |
.host = "127.0.0.1"; | |
.port = "80"; |
luit@xps14:~$ free -m # My laptop feels sluggish | |
total used free shared buffers cached | |
Mem: 3836 3644 191 0 10 498 | |
-/+ buffers/cache: 3135 701 | |
Swap: 8190 1031 7159 | |
luit@xps14:~$ free -m # I think it's Chromium, let's shut that thing down | |
total used free shared buffers cached | |
Mem: 3836 1246 2589 0 12 426 | |
-/+ buffers/cache: 808 3028 | |
Swap: 8190 337 7853 |
#!/usr/bin/env python | |
import datetime | |
import twitter | |
OAUTH_T = '' # You can't have my OAuth secrets | |
OAUTH_TS = '' | |
OAUTH_CK = '' | |
OAUTH_CS = '' |
package utils | |
func Slugify(title string) string { | |
var slug []byte | |
for _, x := range title { | |
switch { | |
case ('a' <= x && x <= 'z') || ('0' <= x && x <= '9'): | |
slug = append(slug, byte(x)) | |
case 'A' <= x && x <= 'Z': |
I hereby claim:
To claim this, I am signing this object:
// kinda smart ergonomic Desk, or kseD for short, is a project to make my | |
// no-frills ergonomic desk a bit more special. | |
/* | |
Serial commands: | |
E <upper> <lower> | |
Read value from EEPROM (might disappear once testing is done) | |
G <upper> <lower> |
function check_docker_memory { | |
for id in $(docker ps -q --no-trunc); do | |
name=$(docker inspect -f "{{.Name}}" $id) | |
echo $(numfmt --to=iec --suffix=B $(cat /sys/fs/cgroup/memory/system.slice/docker-$id.scope/memory.usage_in_bytes)) ${name#/} | |
done | |
} |