2013年12月17日 星期二

在office 2007的power point貼上visio的圖檔

在visio畫的圖片啊, 直接按ctrl+c和ctrl+v複製到ppt時, 他好像都會自動轉成點陣圖

這樣圖片看起來就很醜 ˊ_>ˋ

以前2003明明都是會自動轉成visio物件啊啊啊啊啊啊

後來發現ppt的左上角, 有個貼上的按鈕, 下面有個小箭頭可以按

選擇"選擇性貼上", 就可以選擇用visio物件了!!



----

原來這邊編輯文章的時候, 也可以ctrl+v貼上圖片 0.0!!

真方便 XD

2013年11月26日 星期二

調整virtualbox的BSD終端機解析度

ref:
http://www.freebsd.org/doc/zh_TW/books/handbook/consoles.html

可以用下面這個指令來查詢機器支援哪些解析度
# vidcontrol -i mode

然後再用這個指令把目前的螢幕解析度改成那個樣子 (1024x768x16)
# vidcontrol MODE_279

如果合胃口的話, 可以把下面這個指令加到/etc/rc.conf, 之後開機就會自動調整為這個解析度
allscreens_flags="MODE_279"
 
 


install error msg on omnet

checking for Tcl/Tk 8.4 with CFLAGS=" -O2 -DNDEBUG=1   -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-stack-protector -DHAVE_SWAPCONTEXT  " LIBS=" -ltk8.4 -ltcl8.4"... no

configure: error: Tcl/Tk not found, needed for all GUI parts. Version 8.4.0+ and devel package required. Check config.log for more info!


[solve]
yum install bison flex perl tcl-devel tk-devel blt libxml2-devel doxygen graphviz openmpi-devel libpcap-devel


(I am using Fedora 13)

another simulator. XD

http://www.omnetpp.org/

OMNeT++ is an extensible, modular, component-based C++ simulation library and framework, primarily for building network simulators.

OMNeT++ is free for academic and non-profit use, and it is a widely used platform in the global scientific community. Commercial users must obtain a license from omnest.com.

----

let's try.....

2013年11月7日 星期四

更新開機選單

裝好ubuntu後, 再去裝Fedora 15, 會發生開機選單被蓋掉的情形.

Fedora 15沒有辦法抓到事先裝好的ubuntu, 如果這個時候再去選安裝boot loader, 之後就不知道要怎麼回去ubuntu了.

其實這個時候可以選"不要安裝boot loader", 然後重開機後會回到ubuntu.

這個時候只要在終端機打 sudo update-grub, 然後ubuntu就會自動把fedora 15的選項也加到開機選單去了.

真是人性化 XD

2013年10月24日 星期四

安裝compat-drivers的錯誤訊息


compat-3.8.h:47:32: error: redefinition of ‘kref_get_unless_zero’


後來根據這篇:
http://ubuntuforums.org/showthread.php?t=2149438

直接修改 compat-drivers-3.9-rc4-2-su/include/linux/compat-3.8.h 這個檔案

把這段註解掉
static inline int __must_check kref_get_unless_zero(struct kref *kref)
{
        return atomic_add_unless(&kref->refcount, 1, 0);
}

然後make就過了 XD

2013年10月18日 星期五

WHR-G300N-V2 半磚修復過程 XD

徵狀: 開機後, LED會閃紅燈. 完全沒有反應. (好像是刷錯韌體造成的? XD)

有參考這個網頁的作法 http://www.dd-wrt.com/wiki/index.php/WHR-G300N_V2
可是沒有試成功 ˊ_>ˋ
(他的接法應該也是網路線插在LAN port上? 之後有需要重刷再研究看看. 科~)

最後就只好開大絕, 直接用console line進去打指令寫入韌體 XD

---------------------------------------------------
PC端的IP設為192.168.11.2 / 255.255.255.0

網路線連接到AP的LAN port!! (不是WAN喔, 接錯會無法傳檔案)

準備好console line, 插在AP上面

不過要先自行把AP打開, 把針腳位置的銲錫清掉, 然後再自己焊接四個針腳上去 XD

把WAN/LAN port, 電源線朝下, LED燈在上方, 針腳的位置依序是
VCC
GND
TX
RX

不過在連接的時候, VCC不用接喔!! 只需要接後面三個就好

---------------------------------------------------
http://www.right.com.cn/forum/thread-53267-1-1.html

