[轉載] 用USB隨身碟當電腦鎖

原文:http://www.techsnack.net/lock-your-computer-using-usb-flash-drive/

update:

用簡單的batch應該也可以做到

@echo off

:1

if exist “d:\test.txt” (

goto :1

) else (

echo “key file not found”

rundll32.exe user32.dll LockWorkStation

goto :1

)
[flipclock ]

 

 

o you know that we can use our USB flash drive as computer lock? You need a USB flash drive and a freeware called Log Monitor. This article will discuss the steps to configure them.

Log Monitor

Log Monitor is a freeware that has many usages. I try to go to the author page but i can’t understand the language, but i think most probably the author is a Russian. After playing with this application, i found that it can actually lock our computer and prevent others to login. The theory behind this is very simple. It keep monitoring your USB flash drive, once the file being monitored changed, or you remove the USB flash drive, this application will immediately lock your computer. If you remove your USB flash drive and the login to your computer, this application will immediately lock your computer again. Unless you hold the USB flash drive, else you can’t access that computer.

Step 1

You need to create a .log file in your USB flash drive. The file name can be anything and you can left your content blank. But, my advise is try to type something and make sure no people can get this file. I had create an example log file and will provide the download address at the end of this article.

Step 2

Go to Monitoring and choose Add File:

Lock PC Step2_1

Now, choose the log file that you created, and change the Do Action’s option to If the file has been changed. Please check the Perform action if monitored file does not exist so that this application can lock your computer when you unplug your USB flash drive.

Lock PC Step2_2

After that, switch to Options tab and set the interval to 1 second. This means Log Monitor will keep pulling each 1 second. If you think that this will affect your computer speed, you can set this value to higher.

Lock PC Step2_3

Step 3

Now, go to Actions tab and choose New -> Execute Program. Fill in the parametes below:

Command: C:\Windows\system32\rundll32.exe
Parameters: user32.dll,LockWorkStation
Start in: C:\Windows\system32

Lock PC Step3

Step 4

This is the final step. Go back to the main page and choose Options -> Program Options. At the General tab, check Minimize on start if you want Log Monitor minimize to system try when startup. Next, check the Start on user logon. Be careful, remember to make 1 copy of your log file if you check this. After you check this option, Log Monitor will automatically launch after you login. If you lost the log file, means you can’t control your computer anymore. After everything done, save the settings to your system and try unplug your USB. Your computer will be locked immediately!

You can download the example of log file and the configuration here. You can also download Log Monitor from Freeware-guide.

 

 

[筆記] CentOS 6.6 + iRedmail 0.9.4 + postfixadmin 安裝筆記

系統基礎設定 Clone from a fresh new install CentOS 6.6 in vmware power on
新增DNS 伺服器 vi /etc/resolv.conf 刪除內容 新增以下資料 nameserver 168.95.1.1 nameserver 8.8.8.8 nameserver 8.8.4.4
啟動網路卡 cp /etc/sysconfig/network-scripts/ifcfg-eth2 /etc/sysconfig/network-scripts/ifcfg-eth3 vi /etc/sysconfig/network-scripts 刪除 MAC 修改底下的設定 BOOTPROTO=static
IPADDR=192.168.10.220
NETMASK=255.255.255.0
vi /etc/sysconfig/network NETWORKING=yes
HOSTNAME=iredmail
GATEWAY=192.168.10.246
service network restart
修改時區 yum install ntpdate –y cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime ntpdate 192.168.10.243
reboot (讓hostname 生效) 登入
安裝基本指定 yum install –y wget telnet vim ftp epel-release bind-utils
下載 iredmail 進行安裝 wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.4.tar.bz2

tar xjf iRedMail-0.9.4.tar.bz2 cd iRedMail-0.9.4 bash iRedMail.sh


*
IredMail Install 1.mailbox directory , just keep it and next

pietty0327_2016-01-27_09-15-59

2.choose web server ( apache here , more familiar)

pietty0327_2016-01-27_09-16-07

 

3. backend choose , MySQL / OpenLDAP  MySQL Here ( but seems some proble with global address book in SOGo)

pietty0327_2016-01-27_09-16-16

 

4. your domain

pietty0327_2016-01-27_09-16-31

 

5. your password to mail admin

pietty0327_2016-01-27_09-16-42

 

6.WEBMAIL , Choose SOGo

pietty0327_2016-01-27_09-16-53

 

離開這個畫面後,會開始進行安裝,並且詢問一些問題都按 y ,完成後,會產生一個 iRedMail.tips 裡面有帳號、密碼等資訊 接著安裝 phpmyadmin yum install –y phpmyadmin 重開機套用 reboot


*
開啟 https://hostname/iredmailadmin

建立三個USER做測試用 登入 https://hostname/SOGo

用其中一個帳號登入,收發信件測試 (前提是 DNS 還有防火牆 已經設定好了) 檢查通訊錄,發現 Global Address Book (公用通訊錄、全域通訊錄) 居然是空的 關機,再做一台來測試 OpenLDAP (VM真他X的方便) shutdown –h now


*
重複 基礎設定 、下載安裝包、進行安裝,改選openLDAP,一開始要輸入 dc=abc,dc=org , 再來輸入 abc.org 其他都一樣 安裝完後,多裝一個 phpldapadmin yum install phpldapadmin –y reboot
開啟 https://hostname/iredmailadmin

建立三個USER做測試用 p.s 等了好久(5分鐘左右吧)才看到頁面,不知道是那邊的問題 (update: 應該是firefox的關係,重設後 OK ) 要檢視憑證也是很久很久.. 登入 https://hostname/SOGo

Global Address Book 還是看不到東西 但是RoundCubeMail 的通訊錄裡面有!!! 還要再研究看看,或者就不要管SOGo了,反正RoundCubeMail 本來就比較好看又好用!

iexplore_2016-01-27_10-41-02

 

