2017年11月21日 星期二

如何查詢Port被哪個程式佔用了


  • windows
    • 用 netstat 命令

C:\>netstat -ano | findstr 0.0:80

    • 結果

TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       1860


    • 其中 1860 就是佔用 port 的程式 PID,再輸入

C:\>tasklist | findstr 1860
得到如下的資訊

httpd.exe                  1860 Services                0      4,148 K
表示佔用的是 httpd.exe,也就是 Apache Server 還開著。


Posted on 11/21/2017 10:46:00 上午 | Categories: , ,

2017年10月27日 星期五

2017年10月12日 星期四

cmd script 自動產生日期、時間字串,並 copy 到剪貼簿中

要先定義 os.date & os.time 的字串格式

For /f "tokens=1-4 delims=- " %%a in ('date /t') do (set _thisDate=%%a%%b%%c)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set _thisTime=%%a%%b)
set _thisDateTime=%_thisDate%.%_thisTime%

Posted on 10/12/2017 03:12:00 下午 | Categories:

2017年10月5日 星期四

redis monitor

監控 redis 現在被呼叫 (查詢) 的狀況

Posted on 10/05/2017 10:05:00 上午 | Categories:

2017年10月2日 星期一

2017年9月28日 星期四

2017年9月26日 星期二

2017年9月11日 星期一

Java 取亂數 A-Z / a-z

先前筆記過在 java 中用 Math.random() 實作一個亂數 (數字)。
今天來搞一個 A-Z / a-z 的字母亂數。

Posted on 9/11/2017 02:26:00 下午 | Categories:

2017年9月8日 星期五

Java 取亂數 Math.random()


java.lang 中的 Math 類別定義了 random()
(double) ran = Math.random()

Posted on 9/08/2017 03:48:00 下午 | Categories:

2017年9月6日 星期三

2017年9月4日 星期一

2017年9月1日 星期五

redis 關不掉

剛遇到 redis 怎麼關都關不掉 (kill 25603 沒回應)

Posted on 9/01/2017 10:38:00 上午 | Categories:

用 top 看特定 process name

剛用 top 查看某服務的 process_id,但是某服務排名太後面,找不到 process_id

Posted on 9/01/2017 10:35:00 上午 | Categories: ,