Skip to content

Instantly share code, notes, and snippets.

@mrchief
mrchief / Deploy-Windows-Service-Via-MSBuild.proj.xml
Last active June 26, 2024 09:37
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>
@tvlooy
tvlooy / unit.sh
Last active September 20, 2024 20:53
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
@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 <[email protected]>
* 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}