RoundCubeMail的設定檔在 /var/www/roundcubemail/config/config.inc.php 有關LDAP ADDRESS BOOK的設定如下
> // Global LDAP address book.
> $config[‘ldap_public’][“global_ldap_abook”] = array(
>     ‘name’              => ‘Global LDAP Address Book’,
>     ‘hosts’             => array(‘127.0.0.1’),
>     ‘port’              => 389,
>     ‘use_tls’           => false,
>     ‘ldap_version’      => ‘3’,
>     ‘network_timeout’   => 10,
>     ‘user_specific’     => true,

>
>     // Search mail users under same domain.
>     ‘base_dn’       => ‘domainName=%d,o=domains,dc=abc,dc=org’,
>     ‘bind_dn’       => ‘mail=%u@%d,ou=Users,domainName=%d,o=domains,dc=abc,dc=org’,

>
>     ‘hidden’        => false,
>     ‘searchonly’    => false,
>     ‘writable’      => false,

>
>     ‘search_fields’ => array(‘mail’, ‘cn’, ‘sn’, ‘givenName’, ‘street’, ‘telephoneNumber’, ‘mobile’, ‘stree’, ‘postalCode’),
>

>
>  

底下這是欄位對應
> // mapping of contact fields to directory attributes
>   ‘fieldmap’ => array(
>       ‘name’          => ‘cn’,
>       ‘surname’       => ‘sn’,
>       ‘firstname’     => ‘givenName’,
>       ‘title’         => ‘title’,
>       ‘email’         => ‘mail:‘,
>       ‘phone:work’    => ‘telephoneNumber’,
>       ‘phone:mobile’  => ‘mobile’,
>       ‘street’        => ‘street’,
>       ‘zipcode’       => ‘postalCode’,
>       ‘locality’      => ‘l’,
>       ‘department’    => ‘departmentNumber’,
>       ‘notes’         => ‘description’,
>       ‘name’          => ‘cn’,
>       ‘surname’       => ‘sn’,
>       ‘firstname’     => ‘givenName’,
>       ‘title’         => ‘title’,
>       ‘email’         => ‘mail:
‘,
>       ‘phone:work’    => ‘telephoneNumber’,
>       ‘phone:mobile’  => ‘mobile’,
>       ‘phone:workfax’ => ‘facsimileTelephoneNumber’,
>       ‘street’        => ‘street’,
>       ‘zipcode’       => ‘postalCode’,
>       ‘locality’      => ‘l’,
>       ‘department’    => ‘departmentNumber’,
>       ‘notes’         => ‘description’,
>       ‘photo’         => ‘jpegPhoto’,
>   ),
 



*

安裝 PostfixAdmin 取代 iRedMail 預載的陽春管理介面

wget http://nchc.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.93/postfixadmin-2.93.tar.gz

tar zxvf postfixadmin-2.93.tar.gz mv postfixadmin-2.93 pfa mv pfa /var/www/html 編輯 httpd 設定 vim /etc/httpd/conf.d/pfa.conf 要安全性的再自己修改 allow / deny 順序和限制
> Alias /pfa “/var/www/pfa/“
> <Directory “/var/www/pfa/“>
>     Order allow,deny
> Allow from all
>     Options -Indexes
> </Directory>
新增 PostfixAdmin 資料庫 mysql –u root –p 輸入 root 密碼,進入 mysql 介面 執行以下指令,建立一個資料庫叫postfix ,一個使用者帳號 postfix 密碼 postfixadmin ,並指定讓使用者postfix可以讀寫 postfix 資料庫   CREATE DATABASE postfix;
  CREATE USER ‘postfix‘@’localhost’ IDENTIFIED BY ‘postfixadmin’;
  GRANT ALL PRIVILEGES ON ‘postfix’. * TO
‘postfix‘@’localhost’;
離開mysql 介面 編輯 postfixadmin 設定檔 vim /var/www/pfa/config.inc.php 修改以下設定  
> $CONF[‘configured’] = true;
>
> $CONF[‘database_type’] = ‘mysqli’;
> $CONF[‘database_user’] = ‘postfix’;
> $CONF[‘database_password’] = ‘postfixadmin’;
> $CONF[‘database_name’] = ‘postfix’;
存檔後離開,開啟postfixadmin 安裝頁面

http://ip_address/pfa/setup.php

應該會提示有個目錄要有讀寫權限 chmod a+rw –R /var/www/pfa/templates_c 重整安裝頁面 安裝過程其實很簡單 注意一下密碼安全性原則,不得小於五個字,至少要有三個英文、兩個數字(我是直接拿掉這段,省得麻煩) 安裝過程中會要求你設定一組安裝密碼,然後系統會產生一組編碼過後的字串 將這組字串填入 config.inc.php vim /var/www/pfa/config.inc.php 註解掉第一個 setup_password 變數,然後填入剛剛系統產生的編碼字串 #$CONF[‘setup_password’] = ‘changeme’;
$CONF[‘setup_password’] = ‘7d4b2b0def324a8dc0:80e26d5c’;
存檔後離開 接著在安裝畫面填入你剛剛輸入的密碼「明文」,不是那個字串,而是你剛剛輸入的安裝密碼 建立一個系統管理者帳號、密碼 都完成之後,會提示一個連結讓你前往登入,或者自己開啟

http://ip_address/pfa/login.php

填入剛剛輸入的管理者帳號(全部,包含 @ 後面的域名) 和密碼,登入管理介面,這邊可以順便改語系,內建有繁體中文( 感動! ) 接著先新建一個網域

firefox_2016-01-28_10-20-29

 

然後新增幾個使用者進行測試,而且postfixadmin 內建就可以建立別名,不用像 iredmail 一樣,要透過 mysql 、openldap 之類的方式去建立!  

firefox_2016-01-28_10-26-18

 

別名的建立畫面

firefox_2016-01-28_10-27-26


Update: 更新歡迎信件無法寄出的錯誤

經過這樣的修改,postfixadmin 預設有一個發送歡迎信件給新帳號的功能會發生錯誤 maillog 裡面會出現 Sender address rejected: not logged in; 這樣的狀況 修改postfixadmin的設定 vim /var/www/pfa/config.inc.php 修改 admin_email $CONF[‘admin_email’] = ‘postmaster@iredmail.abc.org’;  //本來是 postmaster@abc.org , 改成 postmaster@hostname.abc.org

測試寄送歡迎信件,應該OK了

firefox_2016-01-28_15-41-45


 

接著登入之前安裝的 roundcubemail 去收發郵件測試正常, 不過通訊錄還是抓舊的全域通訊錄,應該還是要透過 phpldapadmin 去修改吧,在想是不是乾脆不要用這個功能,改用現在的方式,去AD抓帳號回來好了。 再到手機上測試之前建立的Exchange 帳號也是正常收發! 看起來應該大致可以用了!
修正RoundCubeMail 的通訊錄

用人家寫好的plugin 來新增一個公用通訊錄

https://github.com/JohnDoh/Roundcube-Plugin-Global-Address-Book

下載並解壓縮到 /var/www/roundcubemail/plugins/globaladdressbook 在config 裡面啟用 vim /var/www/roundcubemail/config/config.inc.php 在 plugins 的地方加入 globaladdressbook $config[‘plugins’] = array(‘managesieve’, ‘password’,’globaladdressbook’); 簡單設定一下 vim /var/www/roundcubemail/plugins/globaladdressbook/config.inc.php 設定通訊錄的讀寫權限 // 0 - global address book is read only
// 1 - users can add, edit and delete contacts (full permissions)
// 2 - users can add but not edit or delete contacts
// 3 - users can add and edit but not delete contacts
$config[‘globaladdressbook_perms’] = 3; 設定誰是這個通訊錄的擁有者,理論上應該設定給管理公用通訊錄的人 // global address book admin user
// admin user(s) can always add/edit/delete entries, overrides readonly
// either a single username, an array of usernames, or a regular expression, see README for more info
$config[‘globaladdressbook_admin’] = null; 存檔後離開,在roundcubemail 的通訊錄中,就可以看到多了一個「公用通訊錄」 每個使用者都可以看到,以目前的設定來說,每個人都可以去編輯,但是不能刪除

firefox_2016-01-28_14-11-09



*
設定ROUNDCUBEMAIL去抓AD 的帳號,不過目前搞不定使用者通訊錄排序的問題,群組的排序倒是OK

//update 使用者通訊錄的排序也搞定啦! //底下這行本來被註解掉了,取消註解 $config[‘addressbook_sort_col’] = ‘name’; 改一下config vim /var/www/roundcubemail/config/config.inc.php

 

// Global LDAP address book.
$config[‘ldap_public’][“global_ldap_abook”] = array(
‘name’              => ‘Global LDAP Address Book’,
‘hosts’             => array(‘192.168.10.243’), //改成AD 的IP
‘port’              => 389,
‘use_tls’           => false,
#    ‘ldap_version’      => ‘3’,  //註解掉這行
#    ‘network_timeout’   => 10, //註解掉這行
‘user_specific’     => true,
// Search mail users under same domain. //修改和AD連線的設定, base_dn , bind_dn , bind_pass 都要設定,如果沒設定DN/pass 會發生驗證錯誤,找不到資料的情況
‘base_dn’=> ‘DC=abc,DC=com, DC=tw’,
‘bind_dn’ =>
‘abc@abc.com.tw’,
‘bind_pass’ => ‘abcabc’,
‘writable’      => false,
//設定USER搜尋通訊錄時,要尋哪些欄位,欄位越多,搜尋時間越久,為了省時間,只設定搜尋兩個欄位 ‘search_fields’ => array(‘mail’, ‘cn’),// ‘sn’, ‘givenName’, ‘street’),//, ‘telephoneNumber’, ‘mobile’, ‘stree’, ‘postalCode’), //底下這些其實可有可無,大部分的欄位對應都在下面的 fieldmap //然後AD的欄位很奇怪,不管怎麼抓,就是很固執,我有測試去抓 description 欄位來當作顯示名稱 (surname) 但就是沒作用…而且似乎會拖慢速度 //但是在聯絡人的內容卻有出現設定的描述欄位的資料,就很奇怪,不知道怎麼抓
#’name_field’ => ‘cn’, // this field represents the contact’s name
#’firstname_field’ => ‘cn’, // this field represents the contact’s first name
#’surname_field’ => ‘cn’, // this field represents the contact’s last name
‘email_field’ => ‘mail’, // this field represents the contact’s e-mail
‘scope’ => ‘sub’, // search mode: sub|base|list //不知道幹嘛的
‘filter’ => ‘(&(mail=*)(!(msExchHideFromAddressLists=TRUE)))’, // all mail, except the exchange hidden ,抓取所有 mail 屬性有值的紀錄,除了某些刻意隱藏的
‘sort’ => ‘cn’, // The field to sort the listing by. //排序,不過我測試不出來,改成用 mail 排序也沒作用
‘fuzzy_search’ => TRUE ,// server allows wildcard search //預設值
// mapping of contact fields to directory attributes //這些都是預設值 AD 欄位跟 LDAP 的對應關係,請參考 https://www.manageengine.com/products/ad-manager/help/csv-import-management/active-directory-ldap-attributes.html

//這些都先註解掉
    ‘fieldmap’ => array(
#       ‘name’          => ‘cn’,
  #      ‘surname’       => ‘sn’,
   #     ‘firstname’     => ‘givenName’,
    #    ‘title’         => ‘title’,
     #   ‘email’         => ‘mail:‘,
      #  ‘phone:work’    => ‘telephoneNumber’,
#        ‘phone:mobile’  => ‘mobile’,
#        ‘street’        => ‘street’,
#        ‘zipcode’       => ‘postalCode’,
#        ‘locality’      => ‘l’,
#        ‘department’    => ‘departmentNumber’,
#       ‘notes’         => ‘description’,
  #      ‘name’          => ‘cn’,
   #     ‘surname’       => ‘sn’,
    #    ‘firstname’     => ‘givenName’,
     #   ‘title’         => ‘title’,
#        ‘email’         => ‘mail:
‘,
#       ‘phone:work’    => ‘telephoneNumber’,
  #      ‘phone:mobile’  => ‘mobile’,
   #     ‘phone:workfax’ => ‘facsimileTelephoneNumber’,
    #    ‘street’        => ‘street’,
     #   ‘zipcode’       => ‘postalCode’,
#        ‘locality’      => ‘l’,
#       ‘department’    => ‘departmentNumber’,
  #      ‘notes’         => ‘description’,
   #     ‘photo’         => ‘jpegPhoto’,
    ),
//fields_map 的內容 改成這樣,留下兩個就夠了,其他有用到再開 > ‘fieldmap’ => array( ‘name’          => ‘displayName’ , ‘email’         => ‘mail:*’, ), >   ‘sort’          => ‘cn’, //應該是沒作用
#    ‘scope’         => ‘sub’,
#    ‘filter’        => ‘(&(enabledService=mail)(enabledService=deliver)(enabledService=displayedInGlobalAddressBook)(|(objectClass=mailUser)(objectClass=mailList)(objectClass=mailAlias)))’,
#    ‘fuzzy_search’  => true,
#    ‘vlv’           => false,   // Enable Virtual List View to more efficiently fetch paginated data (if server supports it)
#    ‘sizelimit’     => ‘0’,     // Enables you to limit the count of entries fetched. Setting this to 0 means no limit.
#    ‘timelimit’     => ‘0’,     // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit.
#    ‘referrals’     => false,  // Sets the LDAP_OPT_REFERRALS option. Mostly used in multi-domain Active Directory setups
//底下這是群組的設定 ‘group_filters’ => array(
    ‘departments’ => array(
        ‘name’    => ‘群組’,
        ‘scope’   => ‘sub’,
        #’filter’ = > ‘(&(mail=)(objectClass=group))’,
    ‘filter’ => ‘(&(mail=
)(objectClass=group)(!(msExchHideFromAddressLists=TRUE)))’,
        ‘name_attr’ => ‘description’,
        ‘email’     => ‘mail’,
   ),
),
);
$config[‘autocomplete_addressbooks’] = array(‘sql’, ‘global_ldap_abook’);
群組信箱看到的畫面會是這樣

