PIXNET Logo登入

All By Myself

跳到主文

With great power comes great responsibility

部落格全站分類:心情日記

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 4月 15 週三 200913:06
  • gdb

看某個位址的值是否被改變
ex: int test = 0;  // global變數, 假設位址是0x66333
disp *(uint64 *)0x66333   // 程式每執行一行就會印出結果
watch *(uint64 *)0x66333  // 變數改變時會印出來

segmentation fault debug
先設定core file size成unlimited: ulimit -c unlimited
./application  //發生segmentation fault時會產生core file
gdb ./application core.xxx

可能會用到的指令: down, p *this, list

r arg1 arg2 arg3 ( = ./a.out arg1 arg2 arg3)
where
l
p /x [parameter] 印出該參數的memory address
x/x [memory address]
x/100x [memory address] 印出target memory address之後100bye的memory address

(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(0) 人氣(539)

  • 個人分類:科學怪談
▲top
  • 3月 28 週六 200922:28
  • vim常用指令

開新的分割視窗
:sp [filename]
    - 切換游標所在視窗: ctrl+w搭配上下左右鍵
開新的分割視窗
:tabnew [filename]
    - 切換游標所在視窗: gt, gT
(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(0) 人氣(2,554)

  • 個人分類:科學怪談
▲top
  • 3月 28 週六 200922:27
  • Linux常用指令


-設定資源: ulimit
                      -a: 列出目前哪些資源受到限制
-設定不限制core file size: ulimit -c unlimited

-印出環境變數: printenv
-設定環境變數: export TEST=/tmp
(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(0) 人氣(539)

  • 個人分類:科學怪談
▲top
  • 3月 27 週五 200920:11
  • Windows commands


dir
%windir%\system32\*.exe
dir %windir%\system32\*.vbs
help
--
Try
to use each command. No need to buy any book~

(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(0) 人氣(82)

  • 個人分類:科學怪談
▲top
  • 3月 27 週五 200920:09
  • 不讓linux的console嗶嗶叫


1. vi ~/.bashrc
INPUTRC=~/.inputrc
(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(0) 人氣(127)

  • 個人分類:科學怪談
▲top
  • 3月 27 週五 200920:06
  • NCTUns usage

 
Other configuration file ===========================
編輯 NCTUns-x.0/src/nctuns/.config file 將用不到的network設成n, 這樣compile就可以變快
編輯/usr/locel/nctuns/etc/ps.cfg檔, 可改變GUI上node預設的protocol stack.
Run simulation ==================================
在run之前必須把iptables關掉 避免跑不出流量.
Method 1 (close iptables temporarily):
service iptables stop (暫時關閉iptables, 重新開機後或執行過iptables就又會啟動)
Method 2 (close iptables permanently):
chkconfig --list iptables (show出 level3 and 5 有沒有關)
chkconfig --level 35 off (關閉 level 3 and 5)
ADV route =====================================
- pkt_handled的值每broadcast一次會減半, 每forward一次會加一
- RtTable, ctrlTable滿了的話size會加倍, 初始大小10
- BUF_THRESHOLD預設值是2
routingResult
NOROUTE: No such entry in rt_table of the Dst_IP
INFINITEENTRY: Dst_IP不等於seqSignHost
REACHABLE: Dst_IP等於seqSignHost
Application =================================
stcp [-p port] [-l writesize] dstIP
stcp [-lip srcIP] dstIP
rtcp [-p port] [-l readsize] [-w throughput.log]
rtg -t/-u [-p port] [-w throughput.log] [-o delay.log]
Kernel =====================================
把src/kernel-patch/linux.xxxx.tar.bz2解壓縮 (用tar xjf xxx.tar.bz2)
1. 如果沒改nctuns kernel name:
make bzImage && make install
2. 如果用不一樣的nctuns kernel name:
(例如用"make menuconfig"到"General setup --> (-nctuns-2008xxxx) Local version - append to kernel release"改名字)
就得 make bzImage && make modules && make modules_install && make install
make modules會先把module編好, make modules_install會在/lib/modules/ 底下產生新的module資料夾
參考 http://zoe.nuper.com/linux/linux_ch8.php
Module =====================================
Constructor (會比init先執行)
- vBind("Name1", &para1): 將tcl內, Name所代表的值存入變數para裡面, 在init()裡面值就會改變
- REG_VAR("Name2", &para2): 將此module的變數para2註冊到SE, 可供其他module取出使用.
取出方法: (type *)get_regvar(module_node_id, module_node_port, "Name2");
e.g., int* getpara = (int *)get_regvar(get_nid(), get_port(), "beamwidth");
init()
- 可在此做module所需變數的初始化
- packet add info (可將額外資訊加入到packet裡面, 帶到其他module去)
e.g., struct wphyInfo *wphyinfo = (struct wphyInfo *)malloc(sizeof(struct wphyInfo));
p->pkt_addinfo("WPHY", (char *)wphyinfo, sizeof(struct wphyInfo));
- packet get info
e.g., struct wphyInfo *wphyinfo;
wphyinfo = (struct wphyInfo *)p->pkt_getinfo("WPHY");
- pkt_setHandler在routing module中會用到, 主要是讓MAC層當封包送不出去時, 可以cross layer的呼叫routing module的function, 讓routing module可做相對應的事, ex. adv_hdler
sendtarget_, recvtarget_本身就是MBinder用來做module之間的連結.
sendtarget_->get_curqlen() > 0 表示在mbinder queue裡面目前有東西還沒往下送, 所以module自己要先queue住此pkt或直接drop掉
sendtarget_->set_upcall(upcall) 是用來當mbinder的pkt往下送後, 會呼叫upcall所指定的function. 一般是用來從上層的module queue裡面抓一個pkt下來放在mbinder裡.避免上層出現pkt out of order的情形. (因為若沒立刻塞一個pkt到MBqueue裡面, 則有pkt進上層時因為get_curqlen()<=0, 就直接往MB送, 不會被module queue住, 可參考ADVD.cc的sendToQueue())
Remove Kernel ================================
0. remove the nctuns directory under /usr/local directory
1. rpm -q kernel-nctuns
You can get the kernel name [Name]
2. rpm -e [Kernel Name]
Set Manually Control ====================================================
1. set manually control, then make again and copy to the directory you want to execution
vim NCTUns-x.0/src/nctuns/nctuns_api.h
#define IPC 0
2-1. set the .sim working directory (valid on current terminal)
EX 1: type command:
export NCTUNS_WORKDIR=/root/Desktop/GUI_test/150Cars_400Roads/150Cars_400Roads.sim
EX 2: use shell script
vim /usr/local/nctuns/etc/nctuns.bash
(then add the following line into nctuns.bashrc)
export NCTUNS_WORKDIR=/root/Desktop/GUI_test/150Cars_400Roads/150Cars_400Roads.sim
(then execute the following command)
source /usr/local/nctuns/etc/nctuns.bash
2-2. set global environment (valid on all terminals)
e.g,
vim /root/.bashrc
(then add the following line into .bashrc)
export NCTUNS_WORKDIR=/root/Desktop/GUI_test/150Cars_400Roads/150Cars_400Roads.sim
(then reboot or logout)

4. If you add (modify) new class under src/nctuns/module/phy, you need to copy the libawp.so to /usr/local/nctuns/lib/
5. execution:
在NCTUns-x.o/src/nctuns目錄下執行./nctuns /xxx/xxx.sim/xxx.tcl
(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(1) 人氣(3,987)

  • 個人分類:科學怪談
▲top
  • 3月 27 週五 200920:06
  • freenx installation and setting


==========================================
nxclient resume問題
當按下suspend關掉nxclient時,
下次想resume若一直都會有negotiating
parameters...
之後timeout的問題
就用工作管理員把nxssh.exe的執行檔先結束
再重開nxclient即可
==========================================
新增環境變數
# PATH="$PATH":
/usr/libexec/nx
========================================== 安裝linux
freenx
安裝freenx
# yum install freenx
配置nxserver
#
/usr/libexec/nx/nxsetup --install
修改權限
# /usr/libexec/nx/nxsetup
--install --setup-nomachine-key
# chmod 666 /dev/urandom (可不用做)
# chmod
666 /dev/null (可不用做)
# chmod 640
/var/lib/nxserver/home/.ssh/authorized_keys2
查看server是否開啟
#
/usr/libexec/nx/nxserver --status
server相關指令
#
/usr/libexec/nx/nxserver --start
# /usr/libexec/nx/nxserver --stop
#
/usr/libexec/nx/nxserver --restart
# /usr/libexec/nx/nxserver
--help
==============================================
新增user
確定 user 是否已經自動幫你加入了,看有沒有自己的 linux 帳號
# nxserver
--listuser
如果沒有的話,那麼就得新增 user, 這個user
必須先有一個帳號在linux機器上
# nxserver --adduser your_name
# nxserver
--passwd your_name
==============================================
安裝XP版的client
安裝 Windows 版的 nxclient, 這可以到
NoMachine
(http://www.nomachine.com/download-package.php?Prod_Id=65)
網站下載.
下載完成以後就進行安裝,基本上都是 step by step, 沒啥困難的.
主要的幾個設定就是 ip, port, 還有
key
接著回到 server, 處理 key 的部份
切換到 /var/lib/nxserver/home/.ssh, 將
client.id_dsa.key 檔案的內容複製出來
#cd /var/lib/nxserver/home/.ssh
#cat
client.id_dsa.key
把這內容貼到 nxclient for Windows 的 key 裡面 (在 configuration
的時候會有個按鈕叫做 "key",點下後可以貼東西
)
保存設定以後,輸入你的帳號與密碼,再進行連結,這樣就大功告成了.
參考資料:
http://www.gsg9.tw/showthread.php?t=1024

(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(0) 人氣(632)

  • 個人分類:科學怪談
▲top
  • 3月 27 週五 200920:06
  • xvidcap on fedora 9


Xvidcap Installation Guide
Introduction: http://xvidcap.sourceforge.net/
====== Installation method 1 (Easier than Installation method 2)
rpm -Uvh http://rpm.livna.org/livna-release-9.rpm
(Ref: http://rpm.livna.org/rlowiki/UsingLivna)
yum install xvidcap
====== Installation method 2
Download the latest tar.gz.
Extract tar.gz and install it.
./configure
(If it has "libXmu can't find in LD_LIBRARY_PATH" problem, use "yum install libXmu-devel")
make && make install
====== Solve hanging problem on Fedora 9
dowonload:
libX11-1.0.3-8.fc7.i386.rpm
libX11-devel-1.0.3-8.fc7.i386.rpm
compiz-0.5.2-0.1.fc7.i386.rpm (If you have dependency error of compiz package)
remove all dependency packages if it shows any dependency error when you try to install old libX11:
My example:
rpm -e compiz-fusion-0.7.6-1.fc9.i386 compiz-fusion-gnome-0.7.6-1.fc9.i386 compiz-gnome-0.7.6-2.fc9.i386
install old libX11 and other packages:
rpm -Uhv --oldpackage libX11*-1.0.3-8.fc7.i386.rpm compiz-0.5.2-0.1.fc7.i386.rpm
====== Launch
Method 1: Applications → Sound & Video → XVidCap Screen Capture
Method 2: type "xvidcap" on terminal

(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(0) 人氣(140)

  • 個人分類:科學怪談
▲top
  • 3月 27 週五 200920:05
  • Calculate the WiMAX mesh throughput of NCTUns


Provided by NCTUns
user: janice
 
(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(1) 人氣(236)

  • 個人分類:科學怪談
▲top
  • 3月 27 週五 200920:04
  • 讓VNC與tty7同步的設定


以下節錄自鳥哥的linux:
http://linux.vbird.org/linux_server/0310telnetssh.php#vnc
如果您想要與 Linux 的 tty7
同步的話,可以利用 VNC 釋出的給 X Server 使用的模組
來加以設定即可。 如果您是 FC4 這個 distribution
的話,恭喜您,系統預設已經將
 vnc.so 這個模組釋出了,您可以查閱 /usr/X11R6/lib/modules/extensions/
這個檔
案,即可知道有沒有 vnc.so 這個模組。如果您沒有這個模組的話, 請參考
 http://phorum.study-area.org/viewtopic.php?t=25713 這一篇文章的說明,
依序來
設定吧!
(繼續閱讀...)
文章標籤

vincentHsu 發表在 痞客邦 留言(0) 人氣(1,345)

  • 個人分類:科學怪談
▲top
12»

參觀人氣

  • 本日人氣:
  • 累積人氣:

熱門文章

  • (190,556)英文各種詞性縮寫與時態
  • (113,558)英語中e.g.和i.e.的用法
  • (3,012)[轉錄]給女孩子的豐胸食譜
  • (573)Vocabulary of "Friends" [1]
  • (370)Spice Girl - 2 become 1

文章分類

  • 酸甜苦辣淡油膩 (7)
  • 外星人專用語 (12)
  • 長生不老的秘訣 (3)
  • 科學怪談 (11)
  • 未分類文章 (1)

最新文章

  • 台中電影院資訊
  • 創意簽名檔[1]
  • 邀請教授真的不簡單...
  • gdb
  • Friends vocabulary season 7 episode 22
  • 要開始寫碩論囉~
  • 頂
  • 愚人節喔...沒感覺=-=
  • Friends vocabulary season 7 episode 12 & 13
  • Friends vocabulary season 7 episode 11

最新留言

  • [24/05/12] 訪客 於文章「英文各種詞性縮寫與時態...」留言:
    請問O.C.是什麼??...
  • [22/04/24] 訪客 於文章「英文各種詞性縮寫與時態...」留言:
    回饋您這方面資訊,我是從 PTT搜尋引擎的排名,看...
  • [20/08/19] jwang0189 於文章「英文各種詞性縮寫與時態...」留言:
    非常實用的文章,謝謝提供,已點廣告表示支持 https://...
  • [18/09/06] 訪客 於文章「英文各種詞性縮寫與時態...」留言:
    請問不定冠詞的英文縮寫??...
  • [17/06/08] 訪客 於文章「英文各種詞性縮寫與時態...」留言:
    object (o.)受詞...
  • [16/08/01] 蘇柏瑋 於文章「英文各種詞性縮寫與時態...」留言:
    有幫助到唷,感溫蛤~...
  • [16/07/27] 宇 於文章「英文各種詞性縮寫與時態...」留言:
    謝謝...
  • [16/07/14] 123 於文章「英文各種詞性縮寫與時態...」留言:
    GOOD.............................
  • [16/01/24] 111 於文章「英文各種詞性縮寫與時態...」留言:
    111111...
  • [16/01/20] zf 於文章「英文各種詞性縮寫與時態...」留言:
    感恩...

個人資訊

vincentHsu
暱稱:
vincentHsu
分類:
心情日記
好友:
累積中
地區:

誰來我家

文章精選

文章搜尋