一般的strace使用法如下即可:strace -p $PID
但是tomcat必須使用以下參數才可正常顯示:strace -f -etrace=\!futex,gettimeofday,clock_gettime -p $PID
ref: this.
| [+/-] |
Strace with tomcat |
| [+/-] |
ssh tunnel with openssh on linux box
poster:
MarlboroMoo on
19:35
tag:
linux,
ssh tunnel
/
Comments: (0)
|
在 linux 底下翻牆啦!
- reverse tunnel: 從家中主機連回公司的主機, 或是 firewall 只有 allow 單向 ssh 的狀況, 由目的主機主動建立 ssh tunnel.
#. on destination server (office host or firewall allow host)
ssh -fNR 9999:127.0.0.1:22 root@target_host -p 22
#. on target server (home host or firewall deny host)
ssh root@127.0.0.1 -p 9999 - dynamic application-level port forwarding: 被鎖 port 了, 先在牆的另外一邊搞一個ssh service port 在 80 的主機, 只要應用程式能使用 proxy 並且支援 socks 的, 將 socks server 指向 127.0.0.1:9999, 都可以用這個 ssh tunnel 翻.
ssh -fND 9999 root@remote_host -p 80 - combind 上述兩種 tunnel, 使被鎖 port 也無法上網的主機翻牆, 記得於應用程式內將 socks server 指向 127.0.0.1:8888, type 選擇 socks4.
#. on destination server (firewall allow host)
ssh -fNR 9999:127.0.0.1:22 root@target_host -p 22
#. on target server (firewall deny host)
ssh -fND 8888 root@127.0.0.1 -p 9999
| [+/-] |
can't format or mount device with live cd |
遇到一則奇怪的問題, 使用 live cd(parted magic,knoppix)開機後, 可以對 device 做 fdisk, 但無法 format or mount, 會出先現 message: "/dev/sdx is apparently in use by the system; will not make a filesystem here!", 疑似為 live cd 中 lvm 的 bug, 需要使用以下指令解決./sbin/dmsetup status # Outputs status information for each of the device's targetserr.. 改天再來 debug 一下.
/sbin/dmsetup remove_all # remove all device definitions
ref: this.
| [+/-] |
book of linux's hack
poster:
MarlboroMoo on
20:40
tag:
linux,
linux hack
/
Comments: (0)
|
| [+/-] |
remote install linux OS via VNC
poster:
MarlboroMoo on
23:01
tag:
linux,
os,
remote install,
vnc
/
Comments: (0)
|
通常進機房放完安裝光碟後, 應該不會想在那吵雜又寒冷的地方待太久, 這時候可以透過 VNC 遠端安裝的方式來避免這個問題!以下為流程:
- 刷卡進機房
- 於欲重新安裝之主機放入安裝光碟
- 到 console 等待 boot: 提示畫面出現
- 輸入相關安裝參數.
- 待設定完網路組態, 安裝程式提示 VNC 伺服器的 IP 位置.
- 離開機房
- 使用 vnc clinet 繼續安裝
linux vnc vncpassword=PASSWORDlinux text askmethod ddref: this ant this
| [+/-] |
Linux cheatsheet
poster:
MarlboroMoo on
22:10
tag:
bash,
cheatsheet,
command-line,
editor,
linux,
resource,
screen,
terminal
/
Comments: (0)
|
不知道是缺乏安全感, 強迫症, 還是檔案松鼠 ;> 只要是關於 linux command 的任何東西, 都想要收集, 嘿嘿, 不過這些 cheatcheet 真的很好用, 對於 linux 的千千萬萬的指令來說, 有時候很容易就失憶, 把這些 cheatsheet 印在一張張的 A4 紙, 釘在 partition 上, 就無敵拉!!!!!