firefox_2016-01-28_14-53-22

[筆記] Linux 平台上的群組軟體 Zentyal / iRedMail / ZEG 測試 groupware on linux test

Linux 平台上的群組軟體 Zentyal / iRedMail / ZEG 測試 groupware on linux test

zentyal community edition

優點

  • 整合完整,甚至連AD的功能都包進去了
  • 安裝簡單,預設就有提供相對完整的管理功能、介面
  • 要新增網域、使用者、郵件、別名都很簡單
  • 有整合Exchange (EAS / EWS 其中之一)
    缺點

  • 在行動裝置上設定Exchange類型的帳戶碰到困難,無法順利完成設定

  • 似乎還滿吃資源的,預設的VM開 2 core /4G ,在esxi中會出現資源耗盡導致系統停擺的狀況,把硬體加到 4 core / 8G 才沒再發生
  • 雖然在Outlook 2007/2010 可以順利完成Exchange帳號設定,但是outlook 2016 會失敗…
  • 在手機上只能設定IMAP/POP3模式
  • MAC Outlook 2011 設定失敗
    結論:行動裝置支援不足,尚待改進

iRedMail

優點

  • 安裝簡單,但要花一點時間,尤其在更新clamAV的時候常會碰到逾時的狀況,需要強制中斷
  • 預設有管理介面
  • 整合Exchange
  • 有中文的論壇可以發問 http://www.iredmail.com/bbs 有個張工好像很厲害,不過回應速度有點慢
  • outlook 2016 / iphone 設定 Exchange 信箱都正常,行事曆也都OK
  • webmail (SOGo) 有中文介面
  • 支援 EAS 不過不支援 EWS
    缺點

  • 預設管理介面很陽春,只提供新增 postfix 虛擬網域/帳號的功能,郵件別名(mail alias) 都要靠其他軟體(phpmyadmin)補足 ,而且 phpmyadmin 還不能裝太新的,要裝 4.0.10.12版本才行,不然會出現 php / mysql 版本太低的錯誤

  • 如果安裝時選擇openldap認證,安裝完成後,要進入 openldap 管理介面時碰到登入帳號密碼驗證的錯誤,無法解決 update: 搞定了 要修改一個phpldapadmin的設定
  • 安裝時碰到一點點錯誤,2016/01/25 安裝 0.9.3 版本都是OK的,但是01/26要進行安裝,卻會提示有新版本,無法進行安裝,必須要註解掉檢查新版本的功能,而且一開始發生這錯誤時,上官網去看,也沒看到有新版本的公告,過了大概七八個小時之後,才看到有0.9.4 的版本放出來
  • 有提供比較完整功能的管理介面,一年 $499 美金,對於open source 軟體來說,有點小貴
  • 預設整合amavisd ,對於前面有 NOPAM 做Gateway的我的環境,會有一些困擾,必須要另外關閉(關閉的作法在這)
  • 聯絡人搞不定,看不到所有Server上的帳號 (outlook / webmail 都是) update: outlook 可以,但是 webmail 還是看不到..
  • outlook 2011 for MAC設定帳號失敗
    結論:整得不錯,雖然有一些不足,不過目前來說是已經可以用在商業環境的解決方案了