參考這篇, 去抓
http://115.com/file/aq7n3f3f#
firmware(whr-g300n_v2串口修复).bin

然後檔名改成firmware.bin
接著打開tftp程式, 讓他去讀取這個資料夾
---------------------------------------------------

準備就緒後, 用tera term連進去.
  Baud rate = 115200
  Data Bits = 8
  Parity = none
  Stop bits = 1
  Flow control = none

沒問題的話, 電源打開後可以在終端機看到訊息, 反正就一直按ctrl+c, 最後就可以取得控制權, 能在終端機上面打字

---------------------------------------------------

上面的東西都準備好後

(tftp和檔案, 網路線有接好, PC的IP有設定好)

然後在終端機直接打 run ut_fw

AP就會自己去下載檔案來寫入機器

ps. 我當時有試著用過別的版本firmware.bin, 可是只有中國的這個檔案可以成功寫入. XD

---------------------------------------------------

完成後, 應該就會自動重開機(有點忘了)

預設的ddwrt帳密是 root/admin

不過我當時弄完之後, console會一直出現錯誤訊息
resetting; code: 01

我也不知道是啥原因 ˊ_>ˋ


刷完這版的韌體後, 可以打開web介面, 於是我又去抓whr-g300nv2-firmware-MULTI.bin下來

http://www.dd-wrt.com/dd-wrtv2/down.php?path=downloads%2Fothers%2Feko%2FBrainSlayer-V24-preSP2%2F2013%2F07-24-2013-r22118%2Fbuffalo_whr_g300nv2/

利用他原本的web介面upgrade, 並且把設定值全部清除.

目前看起來應該是沒問題了 XD

2013年10月2日 星期三

BSD 安裝 kernel source

最近跑去旁聽一門BSD的實驗課 XDDDD

順便學一下BSD好了, 科科~

----

在用portmaster安裝virtualbox-ose時, 會出現一些錯誤訊息.

其中一段是說要安裝kernel source.

然後查了一下, 一開始是用 sysinstall  去勾選src的東西 (忘記在哪看到了XD)
可是接下來就會一直出現無法連線的錯誤訊息. 囧~~

大概像這樣吧!?
Unable to transfer the sbase distribution from 
ftp://ftp.freebsd.org.                         
Do you want to try to retrieve it again?

後來在這邊找到另一個解決方法
http://forums.freebsd.org/showthread.php?t=29172

我的是9.1-RELEASE, 所以要把相關連結換成9.1
先把檔案抓下來, 然後解壓縮複製到相應的路徑, 之後再用svn更新.

一開始好像沒有svn可以用, 可以用portmaster去安裝subversion.

wget ftp://ftp.tw.freebsd.org/pub/FreeBSD/releases/i386/9.1-RELEASE/src.txz
tar -C / -xvzf src.txz
svn checkout https://svn0.us-west.freebsd.org/base/releng/9.1 /usr/src


然後一個晚上過去, 似乎是安裝完了??
沒有看到錯誤訊息 XD
可是能不能用還是未知數(???)

2013年9月4日 星期三

重新安裝 ns2

重裝ns2時, 要先把舊的設定檔/暫存都清掉, 才可以用 ./install 重新安裝.
不然就一定要放在相同路徑才可以安裝. @@

以下是我用的清除腳本, 應該是還可以再簡化一點, 可是我懶得弄 XDDDD

----------------------------------------------------------------
#! /bin/sh
# enter all folder to make clean
# only for ns 2.29

CUR_PATH=`echo $(pwd)`

rm -f $CUR_PATH/xgraph-12.1/config.cache
rm -f $CUR_PATH/tcl8.4.11/unix/config.cache
rm -f $CUR_PATH/tk8.4.11/unix/config.cache

