2009年10月25日 星期日

rsync over ssh

1.confirm ssh service on remote system
#ssh tommy@192.168.100.196

2.use -e command to run rsync
#rsync -avz --stats --progress -e ssh tommy@192.168.100.196:/backup/ /backup

2009年7月19日 星期日

how to remove trash file with command line

1.remove trash file
#sudo rm -rf ~/.local/share/Trash

2.when logout to clean trash file
#sudo vim ~/.bashrc
add new lins to run command
sync; sync; sync
rm -rf ~/.local/share/Trash

2009年7月18日 星期六

how to install firefox3.5

1.modify apt-get repository
add two lines as below
deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu jaunty main

2.import PPA GPG key
#sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 247510BE

3.run command to install firefox35 or firefox36
sudo apt-get update && sudo apt-get install firefox-3.5

2009年6月23日 星期二

mount windows share folder

1.create mount point
#sudo mkdir /media/windows

2.mount point to /media/windows
#sudo mount -t cifs -o username=superman,password=super123 //172.16.1.1/share /media/windows

2009年6月11日 星期四

ssh in debug mode

1.Use command to ligin debug mode with ssh server
#/usr/sbin/sshd -d
notice the sshd must be absolute path
it will show
debug1: sshd version......
debug1: read PEM Private key done.......
debug1: Checking blacklist file /usr/share/ssh.......
debug1: Checking blacklist file /etc/ssh/blacklist.......
debug1: private host key: #0 type 1 Rsa.....

2009年6月10日 星期三

check sshd syntax error

1.Run command to check syntax error
#sshd -t
if error occur, it will show message like below
/etc/ssh/sshd_config: line 1: Bad configuration option: Package
/etc/ssh/sshd_config: terminating, 1 bad configuration options

2.modify line error and run the command again
#sshd -t

2009年6月7日 星期日

Use ssh method

1.Connect remote host use ssh login
#ssh -l tommy 192.168.1.38
#ssh tommy@192.168.1.38

2.accept authicate
3.enter your password for login user tommy

2009年6月4日 星期四

install ldaptools

1.Install ldap command tools
#sudo apt-get install ldap-utils

install webmin

1.Get web deb package of ubuntu jaunty
#wget http://nchc.dl.sourceforge.net/sourceforge/webadmin/webmin_1.470_all.deb

2.Install webmin package
#dpkg -i webmin_1.470_all.deb
it will show some package lose

3.Fixed the dependence for webmin package
#sudo apt-get -f install

4.Confirm webmin web site status
http://localhost:10000

2009年6月3日 星期三

create iso image from cd, dvd, scsi

1.create iso image from dvd
dd if=/dev/dvd of=dvd.iso

2.create iso image from cd
dd if=/dev/cdrom of=cd.iso

3.create iso image from scsi
dd if=/dev/scd0 of=cd.iso

2009年6月2日 星期二

mount mdf image

1.Making a mount point
#sudo mkdir /media/mdf

2.mount mdf image
#sudo mount silver.mdf /media/mdf -o loop

2009年6月1日 星期一

install openvpn

1.Install openvpn and bridge module
#sudo apt-get install openvpn bridge-utils

2009年5月21日 星期四

install qt4 for python gui develop

1.Install the python qt4 package
#sudo apt-get install python-qt4

2009年5月20日 星期三

extend swap file

1.Making a swap file
#sudo dd if=/dev/zero of=/swapfile bs=1M count=2048

2.format swapfile
#sudo mkswap swapfile

3.add new line into /etc/fstab
/swapfile none swap sw 0 0

4.reboot

have ubuntu speck to you

#espeak "welcome to use ubuntu operating system"
use especk to say some statements for you

2009年5月19日 星期二

switch monitor resolution

1.Install resapplet program with apt-get
#sudo apt-get install resapplet

2.add new program into start application
system-->preference-->startup application

2009年5月18日 星期一

install stardict on ubuntu

1.Install stardict program
#sudo apt-get install stardict

