Skip to content

Instantly share code, notes, and snippets.

@Low-power
Low-power / scripttoasciicast.c
Last active December 9, 2021 10:02
Convert terminal typescripts (by script(1) from util-linux) into asciicasts (for asciinema).
/* Copyright 2015-2021 Rivoreo
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@Low-power
Low-power / pm
Last active October 14, 2021 05:22
Command line wrapper for Solaris pm(7D).
#!/usr/bin/sh
# Copyright 2015-2021 Rivoreo
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
@Low-power
Low-power / ifconfig.sysctl.c
Created July 25, 2020 15:56
Interface datalink layer configuration and statistics viewer for BSD
/* sysctl(3)-based ifconfig(8) implementation
Copyright 2015-2020 Rivoreo
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include <sys/param.h>
#include <sys/types.h>
/* TMCMR Tiles Server for FastCGI
Copyright 2015-2020 Rivoreo
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@Low-power
Low-power / tcpflowreplay.c
Last active June 16, 2020 13:51
Flow replay tool for tcpflow(1), just like scriptreplay(1) for script(1).
/* Replay flow captured by tcpflow(1) to stdout with timing.
Copyright 2015-2020 Rivoreo
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@Low-power
Low-power / minecraft-ping-server.c
Last active May 10, 2020 11:24
A fake Minecraft server that response only to legacy ping requests; useful for quickly verifying your Minecraft server to public server list sites.
/* Minecraft Ping-Only Server
Copyright 2015-2020 Rivoreo
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@Low-power
Low-power / logcat-color.sh
Last active February 25, 2023 00:37
Fast, ash-compatible reimplementation of Anthony's logcat-color.sh
#!/bin/sh
# Colorize logcat(1) output
# Copyright 2015-2020 Rivoreo
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
@Low-power
Low-power / droptostop.c
Created April 22, 2020 09:17
LD_PRELOAD program used to prevent terminals from being write-protected by foreground process.
/* This file has no copyright assigned and is placed in the Public Domain.
* No warranty is given.
*/
#include <termios.h>
#include <dlfcn.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef LIBC_PATH
/*-
* Copyright (c) 2012-2014 Andrew Turner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
#!/bin/sh
# Copyright 2015-2021 Rivoreo
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to