ZEG

優點

  • 預設有提供 vmware 版本,省去安裝的麻煩
  • 沒有了…..
    缺點

  • 免費版本沒有提供管理介面,都要靠命令模式下指令

  • 沒有提供修改設定的說明,例如我想把預設的 example.com 改成我在測試的 abc.com,就不知道要去哪裡改
    結論:不值得使用

 

 

 

[雜念] 燦坤 Surface Pro3 i5/256 送鍵盤 「國王的優惠」

今天早上收到燦坤寄來的 EDM

裡面有提到 Surface Pro3 的優惠方案

雖然沒有想買,不過因為某些原因,還是連進去關心一下

文案上面寫說買 Surface Pro 3 i5/256G 以上規格的機器,立刻省4000,而且送實體鍵盤!

喔喔喔,這方案聽起來不錯啊!!!

但是在網站上逛了一下,沒有看到半台 i5/256G 以上的規格啊!!

那這個優惠是怎樣啦!?

 

主機,Surface_Pro_3,微軟旗艦館_-_燦坤快3網路旗艦店-全台3小時快速到貨_-_Goo_2016-01-18_15-46-07

[筆記] CentOS LAMP Postfix Postfixadmin Virtual Mail Multi Domain SASL TLS SSL Dovecot MySQL

CentOS LAMP Postfix Postfixadmin Virtual Mail Multi Domain SASL TLS SSL Dovecot MySQL 安裝步驟整理

系統基礎


檢查 hostname 是否有設定正確,hostname -f 如果跑不出正確結果,編輯 /etc/hosts 內容

#####安裝會用到的小工具

yum install epel-release ; yum list > yum.txt
yum install ftp traceroute telnet vim joe lynx bind-utils wget openssl ntpdate mail

#####修改時區
cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime
ntpdate time.stdtime.gov.tw

加入 crontab

/10 ntpdate time.stdtime.gov.tw > /dev/null 2>&1

或者是直接安裝 ntp 服務

yum install -y ntp

vim /etc/ntp.conf

加入

restrict 192.168.10.0 mask 255.255.255.0

server  time.stdtime.gov.tw     iburst
server  192.168.10.243  iburst

service ntpd restart

 

#####關閉 SELINUX

vim /etc/sysconfig/selinux

SELINUX = disabled

##### 關閉防火牆服務,有需要再打開 #####

service iptables stop

chkconfig –level 235 iptables off

####系統重開機 套用關閉SELINUX

reboot


LAMP

## MYSQL 5 ##
yum install mysql mysql-server
chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start
/usr/bin/mysql_secure_installation

## APACHE 2 ##
yum install httpd
chkconfig –levels 235 httpd on

##修改 httpd.conf 裡面的 ServerName 參數 ##
vim /etc/httpd/conf/httpd.conf
ServerName localhost:80
service httpd start
check http://ip_address

