搜尋此網誌

2014年10月10日 星期五

修正 xrdp 畫面空白問題

學習筆記: 以下以 Lubuntu IMAGE for BananaPI 為例:

bananapi/bananapi
&
root/bananapi

===========================================================
修改 BananaPi 開機解析度
===========================================================
用 Windows 修改 SD 記憶卡裡的 uEnv.txt
去除 EDID 字眼

Make sure you disable EDID in the uEnv.txt...

The screen output-mode field should look sth like :
disp.screen0_output_mode=1280x720p50

instead of
disp.screen0_output_mode=EDID:1280x720p50

完成。


===========================================================
ubuntu下要怎麼在 command mode中連線無線網路
===========================================================

sudo iwconfig  <--查看無線網卡的編號
sudo iwlist scan  <--看目前AP的資訊
sudo iwconfig eth1 "ssap"   <--設定網卡要連的AP名稱
sudo dhclient  <--取得IP

完成。


===========================================================
修正 xrdp 畫面空白問題
===========================================================

首先
cd /etc/xrdp/
cp startwm.sh startwm.sh.bak
vi /etc/xrdp/startwm.sh

第一行加入
echo "lxsession -s Lubuntu -e LXDE" > .xsession

重新啟動 xrdp
sudo service xrdp restart


完成。



===========================================================
Banana Pi - Lubuntu - 擴展 root 分割區
===========================================================

目前的硬碟分割狀態
$ df -h

使用 fdisk 指令來列出硬碟的分割狀態及分割硬碟
$ sudo fdisk -l

分割硬碟
$ sudo fdisk /dev/mmcblk0

d 2 n p 2 enter enter

輸入 p 觀看硬碟分割的狀態
輸入 wq 儲存磁碟分割並離開

重新開機
$ sudo reboot

使用 resize2fs 調整分割區大小
$ sudo resize2fs /dev/mmcblk0p2

重新輸入 df -h 來查驗
$ df -h

最後在 GUI 底下
執行 偏好設定 / Disks 程式

完成。

2014年10月9日 星期四

安裝Samba

安裝Samba
sudo apt-get install samba
設定Samba 
編輯 /etc/samba/smb.conf
 
(1)
[global]
workgroup = root
security = share
 
(2)尾部加入
[分享資料夾的名稱]
path = 分享資料夾的路徑
writable = yes
guest account = root
force user = root
public = yes
force group = root
 
[3]重新啟動 Samba Server
sudo /etc/init.d/samba restart
 
[4]Windows設定
在網路上的芳鄰圖示下按右鍵,
 "連線網路磁碟機"
磁碟機: 任選
資料夾: \\Ubuntu下所設IP\分享資料夾的名稱

centos 安裝 iftop


Centos 安裝 iftop


Centos 7

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-7.noarch.rpm


rpm -ivh epel-release-7-6.noarch.rpm

yum -y install iftop

================================================


Centos 6


wget http://mirror.centos.org/centos/6/extras/i386/Packages/epel-release-6-8.noarch.rpm

rpm -ivh epel-release-6-8.noarch.rpm

yum -y install iftop

CentOS7 設定 snmp agent

參考1  參考2

安裝:
yum -y install net-snmp net-snmp-utils


修改設定:
vi /etc/snmp/snmpd.conf

找到以下這行,前面加上#
#view    systemview    included   .1.3.6.1.2.1.25.1.1
新增以下這行
view    systemview    included   .1

再新增:
sysName (主機裝置名稱)
syslocation (所在位置資訊)
syscontact (聯絡人資訊)

如果有安全性的考量,可以修改
com2sec


啟動 snmpd 並設定開機可自動啟動:
systemctl enable snmpd.service
systemctl restart snmpd.service
systemctl status snmpd.service

確認:
netstat -auntp | grep snmp

snmpwalk -c public -v 2c 192.168.1.1 (IP 自己改)


安裝與設定 ntpd

yum -y install ntp.x86_64

or

yum -y install ntp


編輯 ntp server
vi /etc/ntp.conf

 # 台灣常見的時間伺服器
 server watch.stdtime.gov.tw
 server time.stdtime.gov.tw
 server  tick.stdtime.gov.tw
 server tock.stdtime.gov.tw
 server clock.stdtime.gov.tw
 server 192.43.244.18              # time.nist.gov (ACTS)
 server 192.5.41.40                # tick.usno.navy.mil


啟動第一次網路校時
ntpdate -u tick.stdtime.gov.tw

啟動 ntpd
systemctl enable ntpd
systemctl start ntpd
systemctl status ntpd

NTP服務啟動後,檢查目前NTP服務運作的狀態。
netstat -tunlp | grep ntpd

檢查 NTP服務同步的狀況
ntpq -p

設定 CentOS 的 TimeZone 與 Date 時間

設定 CentOS 的 TimeZone 與 Date 時間 

調整 CentOS 的 Time Zone
$ cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime

修改以下檔案變更Timezone
$ vim /etc/sysconfig/clock
ZONE="Asia/Taipei"

# MMDDhhmmYYYY 月日時分年
$ date 101322202010

# 查看 BIOS 時間
$ hwclock -r

# 將系統時間寫入到 BIOS 時間
$ hwclock -w

2014年10月5日 星期日

Debian 網路IP參數設定

修改 /etc/network/interfaces 參數設定

如果是要 Static IP (動態 IP)寫以下:
auto eth0
iface eth0 inet dhcp



如果是要 Static IP (固定/靜態 IP)寫以下:
auto eth0
iface eth0 inet static
    address 192.168.0.7
    netmask 255.255.255.0
    gateway 192.168.0.254



如果是要 PPPoE 寫以下:
auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider dsl-provider

auto eth0
iface eth0 inet manual


Banana Pi - Lubuntu OS - 擴展 root 分割磁區大小

先確認看看目前的硬碟分割狀態
$ df -h

使用 fdisk 指令列出硬碟的分割狀態等資訊
$ sudo fdisk -l

開始分割硬碟
$ sudo fdisk /dev/mmcblk0

然後依序畫面提示,陸續輸入
d  2  n  p  2  enter  enter

輸入 p 觀看硬碟分割磁區的狀態
輸入 wq 儲存磁碟分割並離開

重新開機
$ sudo reboot

使用 resize2fs 來調整分割磁區大小
$ sudo resize2fs /dev/mmcblk0p2

重新輸入 df -h 來查驗
$ df -h

最後也可以在 GUI 底下
執行 偏好設定 / Disks 程式 檢查結果

完成。

搜尋此網誌