Skip to content

Instantly share code, notes, and snippets.

View zehome's full-sized avatar

Laurent Coustet zehome

View GitHub Profile
@zehome
zehome / singleline_docker_old_firefox.sh
Last active December 18, 2018 09:40
Run old firefox from docker
outd=$(mktemp -d); echo -e "FROM ubuntu:trusty\nRUN apt-get update && \
apt-get -qqy install firefox icedtea-netx\nRUN adduser --system --shell /bin/bash --uid $UID --disabled-password xuser\nUSER xuser" >$outd/Dockerfile && \
docker build -t oldfirefox $outd && rm $outd/Dockerfile && rm -r $outd && \
docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix oldfirefox
@zehome
zehome / rsslimiter.sh
Last active February 14, 2019 10:23
rss limiter (bash / linux)
#!/bin/bash
CGROUP_ROOT="/sys/fs/cgroup"
CGROUP_NAME="rsslimiter"
# CGROUP_CPUSHARES="512"
# CGROUP_BLKIO_THROTTLE_READ_BPS="8:0 $((100*1024*1024)),8:16 $((100*1024*1024))"
CGROUP_MAXMEM="$((32 * 1024 * 1024))" # in bytes
cgroup_init()
@zehome
zehome / radar.c
Last active March 23, 2019 20:03
leslie radar using arduino
const int pwPin = 7;
const int led = 11;
void setup()
{
Serial.begin(115200);
pinMode(pwPin, INPUT);
pinMode(led, OUTPUT);
}
#!/usr/bin/env python3
import asyncio
async def main():
reader, writer = await asyncio.open_connection('localhost', 5556)
if crash:
pass
asyncio.run(main(), debug=True)