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