ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上

顯示具有 Configuration 標籤的文章。 顯示所有文章
顯示具有 Configuration 標籤的文章。 顯示所有文章

2015年8月18日 星期二

github 終於可以動了

github 可以動了。
根據每一個機器.account,要 copy account 的 dsa /rsa pub key 到 github 中。
然後就可以把 github 當 git server 用了。
create new project/repository 可以用 github 的介面完成。

這一篇 http://help.github.com/troubleshooting-ssh/ 有 ssh 的 trouble shooting.

github 可以為每一個 repo 建立一個 homepage,follow instruction。
http://pages.github.com/#project_page_generator
要注意的是,這個 default 的 homepage 產生需要時間,所以按下 button 後馬上去看會是 404 page。
要等大約 3 min (說明是說 10 min)才會出現。


ref:



用 https ,不用 ssh

如果有一些公司的mis 不願意開 ssh port,github 也有提供另一種 access 的方法:

需要 1.6.6 以上的 git (git --version 會顯示,ubuntu 10.10 的版本是 1.7)。
command:
$ git clone https://[email protected]/username/project.git username : 你在 github 使用的 username。
project : 你的 repository 名稱。

這個新版的 git 會 prompt 要你輸入 password。你就要輸入 你在 github 的 password。


ref: https://github.com/blog/642-smart-http-support



另外,在 proxy 後面,clone OK, push fail:
$ git push
error: The requested URL returned error: 403 while accessing https://github.com/checko/mdnsreponder_gingerbread.git/info/refs

fatal: HTTP request failed
可以參考這篇:http://blog.csdn.net/happyteafriends/article/details/11554043

修改該 repo 的 .git/config, 加上紅色部份...

