Cody Blog

nmap 筆記

NAMP 是一套網路掃描的工具

Nmap

$ nmap ip

$ nmap [ip1 ip2]

$ namp 192.168.10.1/24

隨機掃描目標(慎用)

$ nmap -iR 3

Ping

$ nmap 172.16.21.134 172.16.21.135 -sP

Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-24 09:38 CST Nmap scan report for 172.16.21.134 Host is up (0.00084s latency). Nmap done: 2 IP addresses (1 host up) scanned in 1.21 seconds

Traceroute

# sudo nmap 8.8.8.8 --traceroute

Starting Nmap 6.40 ( http://nmap.org ) at 2014-04-24 09:39 CST
Nmap scan report for google-public-dns-a.google …

NTP note

使用 ntpd 來跟上行的 server 是不會立即更新時間的。

新增 NTP Server

把 server 加到 /etc/ntp.conf

server tick.stdtime.gov.tw

觀察目前連線的狀態

~ # ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 118-163-81-62.H 192.168.0.2      2 u    7   64    3   13.063  546.533  61.627

Using Perforce Command Line in Linux

Installation (Linux)

  1. Download P4 binary from http://www.perforce.com/downloads/complete_list

    $ wget http://www.perforce.com/downloads/perforce/r11.1/bin.linux26x86_64/p4 (x64) $ wget http://www.perforce.com/downloads/perforce/r11.1/bin.linux26x86/p4 (x86)

  2. Make the downloaded file executable

    $ chmod +x p4

  3. Print p4 version

    $ ./p4 -V

Perforce client common commands

./p4 -p 10.200.19.19:1667 -u `<YOUR_ACCOUNT>` login

export P4PORT=10.200.19.19:1667

./p4 -u `<USERNAME>` -c `<WORK_SPACE>` sync -f

Redis 筆記

啟動 server

$ redis-server

關閉 server

$ redis-server shutdown

測試伺服器是不是正常

$ redis-cli ping

指令伺服器位置

$ redis-cli -h <HOST> -p <PORT> -a <PASSWORD>

常用指令

列出所有的 keys

> key *

清空資料庫

> flushdb

畫 Sequence Diagram 的線上工具: Web Sequence Diagrams

Web Sequence Diagrams 畫 Sequence diagram 的線上工具,介面很直觀簡單:

demo

用以下的文字即可簡單表達一張 sequence diagram

title SIP Account server


Client -> API Server: /api/v1/users/
API Server -> Microsoft Graph Server: Check access_token
Microsoft Graph Server -> API Server: Response check result
API Server -> Client: Response SIP account info

就可以產生出以下的圖檔了:

xx

Execute Sikuli Script at Jython level on Windows 7

  1. Install JRE 32-bit

  2. Install Sikuli

    https://launchpad.net/sikuli/sikuli-api/1.0.0/+download/Sikuli-IDE-1.0.0-Win32.zip

  3. Set Environment

    JYTHONPATH=C:\jython2.5.1\Lib;C:\Sikuli-IDE-1.0.0-Win32\sikuli-script.jar\Lib CLASSPATH=C:\Sikuli-IDE-1.0.0-Win32\sikuli-script.jar PATH=C:\Program Files\Java\jre7\bin;C:\jython2.5.1\bin;C:\Sikuli-IDE-1.0.0-Win32\libs SIKULI_HOME=C:\Sikuli-IDE-1.0.0-Win32

  4. Sikuli sciprt

example:

from sikuli.Sikuli import *
doubleClick(r"C:\siku.sikuli\1370345639170.png")

Install Sikuli-IDE on Ubuntu 12.04

sudo apt-get install sikuli-ide
sudo apt-get install libopencv-*

Reference :

ThinkPad x220

再見了,小黑(2011/5 - 2014/8)。願你在新的主人那邊可以有繼續發揮的空間

把小黑賣掉,主要的原因是斷捨離的概念,讓我決定放下。另一方面也是對於 Lenovo 沒辦法在創造出新價值,有點失望。用腳投票,投入蘋果陣營。

X220 美規機(過保)

  • CPU : i5 2410m
  • RAM : 海盜船 16GB (8GB x 2)
  • 硬碟 : SATA 320GB, Masta SSD Intel 320 80GB
  • 螢幕 : 自換 IPS 面板
  • 電池 : 6 cell x1, 9cell x1
  • 電源供應器: 65W 充電器 x1 + 原廠 90W 充電器 x 1
  • Express Card :
  • ATM 晶片卡 Smart card reader, 可以ATM轉帳,網路報稅
  • AKE USB 3.0 ExpressCard : 多二個 USB 3.0 孔
  • Windows 7 序號
  • USB 外接鍵盤

Tmux Notes

Default pefix key <Prefix> is Ctrl+b

Installation

$ sudo apt-get install tmux

config

~/.tmux.conf

Reload

$ tmux source-file ~/.tmux.conf

Attach

$ tmux attach

視窗(Windows)

  • 新增一個視窗<Prefix>c
  • 下一個視窗<Prefix>n
  • 上一個視窗<Prefix>p
  • 選單 <Prefix>w
  • 關視窗<Prefix>x

Panes

  • 水平分割 <Prefix>%
  • 垂直分割 <Prefix>"
  • Resize <Prefix><Meta-Up[Down][Left][Right]>
  • Close <Prefix>x

視窗(Windows)

  • 新增一個視窗<Prefix>c
  • 下一個視窗<Prefix>n
  • 上一個視窗<Prefix>n
  • 選單 <Prefix>w
  • 關視窗<Prefix>x
  • 重新命名<Prefix>,

More

Using Pafers heart rate monitor on a Android 4.3 phone

pafers

For short: You can use PAFERS on BLE Heart Rate Monitor app without any probelm

Find a heart rate monitor on Android

For android phone, it's hard to find a cheap heart rate belt monitor. Some cheap heart rate monitors supprt only ANT+ protocol like Xplova XA-HR2 or PAPAGO! ANT+, you need a GPS running watch to conntect with. For smart phones, we can only use a heart rate monitor that supports bluetooth. However, the most of bluetooth heart rate monitors are using bluetooth 4.0 protocol.

Until versoin 4.3, Android supports bluettoth 4.0 and BLE(bluetooth low …