cd $CUR_PATH/cweb; make distclean; make clean;
cd $CUR_PATH/cweb/examples; make distclean; make clean;
cd $CUR_PATH/sgb; make distclean; make clean;
cd $CUR_PATH/tclcl-1.17; make distclean; make clean;
cd $CUR_PATH/otcl-1.11; make distclean; make clean;
cd $CUR_PATH/zlib-1.2.3; make distclean; make clean;
cd $CUR_PATH/zlib-1.2.3/contrib/blast; make distclean; make clean;
cd $CUR_PATH/zlib-1.2.3/contrib/untgz; make distclean; make clean;
cd $CUR_PATH/zlib-1.2.3/contrib/puff; make distclean; make clean;
cd $CUR_PATH/zlib-1.2.3/contrib/minizip; make distclean; make clean;
cd $CUR_PATH/xgraph-12.1; make distclean; make clean;
cd $CUR_PATH/tcl8.4.11/macosx; make distclean; make clean;
cd $CUR_PATH/tcl8.4.11/unix; make distclean; make clean;
cd $CUR_PATH/tcl8.4.11/unix/dltest; make distclean; make clean;
cd $CUR_PATH/nam-1.11; make distclean; make clean;
cd $CUR_PATH/ns-2.29/indep-utils/cmu-scen-gen/setdest; make distclean; make clean;
cd $CUR_PATH/ns-2.29/indep-utils/dosdbell; make distclean; make clean;
cd $CUR_PATH/ns-2.29/indep-utils/webtrace-conv/nlanr; make distclean; make clean;
cd $CUR_PATH/ns-2.29/indep-utils/webtrace-conv; make distclean; make clean;
cd $CUR_PATH/ns-2.29/indep-utils/webtrace-conv/epa; make distclean; make clean;
cd $CUR_PATH/ns-2.29/indep-utils/webtrace-conv/dec; make distclean; make clean;
cd $CUR_PATH/ns-2.29/indep-utils/webtrace-conv/ucb; make distclean; make clean;
cd $CUR_PATH/ns-2.29/indep-utils/model-gen; make distclean; make clean;
cd $CUR_PATH/ns-2.29; make distclean; make clean;
cd $CUR_PATH/ns-2.29/ns-tutorial; make distclean; make clean;
cd $CUR_PATH/ns-2.29/emulate/support/src/nrgarp; make distclean; make clean;
cd $CUR_PATH/ns-2.29/doc; make distclean; make clean;
cd $CUR_PATH/ns-2.29/doc/kfall; make distclean; make clean;
cd $CUR_PATH/tk8.4.11/macosx; make distclean; make clean;
cd $CUR_PATH/tk8.4.11/unix; make distclean; make clean;
cd $CUR_PATH/gt-itm/sgb2ns; make distclean; make clean;
cd $CUR_PATH/gt-itm/src; make distclean; make clean;
----------------------------------------------------------------

2013年8月30日 星期五

error message (when installing backports)

I got an error message when I install backports.
(how to type Chinese under Ubuntu? orz....)

the following is the error message:

-----------------------------------------------------------
backports-3.10-2$ make menuconfig

Generating local configuration database from kernel ... done.
cc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="" -DLOCALE   -c -o mconf.o mconf.c
In file included from mconf.c:23:0:
lxdialog/dialog.h:38:21: fatal error: ncurses.h: No such file or directory
compilation terminated.
make[2]: *** [mconf.o] Error 1
make[1]: *** [menuconfig] Error 2
make: *** [menuconfig] Error 2

-----------------------------------------------------------
and, the solution is just using apt-get to install some packages. XD

sudo apt-get install libncurses5-dev libncursesw5-dev

2013年7月18日 星期四

tcl 內建語法 (!?)

無意中發現的 XD

http://www.tcl.tk/man/tcl8.4/TclCmd/

expr應該比較容易用到!?
http://www.tcl.tk/man/tcl8.4/TclCmd/expr.htm

----

科科

2013年7月16日 星期二

在windows讀取linux的磁區

http://www.diskinternals.com/linux-reader/

DiskInternals Linux Reader is a new easy way to do this. This program plays the role of a bridge between your Windows and Ext2/Ext3/Ext4, HFS and ReiserFS file systems.

Linux Reader is 100% FREE.

----

看起來應該是可以用!? XD

2013年6月26日 星期三

用shell script產生兩個不重複的亂數

#!/bin/bash
export PATH=/bin:/sbin:/usr/bin:/usr/sbin

n=`expr \( \( $RANDOM % 7 \) + 1 \)`
echo $n

m=`expr \( \( $RANDOM % 7 \) + 1 \)`

while [ $n == $m ]
  do
    m=`expr \( \( $RANDOM % 7 \) + 1 \)`
  done

echo $m

----

單純紀錄 XD

2013年5月23日 星期四

win7不能開機!! (安裝Fedora之後)