[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://checko@github.com/checko/mdnsreponder_gingerbread.git

ref: https://github.com/markkolich/blog/blob/master/content/entries/pushing-to-an-http-git-remote-ref-on-ubuntu-1004-lts-with-git-1704-403-inforefs.md

git config 修改 remote:
git config 命令可以修改 config 檔。
cat config 出來看一下:
[core]
 repositoryformatversion = 0
 filemode = true
 bare = false
 logallrefupdates = true
[remote "origin"]
 fetch = +refs/heads/*:refs/remotes/origin/*
 url = https://[email protected]/checko/python_repo.git
[branch "master"]
 remote = origin
 merge = refs/heads/master
修改 remote origin 的 url 就用:
$ git config remote.origin.url https://[email protected]/checko/python_repo.git
就可以了。

2014年5月15日 星期四

在gnome 3 (Wheezy) 的 application list 中加入新莊的 application

ref: http://blog.randell.ph/2011/08/01/how-to-create-custom-application-launchers-in-gnome-3/

大概就是利用 alacarte ( Main Menu) 的新增 功能。

在 gnome (腳) -- System Tool -- Main Menu
就會啟動 alacarte.

然後選你要的 category, 選右邊 New Item,
接著就跟以前一樣了..

2012年6月22日 星期五

SD card 的 cid

在 /sys 裡: cat /sys/block/mmcblk0/../../cid
因為 /sys 這個 node 是 ln,所以用 ../../


ref: http://stackoverflow.com/questions/3348643/how-to-read-the-sd-card-id-number

2011年12月23日 星期五

enable dell inspiron N4010 wireless module

先 lspci 看一下 wireless module 是.. 04:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01) 或是用 lshw --class network 看 *-network description: Wireless interface product: BCM4313 802.11b/g/n Wireless LAN Controller vendor: Broadcom Corporation physical id: 0 bus info: pci@0000:04:00.0 logical name: wlan0 version: 01 serial: 5c:ac:4c:98:d7:59 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=brcm80211 ip=192.168.43.230 latency=0 multicast=yes wireless=IEEE 802.11bgn resources: irq:17 memory:f0300000-f0303fff 知道是 BCM4313

然後 google 到這一篇:http://wiki.debian.org/brcm80211
照著作,安裝 firmware-brcm80211,然後 modprobe..
-- 奇怪我第一次 modprobe 沒效, -r 後再 一次才 iwconfig OK.

裝進去後,就可以在 GUI networkmanager applet看到...
... 就可以操作了..

2011年2月14日 星期一

openocd : target_scrupt , target configure -event

以前的 opencoded 操作範例 都又 target_script 0 .. 但是現在做起來卻說不認識 target_script_0,google 說 target_script 已經被 event 機制取代 這一篇也有說 target_script 已經淘汰了,由 targget event 取代 target_script <target#> <eventname> <scriptname> use <target_name> configure -event <eventname> "script <scriptname>" 至於 event 有哪些,要看 opencod 的 user manual:

The following target events are defined:

  • debug-halted The target has halted for debug reasons (i.e.: breakpoint)
  • debug-resumed The target has resumed (i.e.: gdb said run)
  • early-halted Occurs early in the halt process
  • gdb-attach When GDB connects. This is before any communication with the target, so this can be used to set up the target so it is possible to probe flash. Probing flash is necessary during gdb connect if gdb load is to write the image to flash. Another use of the flash memory map is for GDB to automatically hardware/software breakpoints depending on whether the breakpoint is in RAM or read only memory.
  • gdb-detach When GDB disconnects
  • gdb-end When the target has halted and GDB is not doing anything (see early halt)
  • gdb-flash-erase-start Before the GDB flash process tries to erase the flash
  • gdb-flash-erase-end After the GDB flash process has finished erasing the flash
  • gdb-flash-write-start Before GDB writes to the flash
  • gdb-flash-write-end After GDB writes to the flash
  • gdb-start Before the target steps, gdb is trying to start/resume the target
  • halted The target has halted
  • reset-assert-pre Issued as part of reset processing after reset_init was triggered but before either SRST alone is re-asserted on the scan chain, or reset-assert is triggered.
  • reset-assert Issued as part of reset processing after reset-assert-pre was triggered. When such a handler is present, cores which support this event will use it instead of asserting SRST. This support is essential for debugging with JTAG interfaces which don't include an SRST line (JTAG doesn't require SRST), and for selective reset on scan chains that have multiple targets.
  • reset-assert-post Issued as part of reset processing after reset-assert has been triggered. or the target asserted SRST on the entire scan chain.
  • reset-deassert-pre Issued as part of reset processing after reset-assert-post has been triggered.
  • reset-deassert-post Issued as part of reset processing after reset-deassert-pre has been triggered and (if the target is using it) after SRST has been released on the scan chain.
  • reset-end Issued as the final step in reset processing.
  • reset-init Used by reset init command for board-specific initialization. This event fires after reset-deassert-post.

    This is where you would configure PLLs and clocking, set up DRAM so you can download programs that don't fit in on-chip SRAM, set up pin multiplexing, and so on. (You may be able to switch to a fast JTAG clock rate here, after the target clocks are fully set up.)

  • reset-start Issued as part of reset processing before reset_init is called.

    This is the most robust place to use jtag_rclk or adapter_khz to switch to a low JTAG clock rate, when reset disables PLLs needed to use a fast clock.

  • resume-start Before any target is resumed
  • resume-end After all targets have resumed
  • resume-ok Success
  • resumed Target has resumed

event script 可以寫 echo "ok ok ok". 這樣可以確認什麼時候script被 run 到。

2011年1月21日 星期五

libusb-dev , libusb.h & usb.h

libusb 的 header file 好像換掉了,不是 libusb.h,改成 usb.h

用 aptitude search libusb 可以看到有 libusb-dev 這個 package。
install 後,用 dpkg -L libusb-dev 看一下這個 package 裝了什麼東西:
$dpkg -L libusb-dev /usr/bin/libusb-config /usr/include/usb.h /usr/lib/libusb.a /usr/lib/libusb.la /usr/lib/pkgconfig /usr/lib/pkgconfig/libusb.pc /usr/lib/libusb.so 可以看到沒有 libusb.h ....

libusb.org 有說明 這個相容性問題 http://www.libusb.org/wiki/libusb-1.0#Backwardscompatibility
libusb-1.0 is not backwards compatible with libusb-0.1 - all function names are different, etc. 
However, libusb-1.0 is designed to be happily installable alongside libusb-0.1 (even in the default 
configuration) so the lack of backwards compatibility is not really a problem - users can have both 
libusb versions present on the same system without conflict.

That said, there is a libusb-compat-0.1 compatibility layer. This is a "wrapper" which converts 
libusb-0.1 function calls to their 1.0 equivalents. For more info, see libusb-compat-0.1.
所以..要麻 install libusb-0.1 ,不然就要 libusb-compat-0.1。
不然就要改code.

把 code 的 include libusb.h 改 usb.h 試試。
就 OK 了。



從 pkg -L libusb 的 list 可以看到,有提供 libusb-config。
試 run 一下:
$libusb-config Usage: libusb-config [OPTIONS] [LIBRARIES] Options: [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] 可以知道,就像 libsdl,用 libusb-config --libs , libusb-config --cflags 會列出build 時的 參數。



ref : http://www.linuxquestions.org/questions/linux-newbie-8/ubuntu-9-10-include-libusb-libusb-h-802880/

fix xinput.d not exist -- 後續 of upgrade to squeeze

因為 upgrade 到 squeeze 後, x.org 重新安裝。之後 dist-upgrade 就會出現: update-alternatives: error: alternative path /etc/X11/xinit/xinput.d/scim-bridge doesn't exist. 查一下我連 xinput.d 這個 folder 都沒有,所以就 install xinput。 然後到舊的 把 xinput.d/sci* copy 過來,再作一次 dist-upgrade 就.. The following partially installed packages will be configured: scim-bridge-agent scim-bridge-client-gtk No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used. Setting up scim-bridge-agent (0.4.16-2+b1) ... update-alternatives: using /etc/X11/xinit/xinput.d/scim-bridge to provide /etc/X11/xinit/xinput.d/ja_JP (xinput-ja_JP) in auto mode. update-alternatives: using /etc/X11/xinit/xinput.d/scim-bridge to provide /etc/X11/xinit/xinput.d/ko_KR (xinput-ko_KR) in auto mode. update-alternatives: using /etc/X11/xinit/xinput.d/scim-bridge to provide /etc/X11/xinit/xinput.d/zh_CN (xinput-zh_CN) in auto mode. update-alternatives: using /etc/X11/xinit/xinput.d/scim-bridge to provide /etc/X11/xinit/xinput.d/zh_TW (xinput-zh_TW) in auto mode. update-alternatives: using /etc/X11/xinit/xinput.d/scim-bridge to provide /etc/X11/xinit/xinput.d/zh_HK (xinput-zh_HK) in auto mode. update-alternatives: using /etc/X11/xinit/xinput.d/scim-bridge to provide /etc/X11/xinit/xinput.d/zh_SG (xinput-zh_SG) in auto mode. Setting up scim-bridge-client-gtk (0.4.16-2+b1) ... 就 OK 了(?)

2011年1月4日 星期二

fdisk in shell script

nelson 說的 在 shell script 裡要用 fdisk ,可以這樣用: #!/bin/sh sudo fdisk /dev/sdc <lt; EOF n p 1 w EOF exit 其中有兩行只按 enter,對應 fdisk 的操作

2010年12月30日 星期四

mkfs.ext4 for ARM (Android)

因為 eSD, eMMC mount 在版上,所以不能用讀卡機接到 PC 作 format。
所以要再 target board 上作 mkfs.ext4。
而且因為 bionic 的關係,要 static link lib.

partition 還好,busybox 就有支援, ext4 就沒有 (到1.18 還沒有),
所以只好 build 一版 for arm 的 mkfs (mke2fs).

這一篇:mtab 有多重要 有完整的說明。
另外 這一篇:制作嵌入式文件系统工具 mkfs.ext2 mkfs.ext3 mkfs.ext4 也有說明

Download http://sourceforge.net/projects/e2fsprogs/

解開後,run config:
LDFLAGS=-static ./configure --host=arm-none-linux-gnueabi 然後 make 就可以了,會在 misc 下找到 mke2fs.

copy 到 target 上,用
#mke2fs -t ext4 /dev/block/mmcblk2p4 就 .... 會像 elleryq 說的一樣,因為沒有 /etc/mtab ,所以沒有辦法做出 journal.

跟elleryq說的一樣,建一個空的 /etc/mtab 就可以了。


或是用 busybox 的 mkfs.ext3 format 完在用
# tune2fs -O extents,uninit_bg,dir_index /dev/sdxn #e2fsck /dev/sdxn
ref
  1. https://ext4.wiki.kernel.org/index.php/Ext4_Howto#Converting_an_ext3_filesystem_to_ext4
  2. http://wiki.debian.org.hk/w/Format_disk_as_Ext2,_Ext3_or_Ext4

2010年12月27日 星期一

install a Master Boot Record

在 mbr 套件。 有 install-mbr 用 #install-mbr /dev/sda 可以用來在 usb driver 建立開機磁區。

2010年10月12日 星期二

disable auto mount in ubuntu

partition , format 完,要做 dd 時,要注意最好把 natilus 的 auto mount 關掉。
方法 ref http://www.liberiangeek.net/2010/09/disableenable-auto-mount-ubuntu-10-0410-10-maverick-meerkat/

大概就是:
  • 開啟 gconf-editor
  • 到 apps -- nautilus -- pre-ference-media auto mount open
  • 把 auto mount 的 option 關掉,同時把 never 打開。

另外,到了 xential 時,如果用 lxde 做 desktop。
方法是:
  • 開啟 pcmanfm
  • Edit - Preference - Volume Management
  • Auto Mount 的 option 全部 uncheck

2010年5月31日 星期一

Enable X font server

要啟動 font server,要安裝 xfs font server 這個 package。 雖然現在 X Server 大多已經不用 font server ,而改用 client side render 了。 但是在用 Xming 的時候,有 font server 還是比較方便。 安裝: # aptitude install xfs config:
裝完 xfs 後,/etc/X11 下就會有 fs 這個 folder,裡面會有 config。
把 config 的
no-listen = tcp
這一行 comment 掉後,重新啟動 xfs (/etc/init.d/xfs) 就可以
font server 的 service port 是 7100,可以用 netstate 來看。 裝完後,在 Xming 的 remote font server 欄為就可以填上 font server 的 ip address。

2010年2月27日 星期六

worklog - follow "first trial with busybox"

follow 這一篇 :busybox 初探
結果一堆,,,
先是 qemu 起不來,沒有動作:這是因我用 vnc 操作的關係,又用su - 切換 user,導致 X 無法授權啟動(?)
然後是一些要補充的:
  1. /etc/init.d/rcS 要增加 x 權限,否則會有permission denied 的錯誤。
  2. 建立 busy link 時要注意 link path.
job control 原來指的是ctrl-z, fg, bg 這些把目前run 的 process 暫停,丟到background或拉回foreground 的動作。 * 最後那個改 inittab 的 console 為 tty ,好像是不需要的,因為inittab 的第一個 item 是 label 而已.

2009年12月1日 星期二

Enable remote X server in ubuntu 9.10

ubuntu 9.10 的 X Server 設定改了。 gdm 設定檔是: /etc/gdm/gdm.schema 要 enable remote X Server,要修改成:
  <schema>
    <key>security/DisallowTCP</key>
    <signature>b</signature>
    <default>false</default>
  </schema>
允許 TCP connection。 完成後重新啟動 X, gdm (重開機比較快)。 然後可以用 nmap 看一下 X11 port 有沒有 service。 另外,還要用 xhost command 允許 client host 連線:
xhost +  允許所有 host 連線
Client 端就只要設定 DISPLAY 變數到 Server ip:display number 就可以。 從 nmap 可以看到 X server listen port, X 從 6000 開始。 所以 Client 要設:
export DISPLAY=192.168.145.143:0
就可以。
另外,Server都設好後,可以用
ssh -X 192.168.144.250
連線到 client,用 -X option 告知將要進行X session forward。 連線後,可以用
echo $DISPLAY
localhost:10.0
看一下。 然後,執行任何 x client ap
同樣的,在 gdm.schema 剛剛修改的後面有xdmcp 的設定,default 是關閉,可以把他打開。 Client 端可以用 ubuntu 附的 Tsclient (遠端桌面),可以選 xdmcp,但是 default 是沒有安裝。 所以要手動 install xnest。
aptitude install xnest

Enable "Key sequence to Kill the X server" in ubuntu 9.10

ubuntu 9.10 把 disable X server 的 shortcut 拿掉了。 要重新 enable 的話,要:
  1. System->Preferences->Keyboard
  2. Layouts tab --- Layout options
  3. “Key sequence to kill the X server”. Check “Ctrl+Alt+Backspace”

2009年11月27日 星期五

Auto Launch Network Management without asking password

ubuntu 9.10 有開機後自動login功能,但是要啟動networking 時,竟然還要問password,這樣還是白搭。 要自動輸入password的法就是設定 network applet 可以讓所有人使用:
  1. 再network manager applet 按右鍵,選 edit connection
  2. 選Wired或Wireless tab,然後選一個connection , edit
  3. 勾選下面Available to All Users
這樣下次重開機就可以自動使用網路了

2009年8月17日 星期一

Virtualbox 3.0 USB in Debian Lenny

Virtualbox 3.0 (none open-source version) 支援 usb 裝置。

但是裝完後,要設定好 host linux 的 usb 使用權限,Virtualbox 才能正常的 access usb。

但是usb 的權限好像在很多地方設。

最後 follow 下面的文章:
Debian Lenny, VirtualBox USB device



Virtualbox USB not working in Debian Lenny

做的事情大概有:


Edit the rules in file /etc/udev/rules.d/91-permissions.rules for Lenny. Change around line 37 to:
   # usbfs-like devices
   SUBSYSTEM=="usb_device", MODE="0664"
   SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usbusers", MODE="0664
重點設定 groupe,並且設定 mode。
不要忘記這個 groupe 是原來不存在的,要新增。

還有修改 /etc/init.d/mountkernfs.sh (line 75),原來是:
domount usbfs usbdevfs /proc/bus/usb usbfs -onodev,noexec,nosuid
一樣,加上groupeid 和 access mode:
domount usbfs usbdevfs /proc/bus/usb usbfs onodev,noexec,nosuid,
devmode=0664,devgid=46
其中 devgid=46的 46 是 usbusers 的 groupe id。

* 不要忘記要把 要使用 virtualbox的 user 加到 usbusers groupe 中。

2009年7月3日 星期五

uimage 的 quiet_cmd_uimage ...

在找 uImage 的 Makefile 時,最後指向:
 arch/arm/boot/Makefile
其中:
quiet_cmd_uimage = UIMAGE  $@
     cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
                  -C none -a $(LOADADDR) -e $(LOADADDR) \
                  -n 'Linux-$(KERNELRELEASE)' -d $< $@  
但是我到處都找不到 ref quiet_cmd_uimage 和 cmd_uimage 的地方。 後來找到原來是 .. Kbuild
Kbuild 的 instruction:
  quiet_cmd_CMD = 要顯示的
       cmd_CMD = 要執行的
有關Kbuild 在 kernel/Documentation/kbuild/makefile.txt 有說明:
--- 6.7 Custom kbuild commands

        When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand
        of a command is normally displayed.
        To enable this behaviour for custom commands kbuild requires
        two variables to be set:
        quiet_cmd_<command>     - what shall be echoed
              cmd_<command>     - the command to execute

        Example:
                #
                quiet_cmd_image = BUILD   $@
                      cmd_image = $(obj)/tools/build $(BUILDFLAGS) \
                                                     $(obj)/vmlinux.bin > $@

                targets += bzImage
                $(obj)/bzImage: $(obj)/vmlinux.bin $(obj)/tools/build FORCE
                        $(call if_changed,image)
                        @echo 'Kernel: $@ is ready'

        When updating the $(obj)/bzImage target, the line

        BUILD    arch/i386/boot/bzImage

        will be displayed with "make KBUILD_VERBOSE=0".

2009年6月30日 星期二

.gvfs permission denied

新買的hd要掛在/home/james下。 所以
$sudo rsync -av /home/james/ /home/tmp/
結果出現 error :
rsync: readlink_stat("/home/james/.gvfs") failed: Permission denied (13)
看一下這個 folder 的 permission 是 r_x,沒有w。 查一下,gvfs是新的 gnome vfs 架構,使用gio library。 會在login x 的 user home dirctory 下 mount .gvfs folder 到gvfs。 所以..先logout,login 成其他人, umount /home/james/.gvfs 之後,就可以 rsync ..

2009年6月29日 星期一

ubuntu memory larger than 4G

MB : ASUS P5B Plus 裝上 8G的RAM後,free顯示只有3.6G。 所以follow 這一篇說明,update server image,reboot 後,就可以看到 8G了 (奇怪,是 6.?G)
$ sudo sudo apt-get install linux-headers-server linux-image-server linux-server

標籤

網誌存檔