2.download dict from stardict web site
http://stardict.sourceforge.net/

3.decompress tar.gz file in to /usr/share/stardict/dict
#tar zxvf stardict-langdao-ec-big5-2.4.2.tar /usr/share/stardict/dict

2009年5月12日 星期二

install adobe reader 9

1.Download Adobe Reader 9 for linux distruibution
#sudo wget http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.1/enu/AdbeRdr9.1.0-1_i486linux_enu.bin

2.Change execute mode for the Adober reader 9
#sudo chmod 700 AdbeRdr9.1.0-1_i486linux_enu.bin

3.Install software
#sudo ./AdbeRdr9.1.0-1_i486linux_enu.bin

Playing Restricted Formats

#sudo apt-get install ubuntu-restricted-extras

install essential components to play dvd, mp3 ,avi and more popular formats

Setting bridge mode on virtualbox ose

1.Install two components on ubuntu jaunty
#sudo apt-get install bridge-utils uml-utilities

2.Write two scripts for start and stop bridge interface
#sudo vim bridge.sh
tunctl -t tap0 -u
brctl addbr br0
ifconfig eth0 0.0.0.0 promisc
brctl addif br0 eth0
dhclient br0
brctl addif br0 tap0
ifconfig tap0 up
chmod 666 /dev/net/tun

#vim bridge-down.sh
brctl delif br0 eth0
brctl delif br0 tap0
brctl delbr br0
ifconfig tap0 down
ifconfig br0 down
ifconfig eth0 down
ifconfig eth0 up

3.Setting virtualbox network to Host Interface
4.Running virtualbox virtual machine

Install Sun Java 6

1.Install sun java6 sdk
# sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk

2.Setup java6 as default java version
# sudo update-java-alternatives -s java-6-sun

3.defines the default system JVM search order
# vim /etc/jvm
insert the line at top of the file /etc/jvm
/usr/lib/jvm/java-6-sun

4.Setup the environment variable
# sudo vi $HOME/.bash_profile
add lines at the bottom of the file
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin

5.confirm jdk version
#java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)

6.write HelloWorld.java to test java runtime environment
# vim HelloWorld.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

7. compile and run java program
# javac HelloWorld.java
# java HelloWorld
Hello, World!

Installing Aptana Studio Standalone on Ubuntu gaunty 32bit

1.Download aptana linux version and unzip it in to /Aptana folder
2.create a txt file named aptana.sh and chmod 700 for it
#vim aptana.sh

insert lines below
#!/bin/sh
MOZILLA_FIVE_HOME=/usr/lib/xulrunner-1.8.1.3
if [ $LD_LIBRARY_PATH ]; then
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME
fi
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
~/aptana/AptanaStudio -vm /usr/lib/jvm/java-6-sun/jre/bin/java
#chmod 700 aptana.sh

3.goto the url to download xulrunner 1.8
http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.8.1.3/contrib/linux-i686/xulrunner-1.8.1.3.en-US.linux-i686-20080128.tar.gz

4.mkdir a folder in aptana folder and tar the xulrunner-1.8.1.3.en-US.linux-i686-20080128.tar.gz
#sudo mkdir /Aptana/xulrunner-1.8.1.3

5.copy all contents from xulrunner to /usr/lib/xulrunner-1.8.1.3
#sudo cp -r xulrunner/* /usr/lib/xulrunner-1.8.1.3

xine dvd player

#sudo apt-get install xine-ui
install xine lib

#sudo aptitude install gxine
install xine interface for gui control

Install inkscape for panel svg icon

#sudo apt-get install inkscape
installion inkscape software to make icon of svg style

2009年5月10日 星期日

install messager for ubuntu

#sudo apt-get install kopete

The best messagener for kde with camera and transfer.

2009年5月8日 星期五

mount windows 2003 share folder

#mount -t cifs -o username=$user,password=$pass //$windows/share /mnt/smb

$user== username in windows platform
$pass== username's password

2009年5月3日 星期日

install ruby on interpid version

