Skip to content

Instantly share code, notes, and snippets.

View rofl0r's full-sized avatar

rofl0r

View GitHub Profile
@rofl0r
rofl0r / Makefile
Created August 13, 2014 21:31 — forked from o11c/Makefile
.DEFAULT_GOAL := all
.PHONY: ${MAKECMDGOALS}
$(filter-out all,${MAKECMDGOALS}) all: .forward-all ;
.forward-all:
${MAKE} -C build ${MAKECMDGOALS}
${MAKEFILE_LIST}: ;
.SUFFIXES:
@rofl0r
rofl0r / getentropy_linux.c
Created July 12, 2014 12:17
libressl portable code 1
/*
* issetugid implementation for Linux
* Public domain
*/
#include <errno.h>
#include <gnu/libc-version.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
@rofl0r
rofl0r / dist-from-tags.sh
Last active August 29, 2015 14:03
create distro tarballs for all tags in a git repo.
#!/bin/sh
# (C) 2014 rofl0r, released under the public domain.
# this script takes a repo url as arguments and then checks out
# all tags, creates a tarball from each one and prints a hyperlink
# to stdout.
# for example ./dist-from-tags.sh $HOME/git-repos/wavemon > index.html
# the tarballs are created in the current working dir.
url="$1"
this=$PWD
when --disable-shared is used, libgcc is built without hidden visibility.
in combination with 2 other bugs, this leads to miscompilation of
musl libc.so on mips.
these 3 issues combined are:
1. gcc emitting useless .globl
2. gas generating OBJECT symbol rather than unknown type when it sees .globl
without .type
3. libgcc.a symbols not getting hidden visibility like they should
--- gcc473.org/libgcc/Makefile.in
@rofl0r
rofl0r / bb-ping.c
Last active May 30, 2022 08:56
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 <[email protected]>
*
* Adapted from the ping in netkit-base 0.10:
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
*
@rofl0r
rofl0r / ping.c
Created January 4, 2014 20:44
the modified ping tool from http://openwall.info/wiki/people/segoon/ping / http://mirrors.kernel.org/openwall/Owl/3.0-release/sources/Owl-3_0-stable/packages/iputils/iputils-ss020927.tar.gz with the no-suid patch applied and some build errors fixed, as a standalone C file. works, but has no ipv6 support.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <linux/sockios.h>
#include <sys/file.h>
#include <sys/time.h>
#include <signal.h>
@rofl0r
rofl0r / mlxc.sh
Created November 13, 2013 10:30 — forked from noqqe/mlxc.sh
#!/bin/bash
### Binaries
SCREEN=$(which screen)
LXCSTART=$(which lxc-start)
LXCSTOP=$(which lxc-stop)
### Configuration to get lxc directory
LXCCONF="/etc/default/lxc"
ERR=0
/* Copyright (C) 2013, Felix Janda <[email protected]>
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all copies.
SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
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;
@rofl0r
rofl0r / mkcabundle.pl
Created April 10, 2012 01:15
SSL certificate download script
#!/usr/bin/perl -w
#
# Used to regenerate ca-bundle.crt from the Mozilla certdata.txt.
# Run as ./mkcabundle.pl > ca-bundle.crt
#
my $cvsroot = ':pserver:[email protected]:/cvsroot';
my $certdata = 'mozilla/security/nss/lib/ckfw/builtins/certdata.txt';
open(IN, "cvs -d $cvsroot co -p $certdata|")