今天幫學弟裝Fedora, 然後要切回win7的時候, 竟然出現錯誤訊息, 不能開機. 囧

BOOTMGR is missing
Press Ctrl+Alt+Del to restart 


後來查了一下, 發現只要修改grub的選單就可以開進win7了. XD

ref: http://ubuntuforums.org/showthread.php?t=1159205

以我學弟為例, 他原本win7的選單是寫 (hd0,0), 改成 (hd0,1)就可以開機了. XDD

2013年5月21日 星期二

openwrt 的開機選單

其實只是存起來當備份而已. 科科

這樣就可以直接把這些選單語法加到Fedora的grub選單裡面,

直接用原本的開機選單選擇隨身碟開openwrt. XDD


title   OpenWrt
root    (hd0,0)
kernel  /boot/vmlinuz root=/dev/sda2 rootfstype=ext4 rootwait console=tty0 console=ttyS0,38400n8 noinitrd reboot=bios
boot

title   OpenWrt (failsafe)
root    (hd0,0)
kernel  /boot/vmlinuz failsafe=true root=/dev/sda2 rootfstype=ext4 rootwait console=tty0 console=ttyS0,38400n8 noinitrd reboot=bios
boot

2013年4月10日 星期三

把ns2(2.29, multichannel版)移到ubuntu

我用的版本是 Ubuntu 12.04.1 LTS
原本在Fedora10上面裝了ns2 with multichannel (2.29)

因為是整個資料夾移過去, 所以要重新安裝.

重新安裝的話, 我是先去各個資料夾make clean, 再把三個config.cache刪掉, 順便把ns-allinone-2.29/bin/裡面的link都刪掉, 最後再重新 ./install 就好了

只是在 ./install 過程中會出現一些錯誤訊息, 然後找到了這篇
Installing ns-2.29 in Ubuntu 12.04
http://www.nsnam.com/2012/06/installing-ns-229-in-ubuntu-1204.html

按照他的步驟去修改, 然後就安裝成功了 XD

-------
三個config.cache的位置
ns-allinone-2.29/xgraph-12.1/config.cache
ns-allinone-2.29/tcl8.4.11/unix/config.cache
ns-allinone-2.29/tk8.4.11/unix/config.cache


-------
進去每個資料夾make clean (其實只要找出Makefile在哪個資料夾, 就知道要去哪裡make clean了)

cd ns-allinone-2.29/cweb/
make clean
cd ns-allinone-2.29/cweb/examples/
make clean
cd ns-allinone-2.29/sgb/
make clean
cd ns-allinone-2.29/tclcl-1.17/
make clean
cd ns-allinone-2.29/otcl-1.11/
make clean
cd ns-allinone-2.29/zlib-1.2.3/
make clean
cd ns-allinone-2.29/zlib-1.2.3/contrib/blast/
make clean
cd ns-allinone-2.29/zlib-1.2.3/contrib/untgz/
make clean
cd ns-allinone-2.29/zlib-1.2.3/contrib/puff/
make clean
cd ns-allinone-2.29/zlib-1.2.3/contrib/minizip/
make clean
cd ns-allinone-2.29/xgraph-12.1/
make clean
cd ns-allinone-2.29/tcl8.4.11/macosx/
make clean
cd ns-allinone-2.29/tcl8.4.11/unix/
make clean
cd ns-allinone-2.29/tcl8.4.11/unix/dltest/
make clean
cd ns-allinone-2.29/nam-1.11/
make clean
cd ns-allinone-2.29/ns-2.29/indep-utils/cmu-scen-gen/setdest/
make clean
cd ns-allinone-2.29/ns-2.29/indep-utils/dosdbell/
make clean
cd ns-allinone-2.29/ns-2.29/indep-utils/webtrace-conv/nlanr/
make clean
cd ns-allinone-2.29/ns-2.29/indep-utils/webtrace-conv/
make clean
cd ns-allinone-2.29/ns-2.29/indep-utils/webtrace-conv/epa/
make clean
cd ns-allinone-2.29/ns-2.29/indep-utils/webtrace-conv/dec/
make clean
cd ns-allinone-2.29/ns-2.29/indep-utils/webtrace-conv/ucb/
make clean
cd ns-allinone-2.29/ns-2.29/indep-utils/model-gen/
make clean
cd ns-allinone-2.29/ns-2.29/
make clean
cd ns-allinone-2.29/ns-2.29/ns-tutorial/
make clean
cd ns-allinone-2.29/ns-2.29/emulate/support/src/nrgarp/
make clean
cd ns-allinone-2.29/ns-2.29/doc/
make clean
cd ns-allinone-2.29/ns-2.29/doc/kfall/
make clean
cd ns-allinone-2.29/tk8.4.11/macosx/
make clean
cd ns-allinone-2.29/tk8.4.11/unix/
make clean
cd ns-allinone-2.29/gt-itm/sgb2ns/
make clean
cd ns-allinone-2.29/gt-itm/src/
make clean