#sudo sudo apt-get install ruby irb rdoc ri

#ruby -v
confirm ruby version

#irb
enter ruby interpreter

2009年3月15日 星期日

ubuntu scim input chinese

system-->administration-->language support
install chinese support

#sudo vim ~userid/.profile
add new line
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"

#sudo reboot

ubuntu play ape format

#wget -O - http://morgoth.free.fr/files/morgoth-signkey.gpg.asc | sudo apt-key add -

Import signing key into APT

#vim /etc/apt/sources.lst
add new line above
deb http://morgoth.free.fr/ubuntu intrepid-server main

#sudo apt-get update
update apt respostory

#sudo apt-get install audacious audacious-plugins
install audacious package

install daemon tools on ubuntu

# wget http://www.getdeb.net/download/4010/0
get acetoneiso tools to install

#sudo dpkg -i acetoneiso_2.0.3~rc1-1~getdeb1_i386.deb
install acetoneiso tools

#sudo apt-get -f install
install all dependenece package

2009年3月14日 星期六

read chm on kde or gnome

#sudo apt-get install kchmviewer
install kde chm viewer

$sudo apt-get install gnochm
install gnome chm viewer

ex:on some chm book,if kchmviewer can't work,please use gnome chmviewr instead.

2009年3月5日 星期四

install mysql server and mysql client

#sudo apt-get update
update apt responstory database

#sudo apt-get install mysql-server mysql-client

in installion procedure will ask you root login password twice for confirm
please remember it as first login use

intal sound card on lenovo r60

#sudo aptitude install build-essential libncurses-dev gettext xmlto xmltoman linux-headers-`uname -r`
install essential tools and kernelheaders

download the latest drive for alsa-lib alsa-driver and alsa-utils

#cd alsa-driver*
#sudo ./configure --with-cards=hda-intel
#sudo make
#sudo make install

#cd ../alsa-lib*
#sudo ./configure
#sudo make
#sudo make install

#cd ../alsa-utils*
#sudo ./configure
#sudo make
#sudo make install

#sudo reboot


on ubuntu hardy
#sudo apt-get install module-assistant
#sudo m-a update
#sudo m-a prepare
#sudo m-a a-i alsa
#sudo reboot

install mplayer and codecs

#sudo apt-get mplayer
install package for mplayer

#wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
download codes for all support

#tar zxvf all-20071007 /usr/lib/codecs
install new codecs for mplayer

fixed /etc/init.d/vboxdrv setup problem

#sudo apt-get install linux-headers-$(uname -r)

#sudo apt-get install linux-restricted-modules-$(uname -r)

#sudo /etc/init.d/vboxdrv setup
if command can't do
please try this

#sudo /etc/init.d/vboxdrv stop
stop vboxdrv daemon
#sudo /etc/init.d/vboxdrv start
start vboxdrv daemon

usb support
#sudo vim /etc/fstab
none /proc/bus/usb usbfs devgid=46,devmode=664 0 0

#sudo mount -a


2009年3月4日 星期三

install anti viruse program

#sudo apt-get install clamav
install anti-virus program for clamav

#sudo freshclam
update virus database

#sudo clamscan -v
check clamav version

install wireless gui tool -wicd

#sudo vim /etc/apt/source.lst
add new line below:
deb http://apt.wicd.net intrepid extras

#sudo apt-get update
update apt meta database

$sudo apt-get install wicd

2009年3月2日 星期一

install wxpython

#sudo apt-get install curl
install curl package

#sudo curl http://apt.wxwidgets.org/key.asc | sudo apt-key add -
import signature key for apt meta database

#sudo vim /etc/apt/source.lst
add new line
deb http://apt.wxwidgets.org/ intrepid-wx main
deb-src http://apt.wxwidgets.org/ intrepid-wx main

#sudo apt-get update
update package database

#sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n

2009年2月24日 星期二

ubuntu change hostname

#sudo vim /etc/hostname
ubuntu810

#sudo vim /etc/hosts
192.168.11.100 ubuntu810.jiang.com ubuntu810