## PHP ##
yum install php php-gd php-mbstring php-mysql mod_ssl php-imap -y

##add a php file in /var/www/html check if php works

##新增一個 PHP 檔案 看看 php 是否可以正常運作
vim /var/www/html/1.php
<?php
phpinfo();
?>
lynx localhost/1.php

 

########## Enable HTTPS ######

yum install –y openssl mod_ssl

service httpd restart

apache 預設就幫我們做好了兩個憑證,位置在/etc/pki/tls/certs  & /etc/pki/tls/private 底下 檔名分別叫做 localhost.crt / localhost.key 所以修改apache設定去抓這兩個檔案

 

修正

沒有預設做好憑證這回事,所以還是要自己做憑證出來

openssl genrsa -out ms.abc.com.key 1024
openssl req -new -key ms.abc.com.key -out ms.abc.com.csr
x509 -req -days 3650 -in ms.abc.com.csr -signkey ms.abc.com.key -out ms.abc.com.crt

mv ms.abc.com.crt /etc/pki/tls/certs/

mv ms.abc.com.key /etc/pki/tls/private/

vim /etc/httpd/conf.d/ssl.conf

找到 SSLCertificateFile 、 SSLCertificateKeyFile 這兩個參數

加入預設憑證的路徑

SSLCertificateFile /etc/pki/tls/certs/ms.abc.com.crt

SSLCertificateKeyFile /etc/pki/tls/private/ms.abc.com.key

重啟 apache

service httpd restart

開啟 https 頁面測試看看

https://ip_address

一開始應該會出現錯誤憑證的畫面,這是因為我們的憑證是自己簽的,而不是透過第三方機構發的。不過無所謂,可以用就好~

不然還要花錢去申請..


##date.timezone
vim /etc/php.ini
date.timezone = Asia/Taipei
service httpd restart

## LAMP DONE


POSTFIX

## POSTFIX / DOVECOT ##

Cyrus

yum -y install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-md5 cyrus-sasl-plain

**#######################################################

Generate SSL Sign Key                  

#######################################################**

openssl genrsa -des3 -out ms.abc.com.key 2048
chmod 600 ms.abc.com.key
openssl req -new -key ms.abc.com..key -out ms.abc.com..csr
openssl x509 -req -days 3650 -in ms.abc.com..csr -signkey ms.abc.com.key -out ms.abc.com..crt
openssl rsa -in ms.abc.com..key -out ms.abc.com..key.nopass
mv -f ms.abc.com..key.nopass ms.abc.com..key
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650
chmod 600 ms.abc.com.key
chmod 600 cakey.pem
mkdir /etc/ssl/private
mv ms.abc.com.key /etc/ssl/private/
mv ms.abc.com.crt /etc/ssl/certs/
mv cakey.pem /etc/ssl/private/
mv cacert.pem /etc/ssl/certs/

**#######################################################

Add TLS Settings to /etc/postfix/main.cf

#######################################################**

postconf -e ‘smtpd_tls_auth_only = no’
postconf -e ‘smtp_use_tls = yes’
postconf -e ‘smtpd_use_tls = yes’
postconf -e ‘smtp_tls_note_starttls_offer = yes’
postconf -e ‘smtpd_tls_key_file = /etc/ssl/private/ms.abc.com.key’
postconf -e ‘smtpd_tls_cert_file = /etc/ssl/certs/ms.abc.com.crt’
postconf -e ‘smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem’
postconf -e ‘smtpd_tls_loglevel = 1’
postconf -e ‘smtpd_tls_received_header = yes’
postconf -e ‘smtpd_tls_session_cache_timeout = 3600s’
postconf -e ‘tls_random_source = dev:/dev/urandom’
postconf -e ‘myhostname = ms.abc.com’
postconf -e ‘mydomain = abc.com ‘

**#######################################################

/etc/postfix/main.cf should be like this

#######################################################**

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command =
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = abc.com
myhostname = ms.abc.com
mynetworks = 127.0.0.0/8
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination


##### POSTFIX CONFIG #####
postconf -e ‘inet_interfaces = all’
postconf -e ‘mynetworks = 127.0.0.0/8’
postconf -e ‘smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination’
postconf -e ‘mailbox_command =’

#########SASL##############
postconf -e ‘broken_sasl_auth_clients = yes’
postconf -e ‘smtpd_sasl_auth_enable = yes’
postconf -e ‘smtpd_sasl_local_domain = ‘
postconf -e ‘smtpd_sasl_path = private/auth’
postconf -e ‘smtpd_sasl_security_options = noanonymous’
postconf -e ‘smtpd_sasl_type = dovecot’

##### TLS , check the cert file location #####

smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/ms.abc.com.crt
smtpd_tls_key_file = /etc/ssl/private/ms.abc.com.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom

### Virtual Mail ###

**#######################################################################################

Create cf files

#######################################################################################
**vim /etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf

