blob: 54d072eeb39f3158b46090ad5ee0184e2b0c4bd4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
┌──────────────────────────────────────────────────────────────┐
│ I F C O N F I G . P H P [ KRZ ] krz.sh │
└──────────────────────────────────────────────────────────────┘
WHAT
php script. shows your ip address, user agent, and related info.
same idea as ifconfig.me and ifconfig.co.
output as html (default), plain text, xml, or json. single values
on request.
USE
live at ip.cmc.pub:
- ?q=text all, plain text
- ?q=xml all, xml
- ?q=ip ip only
- ?q=ua user agent only
curl -L -X GET https://ip.cmc.pub/\?q\=text
apache rewrite so /ifconfig/xml works without the query string:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ifconfig$ ifconfig.php [L]
RewriteRule ^ifconfig/(.*)$ /ifconfig.php?q=$1 [L]
DEVELOP
install php and composer. fedora:
sudo dnf install php-cli composer
maxmind-db dependency:
composer require maxmind-db/reader:~1.0
composer update
dev server:
sudo php --server localhost:8080 --docroot .
┌──────────────────────────────────────────────────────────────┐
│ krz.sh │
└──────────────────────────────────────────────────────────────┘
|