Last active
August 15, 2023 16:58
-
-
Save mk-pmb/b8a32f005d507ae07733c9ccbcd7340f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# -*- coding: UTF-8, tab-width: 2 -*- | |
# Origin: https://gist.github.com/mk-pmb/b8a32f005d507ae07733c9ccbcd7340f | |
# License: CC-0 | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use HTML::Entities; # Not shipping in default Ubuntu :-( | |
print "Content-Type: text/html; charset=UTF-8\n\n"; | |
$Data::Dumper::Terse = 1; | |
print "<pre>", encode_entities(Dumper(\%ENV)), "</pre>\n\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -*- coding: UTF-8, tab-width: 2 -*- | |
# Origin: https://gist.github.com/mk-pmb/b8a32f005d507ae07733c9ccbcd7340f | |
# License: CC-0 | |
echo "Content-Type: text/html; charset=UTF-8" | |
echo | |
echo '<!DOCTYPE html>' | |
echo '<html><head>' | |
echo ' <meta charset="UTF-8">' | |
echo ' <title>apache-cgi-dumpenv</title>' | |
echo '</head><body>' | |
echo '<pre>' | |
env | sort -V | LANG=C sed -re ' | |
s~&~\&~g | |
s~<~\<~g | |
s~>~\>~g | |
s~"~\"~g | |
' | |
echo '</pre>' | |
echo | |
echo '<h4>JavaScript:</h4>' | |
echo '<dl>' | |
for V in navigator.{appName,userAgent} document.{URL,cookie}; do | |
echo -n " <dt>$V:</dt><dd><script" 'type="text/javascript">' | |
echo "document.write($V || '–');</script></dd>" | |
done | |
echo '</dl>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment