Skip to content

Instantly share code, notes, and snippets.

@nxghtmvrx
nxghtmvrx / sleep.c
Created March 27, 2020 20:56 — forked from rofl0r/sleep.c
gnu compatible sleep tool.
#define _POSIX_C_SOURCE 200809L
#include <sys/time.h>
#include <time.h>
#include <stdlib.h>
int main(int argc, char** argv) {
int i;
char* end;
int times;
for(i = 1; i < argc; i++) {
@nxghtmvrx
nxghtmvrx / bb-ping.c
Created March 27, 2020 20:49 — forked from rofl0r/bb-ping.c
ping utility ripped off from busybox rev 1.22.0, turned into a standalone program + added SOCK_DGRAM functionality for root-free ping and ping6. [ http://lists.busybox.net/pipermail/busybox/2014-January/080206.html rejected SOCK_DGRAM patch as taken from busybox ml]
/* vi: set sw=4 ts=4: */
/*
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
*
* Adapted from the ping in netkit-base 0.10:
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
*
@nxghtmvrx
nxghtmvrx / init.c
Created June 22, 2019 19:10 — forked from rofl0r/init.c
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;