2014年10月27日 星期一

[Ubuntu]架IPv6 DHCP Server


sudo apt-get install isc-dhcp-server
1. set a static IPv6 address for the Interface I want to run the DHCPv6 server from that is part of the IPv6 network subnet outside the DHCP range.
2. Edit the /etc/dhcp/dhcpd6.conf file to configure the DHCPv6 range etc.
3. Create the /var/lib/dhcp/dhcpd6.leases
4. Manually start the DHCPv6 server.
----------------------------------------------------------------------------
sudo ifconfig eth0 inet6 add 2001:db8:0:1::128/64

[ configure dhcpd6.conf ]

default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet6 2001:db8:0:1::/64
{
#Range for clients
range6 2001:db8:0:1::129 2001:db8:0:1::254;
}

touch /var/lib/dhcp/dhcpd6.leases

chown dhcpd:dhcpd /var/lib/dhcp/dhcpd6.leases
sudo dhcpd -6 -f -cf /etc/dhcp/dhcpd6.conf eth0


****************************************************
Can't open /var/lib/dhcp/dhcpd6.leases for append.

sudo chmod 666 /var/lib/dhcp/dhcpd6.leases

[Ubuntu]install miniSIPServer



Download miniSIPServer

Please visit our website to download miniSIPServer. Please pay attention that you MUST download miniSIPServer for Debian/Ubuntu.
If you are working on Ubuntu/Kubuntu desktop, it is quite easy to install miniSIPServer. What you need do is just click ".deb" packages.
Following steps illustrate how to install miniSIPServer on Debian or Ubuntu/Kubuntu server.

 

Install libraries

miniSIPServer requires some libraries. We can get and install them from Debian/Ubuntu official sites directly:

sudo apt-get install gcc g++ libqt4-dev libqtcore4 libqtgui4 libqt4-network libqt4-xml libssl-dev libmysqlclient18 libmysqlclient-dev python-dev

 

Install miniSIPServer

It's assumed we have downloaded “mss_v14_u20.deb” package, then please run following command to install miniSIPServer:

sudo dpkg --install mss_v14_u20.deb

After above steps, you will find all miniSIPServer's files at directory "/opt/sipserver/".
If you are in GUI desktop, you will find miniSIPServer linker at "Internet" category.

 

Run

As you know, if you start GUI desktop, such as Gnome/KDE/Unity, you only need click miniSIPServer linker to start and configure it.You will see its interface is almost same with miniSIPServer for Windows.
If desktop environment is not started, we can run miniSIPServer CLI(command line) version. Please use following command.

/opt/sipserver/msscli&

[Ubuntu]install BlueGriffon



wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -

sudo sh -c 'echo "deb http://archive.getdeb.net/ubuntu saucy-getdeb apps" >> /etc/apt/sources.list.d/getdeb.list'

sudo apt-get update

sudo apt-get install bluegriffon

[Ubuntu]Thunderbird 中文化


1.Update the package index:
# sudo apt-get update
2.Install thunderbird-locale-zh-hant deb package:
# sudo apt-get install thunderbird-locale-zh-hant

[Linux]CrunchBang Linux

新增中文字體及輸入法
sudo apt-get update
sudo apt-get install ttf-wqy-microhei
sudo apt-get install ibus-chewing

im-config


桌面解析度設定
nano ~/.config/openbox/autostart

新增
xrandr --size 1600x768 &

sudo reboot

[ubuntu]Install TFTP Server


sudo apt-get install tftpd-hpa tftp-hpa

sudo gedit /etc/default/tftpd-hpa

####################
#Defaults for tftpd-hpa
TFTP_USERNAME="root"
TFTP_DIRECTORY="/home/takashi/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -s -c --secutre"

####################
PS:/home/takashi/tftpboot 需要自已新增目錄

sudo mkdir /home/takashi/tftpboot

sudo chmod 777 /home/takashi/tftpboot

sudo service tftpd-hpa start

在Ubuntu上面直接裝的TFTP server套件不會在開機時執行,精確一點說應該是開機時跑了卻沒有起來。
這是個老毛病,修一下就好。
編輯 /etc/init/tftpd-hpa.conf ,修改它錯誤的初始條件。

#start on runlevel [2345] # the original line which is wrong
start on (filesystem and net-device-up IFACE!=lo)

[Linux]Lubuntu install Xrdp



sudo apt-get install xrdp
echo 'lxsession' > .xsession
sudo apt-get install xvfb lxde
sudo service xrdp restart

[Linux] ubuntu install telnet service


ubuntu安装telnet服务
1. sudo apt-get install xinetd telnetd
sudo gedit /etc/inetd.conf并加入以下一行,假如没有发现这个文件,
自己新建立一个也是可以的.
 ------------------------------------------------------------------------------------------------------------
telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd
 ------------------------------------------------------------------------------------------------------------
3. sudo gedit /etc/xinetd.conf并加入以下内容:

