Commit b9d1984e6a

b9d1984e6a42b9a2966f925ff98f45b6dede0b31

parent: ed70cc4e7b

Verified · cmc

cmc <hello@cleberg.net> · 2026-08-31 22:20 UTC

Convert README.nfo to README.org

Layout: unified · split

.gitignore +1 −2
@@ -1,8 +1,7 @@
1# Composer installs these; composer.lock pins them. 1# Composer installs these; composer.lock pins them.
2vendor/ 2vendor/
3 3
4# MaxMind GeoLite2. Licensed, ~69 MB, and stale the day after it is downloaded — 4# MaxMind GeoLite2. Licensed, ~69 MB, and stale the day after it is downloaded.
5# see README.nfo for how to fetch it. Never commit it.
6*.mmdb 5*.mmdb
7 6
8.DS_Store 7.DS_Store
README.nfo deleted −53
@@ -1,53 +0,0 @@
1┌──────────────────────────────────────────────────────────────┐
2│ I F C O N F I G . P H P [ KRZ ] krz.sh │
3└──────────────────────────────────────────────────────────────┘
4
5WHAT
6 php script. shows your ip address, user agent, and related info.
7 same idea as ifconfig.me and ifconfig.co.
8
9 output as html (default), plain text, xml, or json. single values
10 on request.
11
12USE
13 live at ip.cmc.pub:
14 - ?q=text all, plain text
15 - ?q=xml all, xml
16 - ?q=ip ip only
17 - ?q=ua user agent only
18
19 curl -L -X GET https://ip.cmc.pub/\?q\=text
20
21 apache rewrite so /ifconfig/xml works without the query string:
22
23 RewriteEngine On
24 RewriteCond %{REQUEST_FILENAME} !-d
25 RewriteCond %{REQUEST_FILENAME} !-f
26 RewriteRule ^ifconfig$ ifconfig.php [L]
27 RewriteRule ^ifconfig/(.*)$ /ifconfig.php?q=$1 [L]
28
29DEVELOP
30 install php and composer. fedora:
31
32 sudo dnf install php-cli composer
33
34 maxmind-db dependency:
35
36 composer require maxmind-db/reader:~1.0
37 composer update
38
39 geolite2 database. not in the repo: maxmind-licensed, ~69mb, and stale
40 the day after you download it. sign up for a free maxmind account, then:
41
42 https://www.maxmind.com/en/accounts/current/geoip/downloads
43
44 download GeoLite2-City in mmdb form and put GeoLite2-City.mmdb next to
45 ifconfig.php. without it the page still serves, minus the geo block.
46
47 dev server:
48
49 sudo php --server localhost:8080 --docroot .
50
51┌──────────────────────────────────────────────────────────────┐
52│ krz.sh │
53└──────────────────────────────────────────────────────────────┘
README.org added +61
@@ -0,0 +1,61 @@
1#+title: ifconfig.php
2
3* what
4php script. shows your ip address, user agent, and related info.
5same idea as ifconfig.me and ifconfig.co.
6
7output as html (default), plain text, xml, or json. single values
8on request.
9
10* use
11#+begin_example
12live at ip.cmc.pub:
13- ?q=text all, plain text
14- ?q=xml all, xml
15- ?q=ip ip only
16- ?q=ua user agent only
17#+end_example
18
19#+begin_src sh
20curl -L -X GET https://ip.cmc.pub/\?q\=text
21#+end_src
22
23apache rewrite so /ifconfig/xml works without the query string:
24
25#+begin_src sh
26RewriteEngine On
27RewriteCond %{REQUEST_FILENAME} !-d
28RewriteCond %{REQUEST_FILENAME} !-f
29RewriteRule ^ifconfig$ ifconfig.php [L]
30RewriteRule ^ifconfig/(.*)$ /ifconfig.php?q=$1 [L]
31#+end_src
32
33* develop
34install php and composer. fedora:
35
36#+begin_src sh
37sudo dnf install php-cli composer
38#+end_src
39
40maxmind-db dependency:
41
42#+begin_src sh
43composer require maxmind-db/reader:~1.0
44composer update
45#+end_src
46
47geolite2 database. not in the repo: maxmind-licensed, ~69mb, and stale
48the day after you download it. sign up for a free maxmind account, then:
49
50#+begin_src sh
51https://www.maxmind.com/en/accounts/current/geoip/downloads
52#+end_src
53
54download GeoLite2-City in mmdb form and put GeoLite2-City.mmdb next to
55ifconfig.php. without it the page still serves, minus the geo block.
56
57dev server:
58
59#+begin_src sh
60sudo php --server localhost:8080 --docroot .
61#+end_src