user = postfixadmin
password = postfixadmin
hosts = localhost
dbname = mail
query  = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = ‘%d’ and alias.address = CONCAT(‘@’, alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active=’1’


vim /etc/postfix/sql/mysql_virtual_alias_domain_maps.cf

user = postfixadmin
password = postfixadmin
hosts = localhost
dbname = mail
query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = ‘%d’ and alias.address = CONCAT(‘%u’, ‘@’, alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active=’1’


vim /etc/postfix/sql/mysql_virtual_domains_maps.cf

user = postfixadmin
password = postfixadmin
hosts = localhost
dbname = mail
query          = SELECT domain FROM domain WHERE domain=’%s’ AND active = ‘1’


vim /etc/postfix/sql/mysql_virtual_mailbox_maps.cf

user = postfixadmin
password = postfixadmin
hosts = localhost
dbname = mail
query           = SELECT maildir FROM mailbox WHERE username=’%s’ AND active = ‘1’


vim /etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf

user = postfixadmin
password = postfixadmin
hosts = localhost
dbname = mail
query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = ‘%d’ and mailbox.username = CONCAT(‘%u’, ‘@’, alias_domain.target_domain) AND mailbox.active = 1 AND alias_domain.active=’1’


vim /etc/postfix/sql/mysql_virtual_alias_maps.cf

user = postfixadmin
password = postfixadmin
hosts = localhost
dbname = mail
query = SELECT goto FROM alias WHERE address=’%s’ AND active = ‘1’

#expansion_limit = 100


vim /etc/postfix/sql/mysql_virtual_mailbox_limit_maps.cf

user = postfixadmin
password = postfixadmin
hosts = localhost
dbname = mail
query = SELECT quota FROM mailbox WHERE username=’%s’ AND active = ‘1’


postconf -e ‘virtual_alias_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf,   proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf,   proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf’
postconf -e ‘virtual_gid_maps = static:5000’
postconf -e ‘virtual_mailbox_base = /home/vmail’
postconf -e ‘virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf’
postconf -e ‘virtual_mailbox_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf,   proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf’
postconf -e ‘virtual_transport = virtual’
postconf -e ‘virtual_uid_maps = static:5000’

Others

postconf -e ‘unknown_local_recipient_reject_code = 550’


**#######################################################################################

add vmail user/group for virtual mail    

uid should be the same with main.cf      

#######################################################################################**

groupadd -g 5000 vmail
useradd -g vmail -u 5000 vmail -d /home/vmail
chown vmail:vmail /home/vmail


############### MYSQL ###############

mysql -u root -p
create database mail;
create user ‘postfixadmin‘@’localhost’ identified by ‘postfixadmin’;
grant all privileges on mail.* to ‘postfixadmin‘@’localhost’;
flush privileges;
quit


#########Postfixadmin ###################

wget http://nchc.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.93/postfixadmin-2.93.tar.gz
tar zxvf postfixadmin-2.93.tar.gz
mv postfixadmin-2.93 postfixadmin
mv postfixadmin /var/www/html/
cd /var/www/html/postfixadmin
vim config.inc.php
$CONF[‘configured’] = false;  –> $CONF[‘configured’] = true;
$CONF[‘database_type’] = ‘mysqli’;
$CONF[‘database_host’] = ‘localhost’;
$CONF[‘database_user’] = ‘postfix’;  –> $CONF[‘database_user’] = ‘postfixadmin’;
$CONF[‘database_password’] = ‘postfixadmin’;
$CONF[‘database_name’] = ‘postfix’; –> $CONF[‘database_name’] = ‘mail’;

open http://ip_address/postfixadmin/setup.php
Error: Smarty template compile directory templates_c is not writable.
Please make it writable.
If you are using SELinux or AppArmor, you might need to adjust their setup to allow write access.

chmod a+rw -R /var/www/html/postfixadmin/templates_c
open http://ip_address/postfixadmin/setup.php

change setup password (two digit , two letters , will fix later) and new password will be generated

vim /var/www/html/postfixadmin/config.ini.php
Replace
$CONF[‘setup_password’] = ‘changeme’;
to
$CONF[‘setup_password’] = ‘0287c360cbc407f4e18e520651a1c1b8:3a8a82f252f00a8593c0bfc9fa006a98deee2b32’;

create a new mail master

go http://ip_address/postfixadmin/login.php using the account last step

change the password limitation

vim /var/www/html/postfixadmin/config.inc.php

$CONF[‘password_validation’] = array(

#    ‘/regular expression/‘ => ‘$PALANG key (optional: + parameter)’,
‘/.{5}/‘                => ‘password_too_short 5’,      # minimum length 5 characters

#’/([a-zA-Z].){3}/‘     => ‘password_no_characters 3’,  # must contain at least 3 characters –>
‘/([a-zA-Z].
){0}/‘        => ‘password_no_characters 3’,  # must contain at least 0 characters –>

#’/([0-9].){2}/‘       => ‘password_no_digits 2’,      # must contain at least 2 digits  –>
‘/([0-9].
){0}/‘        => ‘password_no_digits 2’,      # must contain at least 0 digits  –>
);


**######################################################

create a new virtual domain and virtual user

check if the records exists

######################################################*
mysql -u root -p
use mail;
show tables;
select
from domain;
select * from alias;
exit

in /var/log/maillog , there should be a welcome messages from postmaster to the acouunt you just created

Jan 13 13:37:25 mssop postfix/qmgr[2396]: 632D740A18: from=<postmaster@abc.com.tw>, size=489, nrcpt=1 (queue active)
Jan 13 13:37:25 mssop postfix/smtpd[2965]: disconnect from localhost[::1]
Jan 13 13:37:25 mssop postfix/virtual[2975]: 632D740A18: to=<mc@abc-taf.com>, relay=virtual, delay=0.16, delays=0.06/0.1/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
Jan 13 13:37:25 mssop postfix/qmgr[2396]: 632D740A18: removed


**#######################################################

######       Dovecot Config                    ########

#######################################################**

vim /etc/dovecot/conf.d/10-ssl.conf

ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem

vim /etc/dovecot/conf.d/10-auth.conf

disable_plaintext_auth = no
auth_mechanisms = plain login
!include auth-sql.conf.ext

vim /etc/dovecot/conf.d/10-mail.conf

mail_location = maildir:/home/vmail/%d/%n
mail_privileged_group = mail
mbox_write_locks = fcntl

vim /etc/dovecot/conf.d/10-master.conf

service imap-login {
inet_listener imap {
}
inet_listener imaps {
}
}

service pop3-login {
inet_listener pop3 {
}
inet_listener pop3s {
}
}

service lmtp {
unix_listener lmtp {
}

}

service imap {

}

service pop3 {
}

service auth {
unix_listener auth-userdb {
}

unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
}

service auth-worker {
}

service dict {
unix_listener dict {
}
}

vim  /etc/dovecot/conf.d/auth-sql.conf.ext

passdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}

userdb {
driver = static
args = uid=vmail gid=vmail home=/home/vmail/%u
}

**###########################################################################

Create the dovecot-sql.conf.ext file for support dovecot-mysql

###########################################################################**

vim  /etc/dovecot/dovecot-sql.conf.ext

driver = mysql
connect = host=127.0.0.1 dbname=mail user=postfixadmin password=postfixadmin
default_pass_scheme = MD5-CRYPT
password_query = SELECT username AS user,password FROM mailbox WHERE username = ‘%u’ AND active=’1’
user_query = SELECT maildir, 5000 AS uid, 5000 AS gid FROM mailbox WHERE username = ‘%u’ AND active=’1’
user_query = SELECT CONCAT(‘/home/vmail/‘, maildir) AS home, 5000 AS uid, 5000 AS gid, CONCAT(‘*:bytes=’, quota) AS quota_rule FROM mailbox WHERE username = ‘%u’ AND active=’1’
user_query = SELECT maildir, 5000 AS uid, 5000 AS gid, CONCAT(‘dict:storage=’,floor(quota/1000),’ proxy::quota’) as quota FROM mailbox WHERE username = ‘%u’ AND active=’1’


**############################################################################

########## install roundcubemail           #################################

############################################################################**

yum install roundcubemail
vim /etc/httpd/conf.d/roundcubemail.conf

Comment First two Directory Settings for install

Alias /roundcubemail /usr/share/roundcubemail
change to
Alias /mail    /usr/share/roundcubemail

<Directory /usr/share/roundcubemail/>
<IfModule mod_authz_core.c>

Apache 2.4

#Require local
</IfModule>
<IfModule !mod_authz_core.c>

Apache 2.2

#Order Deny,Allow

#Deny from all

#Allow from 127.0.0.1

#Allow from ::1
</IfModule>
</Directory>

Define who can access the installer

keep this secured once configured

<Directory /usr/share/roundcubemail/installer/>
<IfModule mod_authz_core.c>

Apache 2.4

#Require local
</IfModule>
<IfModule !mod_authz_core.c>

Apache 2.2

#Order Deny,Allow

#Deny from all

#Allow from 127.0.0.1

#Allow from ::1
</IfModule>
</Directory>

create a database for roundcubemail

mysql -u root -p
create database rcmail;
create user ‘rcmail‘@’localhost’ identified by ‘rcmailpassword’;
grant all privileges on rcmail.* to ‘rcmail‘@’localhost’;
flush privileges;

service httpd reload

open http://ip_address/mail/installer/
check if any errors , if not , next , if so , fix it !
After Next , modify the database setting with last step you create
modify the SMTP Server with localhost , check “Use the current IMAP username and password for SMTP authentication”
language : zh_TW ( not sure if this works or not )
press create config file
copy the file to /etc/roundcubemail/config.inc.php
press continue
check if any errors
initialize database
test SMTP
with the first account/password you create in the postfixadmin section

test IMAP

mv /usr/share/roundcubemail/installer /usr/share/roundcubemail/installer.bak

login to roundcubemail
open https://ip_address/mail/
login with the account/password you create in the postfixadmin section
like username@domain.name
and there`s one mail waiting for you ~

Cong ! Everything works fine now ! ( it should be …..)

[測試] WordPress中14个实用的函数

#


分类:WordPress内核




WordPress临时API
set_transient(), get_transient(), delete_transient()

这个函数类似 于用于存储检索选项数据库表单的get_options()以及update_options()函数。 他们的主要区别在于,你可以给这个临时API函数传递一个时间参数,作为数据库输入的过期日。当参数显示的时间到达之后,输入会被移除。如果你需要缓存数 据或查询某个短期时间内的结果,这会是个相当有用的函数。

set_transient的参数:
set_transient($transient, $value, $expiration);

将某个值保留在数据库中一小时:
set_transient(‘the_name’, $special_query_results, 60*60);

结果值:
$value = get_transient(‘the_name’);

WordPress “定时任务”函数
wp_schedule_event(time(),?’hourly’,?’my_schedule_hook’);

如果你需要定时执行某段代码,像是检查RSS订阅、数据库备份或是重设数据库值等,就可以用到这个函数。这里有一个关于这个函数的英文教程。

WordPress HTTP API
wp_remote_get(?$url,?$args?=?array()?);

这是个用于检索网页内容的简单函数。函数把检索结果存储在一个数组里。你不仅可以得到网页的结果内容,还可以获取网页的页头信息和相应代码。

轻松获取RSS 订阅
$feed?=?fetch_feed(?$uri?);

fetch_feed是一个用来获取订阅内容的简单WordPress函数。这个函数可以检索、分析并自动缓存订阅内容。

WordPress邮件函数
wp_mail()  wp_mail(?$to,?$subject,?$message,?$headers,?$attachments?);

示例:
Example:
$to = 'kriesi@gmail.com‘;
$subject = ‘Hello Kriesi!’;
$message = ‘This message was sent by wordpress’
$mail = wp_mail($to, $subject, $message);
if($mail) echo ‘Mail delivered’;

相当简单实用的函数,利用这个函数你可以发送页头信息和附件、普通文本、HTML信息以及其他各种选项。

计时函数
human_time_diff( $from, $to )

这个函数显示出的时间效果不是普通的时间格式,而是“XXX发布于XXX小时前”这样。

WordPress get_comments函数
get_comments()

在评论循环外检索评论内容。

字符串验证
wp_kses($string, $allowed_html, $allowed_protocols);

如果你需要过滤不受信任的用户输入内容,wp_kses会是个很实用的函数。这个函数确保$string中只出现经许可的HTML元素名称、属性和属性值以及正常的HTML实体。

WordPress文本转换
wptexturize()

这个函数把常用的字符串转换成印刷时采用的正确符号,比如破折号、省略号等,有时也会为某些段落加上排版引号。
wpautop()

给字符串添加<p>标签

WordPress短码API
add_shortcode(), do_shortcode()

add_shortcode()可以快速为你的日志内容创建宏。假设你希望把日志里的某些内容包围在一个div块里,并且加上若干类和id,让你可以创建多个内容栏。你可以用HTML编辑器进行编辑,然后输入下面的内容:
<div class=’one_third’>内容</div>

用PHP函数生成WordPress日志
wp_insert_post()

这个函数在数据库中插入文章页面和自定义文章类型。它会过滤变量并执行检查,补充日期/时间等缺失变量。如果用户可以通过你的网站前台提交内容,这个函数会相当有帮助。

用PHP函数生成WordPress评论
wp_insert_comment()

和wp_insert_posts类似,不过wp_insert_comment插入的是评论。

WordPress对象缓存
wp_cache_add(),? wp_cache_set(),? wp_cache_get(),? wp_cache_delete, wp_cache_replace(), wp_cache_flush

WP_Object_Cache是WordPress中用以缓存数据的类。

禁止执行WordPress任务
wp_die()

wp_die终止WordPress运行,显示HTML错误信息。

这个函数与PHP函数die()互为补充。HTML信息显示给用户。推荐仅在进程不能再继续时才使用该函数。

[筆記] Freebsd 10.1 apache24 / mysql / php56

今天發現 pkg install 比 ports make install 快好多好多!我以前花了好多時間在make啊!!!

 

APACHE 24

pkg install apache24

sysrc apache24_enable=yes

service apache24 start

Web 根目錄在 /usr/local/www/apache24/data

開啟 http://your_server_ip

應該要看到 It Works !

 

MYSQL

pkg install mysql56-server

sysrc mysql_enable=yes

server mysql-server start

mysql_secure_installation  (記得改密碼,其他應該ENTER帶過就可以)

 

PHP 5.6

pkg install php56 php56-mysql php56-mysqli php56-gd php56-mbstring

cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

修改 php.ini 找到 DirectoryIndex  index.htm 這一行

改成 DirectoryIndex index.php index.html index.htm

再加入底下這幾行

<FilesMatch “.php$”>

SetHandler application/x-httpd-php

</FilesMatch>

<FilesMatch “.phps$”>

SetHandler application/x-httpd-php-source

</FilesMatch>

service apache24 restart

建立一個 test.php

<?php

phpinfo();

?>

這樣應該就完成了

[筆記] 將日期變數 date variable 加入 bashrc

 

vim /etc/bashrc ( or /HOME_DIR/.bashrc) export datecode=date +"%Y%m%d" 以後就可以直接使用 $datecode 來產生今天的日期給備份的命令用 [root@w ~]# touch test_$datecode
[root@w ~]# ls
anaconda-ks.cfg test_20151222  yum.txt
[root@w ~]#

[其它] 在marvel看過最恐怖的經驗/故事(補連結+整理)

作者unicrysfish (獨晶魚) 看板marvel

標題Re[其它] 在marvel看過最恐怖的經驗/故事(補連結+整理)

時間Tue Dec 8 00:47:23 2015

大家好我是原po

轉眼間已經過一年了

很開心剛剛看到板上有人整理2014跟2015的推薦文^^

我這篇算是舊文的總整理

有興趣也可以參考看看

[筆記] find files create in a week and tar the files

tar cfz `date +%Y-week%V`.tar.gz `find . -ctime -7 -type f -name "*.*"`
 

[書籍]紅色覺醒 & 金色同盟

推薦指數:★★★★★★★★★★ (滿分!)

在不透露劇情的前提下要推薦這本書還挺困難的!

總之就是劇情高潮迭起~緊張刺激~

大概跟血歌差不多等級!

不過說真的,血歌的第三部曲真的有弱掉的感覺

不過紅色覺醒和金色同盟這兩本看下來,沒有這種問題!

雖然主角練功等級有點快 ,而且沒啥香豔刺激的情節

不過書中各勢力的爾虞我詐、衝突鬥爭真的是很不錯!這點比血歌要好很多很多~

 

[筆記] shadowcopy 語法

“C:\Program Files (x86)\Runtime Software\ShadowCopy\shadowcopy.exe” d:\outlook*.* h:\outlook_bak /s /y

[靈感] 太陽能藍芽即時溫濕度感應器

好像是昨天睡覺作夢夢到的?

 

感應器模組就是一個溫濕度SENSOR 加上 太陽能面板/電池模組,可以用太陽能供電

人不必走出戶外,就能知道現在室外的溫濕度

室內可以有一個顯示模組,就類似現在的數位溫濕度計,只是資料來源來自戶外的SENSOR

可以設定資料回傳時間(min/hour)

或者是可以傳到手機上的APP做紀錄

顯示模組可以做成按一下再顯示或總是顯示,節省電力

 

[筆記] PIPO W8 Win8 改 Win10

2016/03/07 Update: 最近這台出現了休眠後叫不起來的問題,我記得剛開始升級Win10的時候是不會的呀

後來是去下載了一個雙擊關閉螢幕的小軟體,就不要讓電腦進入休眠,只把螢幕關閉,要用的時候再按個鍵盤開啟螢幕這樣..

然後看要不要去把系統設定內的電源鍵改成沒有動作,避免不小心按到..

 

PIPO W8 Win8 改 Win10

趁著雙11 ,在淘寶敗了一台PIPO W8 CoreM 二合一變形筆電,等了好久終於到貨,難怪大陸同事都說雙11下定,要等到雙12才會收到 XD

拿到東西,內建的當然是Win8的簡體中文版。

這類大陸出的Win8平板,內建的大概都是簡體中文單一語言版本,雖說可以透過一些方式,去下載繁體語言包,但是用起來總是很彆扭。

而且win8感覺就是卡卡的,所以我也沒先查資料,就直接給他升級Win10。

升級之後,系統果然變順了!驅動程式的部分,下載驅動精靈來安裝,會有兩個失敗,不過在裝置管理員中沒有看到有驚嘆號的設備,

想說這樣應該是正常了吧,沒想到觸控居然不能使用!?

那只好改回來啦~不然就失去「變形」的意義了啊,一直接著USB鍵盤滑鼠是能看喔?

於是從微軟那邊下載了Win8的安裝工具,做一個ISO出來,再透過卡碟機進行安裝,這過程滿順利的

驅動程式的部分,可以從這邊抓 http://techtablets.com/pipo-w8/downloads/

重點在於 Pipo W8 TouchSetting Gt Touch Config (1.0 KiB) 還有 OEM SLIC Bios Windows Key Reader (11.2 KiB) 這兩個檔案

第一個是觸控面板的設定檔,安裝好Win8之後,要把這個檔案放進windows\inf 底下

第二個是可以讀取OEM 的Windows Key (不過後面都沒用到,原因是…. you know ! )

就這樣把Win8弄好,該裝的軟體、播放器、解壓縮等等都上去了,但就是覺得卡卡的!用得很不爽!想說再來測試一次Win10 好了!

先把系統備份好,然後一樣去微軟下載win10的安裝工具,接著開機選擇卡碟機進行系統安裝(不是從win8內升級喔~)

安裝過程一樣也是很順利,而且更神奇的是,還沒裝驅動前,觸控居然沒有問題,可以正常使用!

裝完系統,透過驅動精靈把該裝的驅動程式裝一裝,裝置管理員一樣沒有驚嘆號,觸控正常,Win10也不會卡卡的,真的是太棒了!

2015-12-08_09-48-26

 

不過有個問題是win10的截圖快捷鍵我一直弄不出來(Windows Key + volume down)

最後還是用我習慣的sharex 軟體,設定volume + 的實體鍵作為截圖快捷鍵

然後趕緊做個全系統備份起來,這樣一來,Win10的系統整個就差不多了!

用CoreM 跑Win10 比起之前用Atom Zxxxx 系列,更順暢了!就是SSD小了點(64G) 當初應該選128G的!

等看過保之後能不能自己拆開換吧~~

 

 

[筆記] 中華電信也被拿來騙帳號密碼了

剛剛收到的郵件,這是第一次看到以中華電信名義來騙帳號密碼的郵件

不過啊……你忘記換成繁體字了啦!

最好中華電信會用簡體字發信出來給客戶啦~

2015-12-04_13-33-45

點連結以後,不意外的會開啟一個要你登入帳號密碼的網頁

到這邊還會被騙,那也不知道該說啥了…

2015-12-04_13-34-14

 

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×