在ubuntu上安裝freenx (Ubuntu 12.04.1 LTS)

原本想要在ubuntu上設定遠端, 可是vnc一直設定失敗 -.-
用內建的desktop share又很頓, 不知道為啥 orz...
最後就改用nxserver. XD
搞了很久終於可以看到畫面了   囧~~

------------------------------------------------------
我的版本是  Ubuntu 12.04.1 LTS

主要安裝流程  (請參考 https://help.ubuntu.com/community/FreeNX )

sudo apt-add-repository ppa:freenx-team
sudo sed -i 's/natty/lucid/g' /etc/apt/sources.list.d/freenx-team-ppa-natty.list
sudo apt-get update 
sudo apt-get install freenx
wget https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz
tar -xvf nxsetup.tar.gz 
sudo cp nxsetup /usr/lib/nx/nxsetup
sudo /usr/lib/nx/nxsetup --install 
(安裝完會跟你說key在哪裡) 

把key找出來, 複製, 待會在windows上裝好nx-client會用到
sudo cat /var/lib/nxserver/home/.ssh/client.id_dsa.key 

================================
NX Client for Windows
http://www.nomachine.com/download-package.php?Prod_Id=3835

================================
因為我設定完連線後,會出現!M的logo, 然後畫面是黑的, 過一陣子程式就關閉了.  囧
試了一堆方法後終於成功了, 可是我也不知道哪個才是關鍵, 所以就通通記下來 XDD

================================
 [ref1] http://wiki.centos.org/zh-tw/HowTos/FreeNX
 如果 nx 在最後一步連線失敗並停了下來,請檢查你在伺服器上的主目錄。刪除所有 .Xauthority* 檔(或把它們移往別處)然後重試。要是這樣沒有幫助,請嘗試移除 /tmp/.X11-unix。
 
編輯 /etc/nxserver/node.conf 並且更改此行:
#AGENT_EXTRA_OPTIONS_X="-nolisten tcp"

為:
AGENT_EXTRA_OPTIONS_X=""

================================
[ref2] https://help.ubuntu.com/community/FreeNX

[Enabling the PASSDB database]
編輯 /etc/nxserver/node.conf , 包含這句
ENABLE_PASSDB_AUTHENTICATION="1"

[Adding the User ID and Password to the database:]
sudo nxserver --adduser xxxx
sudo nxserver --passwd  xxxx

sudo vi /etc/ssh/sshd_config , 包含這句
AllowUsers nx xxxx

sudo service ssh restart


================================
[ref 3] http://notepad2.blogspot.com/2012/04/install-freenx-server-on-ubuntu-1110.html
我忘記改到啥東西, 看到錯誤訊息跳出來 (原本都不會跳), 然後訊息有gnome-fallback
後來在這個網頁看到說要安裝東西

[Install gnome-session-fallback:]
sudo apt-get install gnome-session-fallback

[Edit /usr/NX/etc/node.conf file as root, and enable the following line]
COMMAND_START_GNOME="gnome-session --session=gnome-fallback"

[Restart freenx server]
sudo /etc/init.d/freenx-server restart

------------------------------------------------------------------------------------

最後弄完 gnome-session-fallback 就可以看到畫面了 (感動)

而且速度也比內建的desktop share快很多 = =+

2013年2月13日 星期三

ns2很蠢的錯誤訊息 XD

今天跑實驗課的code, 一直出現
mobile/tworayground.cc: TwoRayGround propagation model assume flat ground

最後才發現, 原來我在設定node座標的時候, 有一個node的Z座標不是0.   XDDDDDD

Z座標通通弄成0就沒有這個錯誤訊息了.

--

天啊, 我怎麼會犯這麼蠢的問題 XD