Skip to content

Instantly share code, notes, and snippets.

@xavierchanth
xavierchanth / http hello world one-shot server
Last active October 2, 2023 20:32 — forked from kevn-xyz/ncws
Simple netcat based one shot http file server
#!/bin/bash
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Disposition: inline; filename=\"hello.txt\"\r\nContent-Length: 13\r\n\r\n"; echo \"Hello World\!\"; } | nc -l 8080
@xavierchanth
xavierchanth / download
Created January 13, 2024 10:45 — forked from evanrelf/aoc-download
Offline Advent of Code
#!/usr/bin/env bash
set -Eeuo pipefail
IFS=$'\n\t'
if [ "$#" -ne 1 ]; then
echo "usage: ./download <year>" >&2
exit 1
fi
@xavierchanth
xavierchanth / atserver.sh
Last active February 23, 2024 02:56
The magic atserver script.
atdirectory() {
head -n 1 < <(openssl s_client -connect root.atsign.org:64 -quiet -verify_quiet < <(echo "$1"; sleep 1; echo "@exit") 2>/dev/null)
}
atserver() {
pkam_command="at_pkam"
atsign="$1"
if [[ ${atsign:0:1} != "@" ]] ; then
atsign="@$atsign"
fi
@xavierchanth
xavierchanth / Atserver_quick_authentication.md
Last active November 27, 2024 15:42
atserver quick authentication script

AtServer quick authentication scripts

Requirements:

Scripts

atdirectory