Post

shell

shell

shell语言,涵括windows上的cmd和ps,或者前端开发中的npm、python语言中的pip等。

风格化输出

1.方案一@原生ps@ascii

1
2
# 青色输出
Write-Host "HELLO WORLD" -ForegroundColor Cyan

2.方案二@pyfiglet,py@eng

1
2
3
py # enter py
from pyfiglet import figlet_format as fl
print(fl("吃个饭,永和大王 :)"))

查询DNS domain地理位置

  1. alt+X开启shell
  2. 指定DNS server(Google)查询IPA
    1
    
    nslookup nsgih.github.io 8.8.8.8
    
  3. 根据IPA查询地理位置
    1
    2
    
    $ip3 = "185.199.111.153"
    Invoke-Restmethod -Uri "http://ip-api.com/json/$ip3"
    
  4. 附录
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
PS C:\Users\nagih> nslookup nsgih.github.io 8.8.8.8
服务器:  dns.google
Address:  8.8.8.8

非权威应答:
名称:    nsgih.github.io
Addresses:  2606:50c0:8000::153
          2606:50c0:8001::153
          2606:50c0:8002::153
          2606:50c0:8003::153
          185.199.111.153
          185.199.109.153
          185.199.110.153
          185.199.108.153

---
PS C:\Users\nagih> $ip3  ="185.199.111.153"
PS C:\Users\nagih> Invoke-Restmethod -Uri "http://ip-api.com/json/$ip3"


status      : success
country     : United States
countryCode : US
region      : CA
regionName  : California
city        : San Francisco
zip         : 94107
lat         : 37.7823
lon         : -122.391
timezone    : America/Los_Angeles
isp         : Fastly, Inc.
org         : GitHub, Inc
as          : AS54113 Fastly, Inc.
query       : 185.199.111.153
This post is licensed under CC BY 4.0 by the author.

Trending Tags