2017年6月25日 星期日

最近用起Raspberry Pi的一些想法


最近很流行創客,也發行了很多種開發板,手頭上也因為某些原因買了開發板來用。

因為想弄個簡單的電腦,主要原因是要為公司的資料庫軟體做開發,所以才買了一張Raspberry Pi來用,用Apache+MySQL+PHP這樣的架構其實比較不挑硬體,畢竟是自己公司內部用,也沒有很龐大的資料需求,以目前資料庫的增長速度來講一年有三千筆資料就算很多了。

畢竟只是當測試用平台,也不太想在自己的電腦上裝虛擬機器之類的,就因此上網找最精簡的電腦,也不想花太多錢,重要是純粹拿來測試一些資料庫語法除錯之類的。

最終因價格才選用Raspberry Pi,畢竟公司使用的系統是Linux所以在CPU規格上就不用挑選要用X86族系,再說也比較貴。所以就選用Raspberry Pi B+。

使用Raspberry Pi來架設資料庫或許不是主要功能,畢竟這樣的開發板可以拿來當中控來用,配合其他如Arduino的開發板,做成資料彙整的轉運站就非常合適,可以運用Arduino中所獲取的資料交由Raspberry Pi來做處理跟整理。例如生產線、氣候、監測等。

當然也不一定要Arduino,也可以是生產線上的機器與之連線,做成自動化自動分析這樣的目標。

2015年11月13日 星期五

SELinux與Apache目錄的設定權限


將網頁坐落在/srv/www/html中
當使用SELinux時
必須要另這個目錄的權限打開
其方法是
chcon -R -t usr_t -u system_u *
這樣才不會一直出現權限錯誤的狀態

2014年12月27日 星期六

有人電腦挺閒的在Try主機密碼

Dec 27 13:02:14 sshd[26144]: Received disconnect from 103.41.124.39: 11: [preauth]
Dec 27 13:02:17 sshd[26146]: Failed password for root from 103.41.124.39 port 46400 ssh2
Dec 27 13:02:17 last message repeated 2 times
Dec 27 13:02:18 sshd[26146]: Received disconnect from 103.41.124.39: 11: [preauth]
Dec 27 13:02:20 sshd[26148]: Failed password for root from 103.41.124.39 port 54995 ssh2
Dec 27 13:02:20 last message repeated 2 times
Dec 27 13:02:21 sshd[26148]: Received disconnect from 103.41.124.39: 11: [preauth]
Dec 27 13:02:23 sshd[26150]: Failed password for root from 103.41.124.39 port 33366 ssh2
Dec 27 13:02:23 last message repeated 2 times
Dec 27 13:02:23 sshd[26150]: Received disconnect from 103.41.124.39: 11: [preauth]
Dec 27 13:02:25 sshd[26152]: Failed password for root from 103.41.124.39 port 39881 ssh2
Dec 27 13:02:26 last message repeated 2 times
Dec 27 13:02:26 sshd[26152]: Received disconnect from 103.41.124.39: 11: [preauth]
Dec 27 13:02:33 sshd[26154]: Failed password for root from 103.41.124.39 port 47460 ssh2
Dec 27 13:02:34 last message repeated 2 times
Dec 27 13:02:34 sshd[26154]: Received disconnect from 103.41.124.39: 11: [preauth]
Dec 27 13:02:36 sshd[26156]: Failed password for root from 103.41.124.39 port 37643 ssh2
Dec 27 13:02:37 last message repeated 2 times
Dec 27 14:31:56 sshd[28923]: Failed password for root from 61.174.50.247 port 31320 ssh2
Dec 27 14:31:56 sshd[28907]: Failed password for root from 122.225.97.96 port 43365 ssh2
Dec 27 14:31:56 sshd[28923]: Failed password for root from 61.174.50.247 port 31320 ssh2
所以讓我很認真的檢查設定檔
/etc/hosts.allow
/etc/hosts.deny
/etc/sshd/sshd_config
iptables -A INPUT -p tcp -dport 22 -J DROP
冒似沒啥問題

2014年5月24日 星期六

slackware與ubuntu網路設定不同處

Slackware其設定檔案的位置在於 /etc/rc.d/rc.inet1.conf 其中設定內容為
IPADD[0]="192.168.0.1" NETMASK[0]="255.255.255.0" GATEWAY="192.168.0.1"
至於在DNS設定方面則在 /etc/resolv.conf
nameserver 168.95.192.1 nameserver 168.95.1.1
然而在ubuntu14.0的部分在於其設定檔位在 /etc/network/interfaces 其中設定內容為
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.0.1 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 168.95.192.1 168.95.1.1
因為ubuntu把設定都整合在一個設定檔中,如此可以一次將所需要的部分設定完整

2013年4月20日 星期六

最近把老電腦的硬碟换成CF卡

想說用硬碟太吵,光碟開機太慢(Linux可用光碟跑)
就買了CF轉IDE介面卡
說句實話,挺快的
放上hdparm跑的數據
/dev/sda: Timing cached reads: 288 MB in 2.00 seconds = 143.79 MB/sec Timing buffered disk reads: 82 MB in 3.01 seconds = 27.23 MB/sec 使用的硬體 processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 11 model name : Intel(R) Celeron(TM) CPU 1000MHz 00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev c4) 00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP] 00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40) 00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) 00:07.2 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 1a) 00:07.4 SMBus: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 40) 00:07.5 Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio Controller (rev 50) 00:09.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 43) 00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10) 01:00.0 VGA compatible controller: nVidia Corporation NV5M64 [RIVA TNT2 Model 64/Model 64 Pro] (rev 15) ata1.00: CFA: CF CARD, 20100329, max UDMA/133 ata1.00: 31293360 sectors, multi 0: LBA ata1.00: limited to UDMA/33 due to 40-wire cable ata1.00: configured for UDMA/33 scsi 0:0:0:0: Direct-Access ATA CF CARD 2010 PQ: 0 ANSI: 5 sd 0:0:0:0: [sda] 31293360 512-byte logical blocks: (16.0 GB/14.9 GiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
其實跑有關資料的話挺快的,雖然沒真的固態硬碟快
對於老舊的電腦來說確實提高効能了

2013年2月27日 星期三

關於多顯示畫面的xorg.conf設定

主要設定區ServerLayout
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0 #主畫面位置
Screen 1 "Screen1" LeftOf "Screen0" #第二畫面位置
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
Option "Xinerama" "on" # Xinerama功能
EndSection

2013年1月26日 星期六

换了ATI的顯卡,重新設定Xwindow

因為换了ATI顯卡所以把kernel重編譯並且修改了xorg.conf
Section "Device"
Identifier "Card0"
Driver "radeon" # 主要把Driver改ㄧ下就可以了
#Option "monitor-VGA" "Monitor0"
BusID "PCI:1:0:0"
EndSection
不過如果裝ATI的驅動程式開雙顯卡會產生x window的錯誤
所以咧,我就没裝