Skip to content

Instantly share code, notes, and snippets.

View zuzzas's full-sized avatar

Andrey Klimentyev zuzzas

View GitHub Profile
@zuzzas
zuzzas / limits.c
Created May 14, 2018 11:25
Revised snippet from prlimit(2)
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/resource.h>
#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \
@zuzzas
zuzzas / configure_logind.sh
Created May 12, 2022 12:06
Testing inhibitor locks
#!/bin/bash
cat <<EOF > /etc/systemd/system/inhibit.service
[Unit]
Description=heh
After=network.target
[Service]
Type=simple