#sudo reboot

use expect to inteative login ssh server

#sudo apt-get install expect

#sudo vim sshlogin.sh
#!/usr/bin/expect
spawn ssh tommy@192.168.11.100
expect "d:"
send -- "abc12345"
send -- "\r"
expect "*$"
send -- "scp /home/first.txt tommy@192.168.11.100:/home/tommy/"
send -- "\r"
expect eof

install xwindow destkop

#sudo apt-get install ubuntu-desktop
install gdm desktop for ubuntu server

#sudo apt-get install kubunut-desktop
install kde desktop for ubuntu server

2009年2月16日 星期一

Samba Server-SWAT

#sudo apt-get install swat xinetd

#sudo vim /etc/xinetd.conf
insert below lines to xinetd.conf
# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
# to configure your Samba server. To use SWAT, \
# connect to port 901 with your favorite web browser.
service swat
{
port = 901
socket_type = stream
wait = no
# Use only_from if you want to restrict access
# only_from = localhost
user = root
server = /usr/sbin/swat
log_on_failure += USERID
disable = no
}

#sudo /etc/init.d/xinetd restart
insert below lines to xinetd.conf

http://localhost:901
browse swat login web page



Samba Server-Introduction

The Samba server is made up of the three daemons:

nmbd

This daemon handles all name registration and resolution requests.

smbd

This daemon handles all TCP/IP-based connection services for file- and print-based operations.

winbindd

This daemon should be started when Samba is a member of a Windows NT4 or ADS domain.It will check idmap uid and idmap gid parameters in /etc/samba/smb.conf.

#testparm /etc/samba/smb.conf
to check syntax for samba configure file.

Samba Server-tdb database

#sudo smbd -b | grep PRIVATE_DIR
the best way to confirm tdb file location

#sudo smbd -b | grep LOCK_DIR
the best way to confirm tdb file location

General Command-ntpdate

#sudo ntpdate pool.ntp.org
Synchronize time with ntp server

#sudo vim /etc/default/ntpdate
# Set to "yes" to take the server list from /etc/ntp.conf, from package ntp,
# so you only have to keep it in one place.
NTPDATE_USE_NTP_CONF=no
###ntpdate-debian doesn't use /etc/ntp.conf###

# List of NTP servers to use (Separate multiple servers with spaces.)
# Not used if NTPDATE_USE_NTP_CONF is yes.
NTPSERVERS="0 pool.ntp.org 1 ntp.ubuntu.org"

# Additional options to pass to ntpdate
NTPOPTIONS="-u"
NTPSERVERS = " 10.10.1.20" ### it will override ntpservers setting ###

#sudo hwclock -w
update BIOS time

#sudo hwclock -r
read time from BIOS

#cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime
modify timezone for Taipei with CST

Dns setting

#sudo vim /etc/resove.conf
search mysite.com #search domain name
nameserver 10.10.1.99 #domain dns server
nameserver 10.10.1.100 #domain dns server
nameserver 168.95.1.1 #Isp provider dns server

Network Setting

#sudo vim /etc/network/interface
# The loopback network interface
auto lo
iface lo inet loopback

#define eth0 use dhcp to obtain ip address
auto eth0
iface eth0 inet dhcp

#define eth0 use static ip address
auth eth0
iface eth0 inet static
address 10.1.1.100 #define ip address
netmask 255.255.255.0 #define netmask
gateway 10.1.1.1 #define gateway

ex: don't forget setting dns server in /etc/resove.conf

#sudo /etc/init.d/network restart (restart network daemon)

General command-update

#sudo apt-get update
update is used to resynchronize the package index files from their sources.
source index file in /etc/apt/ sources.lst

#sudo apt-get upgrade
upgrade is used to install the newest versions of all packages currently installed on the system (include kernel)

#sudo apt-get install package_name
example: sudo apt-get install ssh
install is followed by one or more packages desired for installation.

#sudo apt-get remove package_name
emove is identical to install except that packages are removed instead of installed.