前陣子處理客戶 mysql 轉移問題,這是從別台主機轉過來,但是對方在編碼部份一直有問題,最後算是匯入進去,不過編碼上還是有問題。
mysql 若沒有設定的話,預設語系是 latin1 ,dump 出來資料也是用 latin1 編碼。所以在匯入資料時候,將 dump 資料之前加上 set names utf8 ,強迫指定 utf8 語系,匯入之後才是正確 utf8 編碼。
for Fedora 12
modify /etc/gdm/custom.conf
[daemon] TimedLoginEnable=true AutomaticLoginEnable=true AutomaticLogin=your_account TimedLogin=your_account TimedLoginDelay=0
for Windows 2003 Server
Run -> Regedt32.exe
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon DefaultUserName=your_account DefaultPassword=your_password AutoAdminLogon=1
Install Skype on Fedora 12
sudo wget http://fedorasolved.org/multimedia-solutions/skype.repo -O /etc/yum.repos.d/skype.repo sudo yum update sudo yum install -y libX11.i686 libv4l.i686 skype --nogpgcheck
link: Installing Skype
1.Menu -> Administrative Tools -> Services
2.Find the “Windows Audio” -> Automatic
Avira AntiVir Rescue System is a live cd. You can use this rescue cd boot , scan virus infections for your computer. You download rescue iso file , brun in your cd-rw or usb stick .
I use this rescue system on my usb stick.
mount -o loop rescue.iso /mnt/iso
cp -a /mnt/iso/* /mnt/usbstick
label avira
kernel /avira/vmlinuz
append vga=769 initrd=/avira/initrd.gz ramdisk_size=133551 root=/dev/ram0 rw console=/dev/vc/4
Note: vmlinuz and initrd.gz file move avira directory , other directory keep on root directory
sudo umount /dev/sdd1
sudo syslinux /dev/sdd1
cat /usr/lib/syslinux/mbr.bin > /dev/sdd
這次安裝 Virtualbox 在 CentOS 5.3 居然花很多時間,最後還是找出問題。
wget http://download.virtualbox.org/virtualbox/3.0.6/VirtualBox-3.0.6_52128_rhel5-1.i386.rpm
yum install gcc make
由於我的 Kernl 是 PAE 版本,要安裝 kernel-PAE
yum install kernel-headers kernel-PAE指定 KERN_DIR 變數,以利後面 vboxdrv 安裝
export KERN_DIR=/usr/src/kernels/2.6.18-128.7.1.el5-PAE-i686
sudo rpm -i VirtualBox-3.xxxxx.rpm
SystemRescue 和 Clonezilla 都是救援的好工具,但是卻是兩個不同的系統,往往要帶兩張 Live CD 處理。這一次試著吧這兩個系統放在 Usb Stick 上。
原理很簡單,只要修改 systemrescue cd isolinux.cfg 檔案內容,讓開機程式能找到 Clonezilla 程式。
1.下載 SystemRescureCD 1.2 和 Clonezilla
2.掛載 systemrescuecd.iso
sudo mount -o loop systemrescuecd.iso /mnt/iso
3.解開 Clonezilla.zip
unzip clonezilla.zip4.將隨身碟格式化 ext2
mkfs.ext2 /dev/sdc1 mount /dev/sdc1 /mnt/usb
5.將 systemrescuecd 內容複製到 usb stick 上
rsync -av /mnt/iso/* /mnt/usb
6.而 clonezilla 內 home , live 目錄,複製到 usb stick 上
rsync -av home /mnt/usb rsync -av live /mnt/usb
7.修改 isolinux.cfg , 加入 clonezilla label
label clonezilla kernel /live/vmlinuz1 append initrd=/live/initrd1.img boot=live union=aufs noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=791 ip=frommedia nolocales label clonezilla 800x600 kernel /live/vmlinuz1 append initrd=/live/initrd1.img boot=live union=aufs noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=788 ip=frommedia nolocales label clonezilla 640x480 kernel /live/vmlinuz1 append initrd=/live/initrd1.img boot=live union=aufs noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=785 ip=frommedia nolocales label clonezilla toram kernel /live/vmlinuz1 append initrd=/live/initrd1.img boot=live union=aufs noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=791 toram ip=frommedia nolocales label clonezilla without framebuffer kernel /live/vmlinuz1 append initrd=/live/initrd1.img boot=live union=aufs noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" ip=frommedia nolocales vga=normal label clonezilla failsafe kernel /live/vmlinuz1 append initrd=/live/initrd1.img boot=live union=aufs noprompt ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" acpi=off irqpoll noapic noapm nodma nomce nolapic nosmp ip=frommedia nolocales vga=normal
8.給予 usb stick 開機功能
sudo mv /mnt/usb/isolinux/isolinux.cfg /mnt/usb/isolinux/extlinux.conf sudo extlinux -i /mnt/usb/isolinux umount /mnt/usb cat /usr/lib/syslinux/mbr.bin > /dev/sdc
最後用 fdisk 指令,將 /dev/sdc1 給予 boot 。
9.用 Usb stick 開機,在 boot 提示底下,打 clonezilla 就可以進入 clonezilla 系統。
Hinet 會擋掉用 adsl 架設的 smtp server,所以此主機一直無法發信出來,像每日 logwatch 就是一直無法收到。今天看到一個套件 ssmtp ,可以指定 smtp server。
裝法很簡單:
sudo apt-get install ssmtp
另外把 postfix / sendmail 之類軟體移除。
設定 /etc/ssmtp/ssmtp.conf
mailhub=smtp.gmail.com:587 FromLineOverride=YES AuthUser=user@gmail.com AuthPass=gmail_password UseSTARTTLS=YES
這樣一來,就可以透過 gmail smtp server 發信。
目前新的 Linux Distributions 都會收入,例如即將發行的 Ubuntu 9.04 也收入 Gnome 2.26 ,想嘗鮮朋友,可以下載 Ubuntu 9.04 Alpha 6試用。