Skip to content

Instantly share code, notes, and snippets.

@chris-se
chris-se / simple_initrd.c
Last active June 6, 2021 01:14
A very simple initrd implementation that mounts / and /usr
/*
* Author: Christian Seiler <christian@iwakd.de>
* License: GPLv3+
*
* IMPORTANT NOTE:
* This was just a proof of concept, there's a better version available from
* https://github.com/chris-se/tiny-initrd
*
* Usage: musl-gcc -O2 -Wall -Wextra -static -o init simple_initrd.c
* mkdir initramfs initramfs/{dev,proc,target}
@tvlooy
tvlooy / unit.sh
Last active February 4, 2024 04:20
Bash test: get the directory of a script
#!/bin/bash
function test {
MESSAGE=$1
RECEIVED=$2
EXPECTED=$3
if [ "$RECEIVED" = "$EXPECTED" ]; then
echo -e "\033[32m✔︎ Tested $MESSAGE"
else
@mrchief
mrchief / Deploy-Windows-Service-Via-MSBuild.proj.xml
Last active November 23, 2020 09:19
MSBuild Script to deploy Windows Service to remote or local machine
<Project DefaultTargets="CopyOutputs;DeployService" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!-- These settings control what the service's name, description etc appear in services.msc task panel. -->
<PropertyGroup Label="ServiceMetaData">
<ServiceName>ShinyNewService</ServiceName>
<ServiceDisplayName>Shiny New Service</ServiceDisplayName>
<ServiceDescription>A shiny new service, that changes the world for the greater good.</ServiceDescription>
</PropertyGroup>
<Choose>