顯示具有 兩光工具箱 標籤的文章。 顯示所有文章
顯示具有 兩光工具箱 標籤的文章。 顯示所有文章

2014年6月29日 星期日

Ubuntu Desktop下安裝VirtualBox Guest Additions提高畫面解析度

安裝所需的套件:
sudo apt-get update  
sudo apt-get upgrade  
sudo apt-get install dkms  
sudo apt-get install build-essential
插入Guest Additions CD映像:


2014年5月11日 星期日

Ubuntu DHCP安裝與設定

安裝環境Ubuntu 10.04

安裝套件
$ sudo apt-get install dhcp3-server
設定DHCP Server的網卡介面,編輯/etc/default/dhcp3-server檔案:
$ sudo vim /etc/default/dhcp3-server
INTERFACES="eth1"
設定DHCP Server,編輯/etc/dhcp3/dhcpd.conf:
$ sudo vim /etc/dhcp3/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
option domain-name-servers 8.8.8.8, 168.95.1.1;
option domain-name "reneeciou.example";

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
} 

2013年11月23日 星期六

Ubuntu Server下安裝VirtualBox Guest Additions並啟用共用資料夾

安裝build code所需的一些套件:
sudo apt-get install build-essential
掛載CD Rom:
$ sudo mount /dev/cdrom /mnt
在/mnt下可以看底下這些檔案:
$ ls /mnt
32Bit        cert                    VBoxSolarisAdditions.pkg
64Bit        OS2                     VBoxWindowsAdditions-amd64.exe
AUTORUN.INF  runasroot.sh            VBoxWindowsAdditions.exe
autorun.sh   VBoxLinuxAdditions.run  VBoxWindowsAdditions-x86.exe
安裝Guest Additions:
$ sudo /mnt/VBoxLinuxAdditions.run

2013年11月11日 星期一

SSL Certificates

OpenSSl Self-Signed Certificate Generation
底下將透過Ubuntu下的openssl指令產生數位憑證(Certificates),在產生憑證前,你需要用下面的指令產生一把private key,並要求你輸入密碼保護這把key。
$ openssl genrsa -des3 -out server.key 2048
但為了方便起見,最好不要為key設密碼,不然你每次啟動secure services都要輸入密碼,例如你架了一個SSL連線加密保護的Web Server (HTTPS),每次你啟動它的時候都要輸入密碼,萬一你的server主機出問題自動重開機,使用者就無法連到你的Web Server,除非你為key輸入密碼。底下的指令是透上面產生的key再產生一把沒有設密碼的key,至於你要用哪一把就看你囉!如果是我,我會選擇沒設密碼的private key。
$ openssl rsa -in server.key -out server.key.insecure
$ mv server.key server.key.secure
$ mv server.key.insecure server.key
接下來,要產生一張Certificate Signing Request (CSR),指令如下。
$ openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:TW
State or Province Name (full name) [Some-State]:Taiwan
Locality Name (eg, city) []:Kaohsiung City
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Renee's Blog
Organizational Unit Name (eg, section) []:Owner
Common Name (e.g. server FQDN or YOUR name) []:reneeciou.blogspot.tw
Email Address []:reneeciou@example.com.tw

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

2013年10月15日 星期二

Cross compile bluez for ARM

下載與解壓縮toolschain:
http://www.friendlyarm.net/dl.php?file=arm-linux-gcc-4.4.3.tgz
$ sudo tar xvf ~/arm-linux-gcc-4.4.3.tgz -C /
設定環境變數:
$ export PATH=/opt/FriendlyARM/toolschain/4.4.3/bin:$PATH
$ export CROSS_COMPILE=arm-none-linux-gnueabi-
$ export ARCH=arm
編譯BlueZ 2.25:
下載與編譯bluez-libs:
$ mkdir bluez-2.25
$ cd bluez-2.25
$ wget http://bluez.sf.net/download/bluez-libs-2.25.tar.gz
$ tar zxvf bluez-libs-2.25.tar.gz
$ cd bluez-libs-2.25
$ ./configure --host=arm-none-linux-gnueabi --prefix=/home/renee/myfs/rootfs \
--enable-shared=no --enable-static=yes
$ make
$ make install

2013年7月13日 星期六

Ubuntu核心編譯

重新編譯Kernel

安裝編譯所需的工具:
$ sudo apt-get install libncurses5-dev kernel-package
下載Kernel Source Code:
$ sudo apt-get install linux-source
解壓縮:
$ sudo tar jxvf linux-source-2.6.32.tar.bz2
複製.config檔:
$ cd linux-source-2.6.32
$ sudo cp -vi /boot/config-`uname -r` .config
基於Ubuntu為Kernel配置的檔案,依需求進行修改:
$ sudo make menuconfig

Linux下新增與移除驅動程式/模組

模組相關指令:
depmod - generate modules.dep and map files
insmod - insert a module into the Linux Kernel
lsmod - show the status of modules in the Linux Kernel
modinfo - show information about a Linux Kernel module
modprobe - add and remove modules from the Linux Kernel
rmmod - remove a module from the Linux Kernel
通常Linux Kernel模組是存放在/lib/modules/$(uname -r) 目錄下,可以透下面指令查看:
$ ls /lib/modules/$(uname -r)
# 注意: 此目錄下會有一個modules.dep檔案,用於記載模組相依性訊息。
透下面指令列出所有裝置的驅動程式模組:
$ ls /lib/modules/$(uname -r)/kernel/drivers/

2013年1月11日 星期五

Linux各種解壓縮

.tar
Uncompress:
$ tar xvf directory.tar
Compress:
$ tar cvf directory.tar directory
.bz2
Uncompress:
$ bzip2 -d directory.bz2
Compress: 只能壓縮指定檔案,不能壓縮目錄
$ bzip2 -zk file1 file2 file3
.tar.bz2
Uncompress:
$ tar jxvf directory.tar.bz2
Compress:
$ tar jcvf directory.tar.bz2 directory