user-pic

Pank

  • Posted Get SSL certificate issuer and expire date to Pank's Blog
    # curl -v https://google.com 2>&1 | egrep -i "issuer:|expire" * expire date: Feb 01 00:11:00 2018 GMT * issuer: CN=Google Internet Authority G2,O=Google Inc,C=US...
  • Posted Web to PDF/Image to Pank's Blog
    wkhtmltopdf is a command line web to PDF/Image tool. wkhtmltopdf https://google.com output.pdf wkhtmltoimage https://google.com output.png Linux 版本中文有問題, Windows 版本中文正常, 輸出效果還不錯...
  • Posted HTML5 data-* attribute to Pank's Blog
    HTML5 data- 開頭是特殊屬性, data- 之後只能用小寫, 通常用來傳遞變數 例: <button data-id='1234'>Click</botton> jQuery 可以用 $(this).data("id")); 來取得 1234...
  • Posted Fiddler - HTTP/HTTPS Debugging Proxy to Pank's Blog
    fiddler HTTP/HTTPS Debugging Proxy using MITM Chrome、IE、Opera test OK Firefox need set proxy to 127.0.0.1:8888 manually...
  • Posted BASH regular expression to Pank's Blog
    e.g. Get http://mirror01.idc.hinet.net/CentOS/ first 7.x dir name RE=">(7[0-9\.]+)" [[ `curl -s http://mirror01.idc.hinet.net/CentOS/` =~ $RE ]] echo ${BASH_REMATCH[1]} Output: 7.0.1406...
  • Posted Screen reattach a session to Pank's Blog
    Useful when connection drop screen -Dr Reattach a session. If necessary detach and logout remotely first. screen -DR Attach here and now. In detail this means: If a session is running, then reattach. If necessary detach and logout remotely first....
  • Posted curl -T to PUT file to PHP to Pank's Blog
    Sender curl -T file http://host/upload.php Receiver upload.php code if ($_SERVER["REQUEST_METHOD"]=="PUT") file_put_contents(date("YmdHis") ,file_get_contents("php://input")); // date("YmdHis") is output filename...
  • Posted Eanble tftp server in CentOS7 to Pank's Blog
    yum -y install tftp-server Edit /etc/xinetd.d/tftp, add -c if need create (put file in) server_args = -cs /var/lib/tftpboot systemctl enable tftp.socket systemctl start tftp.socket PS. xinetd is not necessary...
  • Posted Get current date YYYYMMDD in Windows CMD to Pank's Blog
    set D=%date:/=% set YMD=%D:~0,8% echo %YMD%...
  • Posted Using ffmpeg to record Windows desktop to Pank's Blog
    Example: record desktop for 1 hour ffmpeg -f gdigrab -framerate 10 -i desktop -t 01:00:00 file.mp4 ref. Download FFmpeg for Windows...
  • Posted Fast check if WannaCry vulnerable to Pank's Blog
    wmic qfe get hotfixid | findstr /c:KB4012215 /c:KB4015549 /c:KB4019264 Have result, NOT vulnerable No result, vulnerable...
  • Posted HiNet Dr.Speed Analysis to Pank's Blog
    抓封包看 HiNet Dr.Speed 測試流程, 使用版本是 0.98 Beta 測試前動作 1. 抓 Test Code 及服務契約條款 GET http://speed2.hinet.net/app/get_testid2.aspx?APP_Platform=windows&App_ver=0.98 2. 抓測試前注意事項(HTML格式) GET http://speed2.hinet.net/app/info.aspx 3. 去 whois 查詢 IP, 取得服務抓供者(ISP), 最後測試結果會顯示 組態載入中 1. 每次連會回傳一串亂數, 不清楚這個目的 GET http://speed2.hinet.net/app/get_ip.aspx 2. 回傳版本及 IP GET http://speed2.hinet.net/app/get_content2.aspx?App_ver=0.98&Isp=HINET-NET&wan_ipv4=IP&wan_ipv6=null 3. 初始化1 GET...
  • Posted dehydrated to Pank's Blog
    dehydrated 之前叫做 letsencrypt.sh 因為名稱違反 Let's Encrypt 的商標而改名 設定跟之前大同小異 以下範例 Document Root 在 /var/www/html, dehydrated 放在 /usr/local cd /usr/local git clone https://github.com/lukas2511/dehydrated cd dehydrated echo "yourdomain.com www.yourdomain.com" > domains.txt mkdir -p /var/www/html/.well-known/acme-challenge # 另一個方法是設 alias (官網教的方法) echo BASEDIR=/usr/local/dehydrated > config echo...
  • Posted Show battery percentage on Android 7 devices to Pank's Blog
    在狀態列顯示電池使用百分比, 這個幾乎是必備的功能, 在 Android 上都要裝第三方軟體才行 若您的手機是 Android 7, 可以透過「系統使用者介面調整精靈」來啟用這個功能, 不過這個功能是被隱藏的, 據說是這個功能尚未完善所以還沒放出來 下拉狀態列, 長按齒輪 設定中就會出現「系統使用者介面調整精靈」 進去後選狀態列/電池, 一率顯示百分比 電池中間就會有百分比數字...
  • Posted Stand-alone ADB Fastboot tool to Pank's Blog
    Google released stand-alone ADB Fastboot tool Windows https://dl.google.com/android/repository/platform-tools-latest-windows.zip Mac https://dl.google.com/android/repository/platform-tools-latest-darwin.zip Linux https://dl.google.com/android/repository/platform-tools-latest-linux.zip...
  • Posted Linux Named Pipe to Pank's Blog
    mkfifo fifo_file cat fifo_file In another shell session date > fifo_file You'll see date info in first shell session. General Usage: piping data from program A to program B. ref. Named pipe...
  • Posted OTP Client for Linux and Windows to Pank's Blog
    For Linux: OATH Toolkit For Windows: WinAuth...
  • Posted Bliss HD to Pank's Blog
    Classic HD Windows XP Wallpaper Download...
  • Posted Fix MySQL Replication fatal error 1236 to Pank's Blog
    Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.' mysql> show global variables...
  • Posted Net-SNMP IFTABLE_CACHE_TIMEOUT to Pank's Blog
    IFTABLE_CACHE_TIMEOUT control how frequent update ifTable counter. Net-SNMP v5.4,v5.5 IFTABLE_CACHE_TIMEOUT 15 Net-SNMP v5.6,v5.7 IFTABLE_CACHE_TIMEOUT 3 Newer version have shorter cache timeout, but if you want to monitor real-time traffic by second, 3 seconds still useless. To change this value Method...
  • Posted Enable Keepalived SNMP subsystem to Pank's Blog
    echo KEEPALIVED_OPTIONS=\"-D -x\" > /etc/sysconfig/keepalived echo master agentx >> /etc/snmp/snmpd.conf echo mibs +KEEPALIVED-MIB >> /etc/snmp/snmp.conf # load KEEPALIVED-MIB, the file must in /usr/share/snmp/mibs service snmpd restart service keepalived restart # must after restart snmpd snmpwalk -v2c -cpuclic localhost KEEPALIVED-MIB:vrrp...
  • Posted Compile PHP with couchdb to Pank's Blog
    cd php-5.6.23 git clone https://github.com/akissa/php-couchdb mv php-couchdb ext/couchdb rm configure ./buildconf --force ./configure --enable-couchdb...
  • Posted Compile PHP with mongodb to Pank's Blog
    cd php-5.6.23 wget -qO- https://pecl.php.net/get/mongo-1.6.14.tgz | tar zxv mv mongo-1.6.14 ext/mongo rm configure ./buildconf --force ./configure --enable-mongo mongo extension 已經被 mongodb 取代, 不過仍有維護及安全性更新...
  • Posted PuTTY and OpenSSH share a key to Pank's Blog
    因為 PuTTY 的 Private Key 格式, 跟 OpenSSH 的不太一樣, 若兩邊要共用同一把 Key, Key 要從 OpenSSH 那邊產生, 再用 puttygen.exe 匯入 Key, 用 Load an existing private key file 再 Save public key, Save private key...
  • Posted OpenSSH Hostbased Authentication to Pank's Blog
    SSH 的認證方式, 其實有很多種, 用 ssh -oPreferredAuthentications=none host 可以取得 Server 端所支援的認證方式, Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password,hostbased). 輸出類似這樣, 看到 Permission denied 是正常的 比較常見的是 password、publickey, 而 hostbased 比較少用的原因可能是需求變少了, 且 sshd_config 中預設也沒開 hostbased 認證使用時機是當 Host C 中的很多用戶, 都要用免密碼連到 Host S, 管理者只要設定好, Host C 用戶就能直接 ssh 到...
  • Posted PowerShell OpenSSH to Pank's Blog
    PowerShell OpenSSH 是微軟 PowerShell Team 所 build 的 OpenSSH, 其針對 Windows 環境有些調整, 例如 ssh-keygen 會產在 Key 在 %USERPROFILE\.ssh 比起其他的版本, 更適合在 Windows 使用, 目前仍是 Pre-release ref. Windows PowerShell Blog - OpenSSH for Windows Update...
  • Posted LINE BOT API to Pank's Blog
    LINE 於四月初開始提供 BOT API 試用, 可登入 LINE Business Center 申請 API Reference 需準備一台有 HTTPS 服務的 Web Server, 用來接收 Callback, 不能用自簽的 SSL, 否則 VERIFY 會出現 Could not connect using SSL. 可去申請 Let's Encrypt - Free SSL/TLS Certificates 當有人送訊息到 BOT 帳號, 系統會送...
  • Posted XML formating to Pank's Blog
    | xmllint --format - # need libxml2 package | xmlstarlet fo # need xmlstarlet Make it more readable....
  • Posted JSON formating to Pank's Blog
    | python -m json.tool # need python package | jq . # need jq package Make it more readable....
  • Posted nginx+PHP to Pank's Blog
    nginx (發音 engine) 近幾年因為性能卓越, 市佔已愈來愈高, 僅次於 Apache, IIS, 排第三 官方有提供 Prebuilt Packages, 安裝很方便 Create /etc/yum.repos.d/nginx.repo yum -y install nginx PHP 在 configure 需加 --enable-fpm 參數 設定檔用預設的即可 cp sapi/fpm/php-fpm.conf /usr/local/etc/php-fpm.conf 執行 php-fpm 會 Listen 9000 Port nginx 設定檔 /etc/nginx/conf.d/default.conf 這是 HTTP...
Subscribe to feed Recent Actions from Pank

Following

Not following anyone

About This Page

Find recent content on the main index or look in the archives to find all content.

Monthly Archives