------------------------------------------------------------------------------------------------------------
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{
# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info
instances = 60
log_type = SYSLOG authpriv
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
}
 ------------------------------------------------------------------------------------------------------------
4. sudo gedit /etc/xinetd.d/telnet并加入以下内容:

 ------------------------------------------------------------------------------------------------------------
# default: on
# description: The telnet server serves telnet sessions; it uses
# unencrypted username/password pairs for authentication.
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
} 
 ------------------------------------------------------------------------------------------------------------
5. 重启机器或重启网络服务 
sudo /etc/init.d/xinetd restart

[Linux]Pure-FTPD + pureadmin


Install ''Pure-FTPD'' with GUI

1. Install the pure-ftpd package and the pureadmin package from the Universe Repository.

sudo apt-get install pure-ftpd pureadmin  

2.新增虛擬使用者所要對應的系統使用者(ftpuser)與其家目錄
sudo adduser --system --home /home/ftpuser --shell /dev/null --disabled-password  --disabled-login ftpuser

3.新增虛擬使用者
sudo pure-pw useradd user01 -u ftpuser -d /home/ftpuser

如果要不同使用者有不同家目錄需在 -d 指定且新增其家目錄, 如
sudo mkdir /home/ftpuser/joe; sudo chown -R ftpuser /home/ftpuser/joe
sudo pure-pw useradd joe -u mis91 -d /home/ftpuser/joe
預設會新增在 /etc/pure-ftpd/pureftpd.passwd 中,或使用 pure-pw -f your.passwd.file 指定

4.建立 db 並確認 /etc/pure-ftpd/conf/PureDB 中資料為 /etc/pure-ftpd/pureftpd.pdb
sudo pure-pw mkdb /etc/pure-ftpd/pureftpd.pdb -f /etc/pure-ftpd/pureftpd.passwd

加入 DB 認証模式至設定中
sudo ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/45puredb

5.確認幾項設定
* 確認 cat /etc/pure-ftpd/conf/UnixAuthentication 中指有字串 no
* 確認 cat /etc/pure-ftpd/conf/MinUID 中的數值比 ftpuser 的 UID 還小(如: adduser --system 的 UID 通常會預設值) , 不然虛擬帳號無法登入

6.重新啟動 pure-ftpd service
sudo /etc/init.d/pure-ftpd restart

============================================================
其他常用到的幾個設定,檔案都需寫在 /etc/pure-ftpd/conf 下
* ) echo "yes" > ChrootEveryone (使用者被限制在家目錄下)
* ) echo "no" > PAMAuthentication (不使用 PAM 認証:一般用者無法用 pure-ftpd 登入)
*) echo ",9188" > Bind (設定 ip/port )
* ) echo "yes" > KeepAllFiles (這個應該是不允許用戶端刪除文件)
* ) echo "yes" >DontResolve (不解釋主機名,可以加快登錄速度)

設定允許 symbolic links :
1) 編輯 /etc/default/pure-ftpd-common
將 VIRTUALCHROOT=false 改為 VIRTUALCHROOT=true
2) Restart service

設定允許 匿名登入
1) echo "no" > /etc/pure-ftpd/conf/NoAnonymous
2) sudo adduser --system --home /home/ftpuser --shell /sbin/nologin --disabled-password  --disabled-login  ftp
3) Restart service

設定 Passive mode
1) echo "29799 29899" > /etc/pure-ftpd/conf/PassivePortRange

 設定最多 clients 數量
1) echo "50" > /etc/pure-ftpd/conf/MaxClientsNumber

[Linux]set ubuntu route default gw


方式1:

直接編輯網路連線檔案。

sudo gedit /etc/NetworkManager/system-connections/有線網路連線\ 1

#設定default gw的參數,false=設定gw,true=取消gw,

never-default=false


方式2:
編輯route
route
sudo route del default gw <gatway ip> eth0
sudo route add default gw <gatway ip> eth1

[Ubuntu] CPU Test


Linux CPU information by issue following command

#cat /proc/cpuinfo



You can install “cpuburn” in Ubuntu 12.04 Precise Pangolin, 11.10 Oneiric Ocelot, 11.04 Natty Narwhal, 10.10 and 10.04 by using the below command in your Terminal window.

#sudo apt-get install cpuburn

An example …

#burnP6

If you have multi-cores …

#burnP6 &

you can combine all those needed running instances into a single chain command as well. For instance, if I wanted to run 4 instances of ‘burnP6′ (without having to enter one after the other) then I can use it in the below format (note there’s a space between each ‘burnP6 &‘ command).

#burnP6 & burnP6 & burnP6 & burnP6 &

When you want to terminate them all, simply enter the below command.

#killall burnP6

You can read its manual by using the below command in your Terminal as well.

#man cpuburn

[Game] Rimworld enable Dev mode (for Mac)

In Finder Press Command+Shift+Dot to open hidden folder /Users/[user name]/Library/Application Support/RimWorld/Config/DevModeDisable Dele...