Step by Step Installation of Raspberry Pi

Introduction

Recently, I bought a Raspberry Pi 2 B as my Christmas gift myself. Ha..Ha… It is a Good Stuff… Raspberry Pi is a very low cost Linux computer with pocket size. However, it is very powerful, and you can use it as a calculation processor, web hosting computer, network router, micro-controller for automatically, etc.Attractive… Right … To provide you information to start to use it, I would like to explain its installation as below. Hope it is help to you. If you are interested in it, feel free to check more information from amazon link click –> <<here>> .

20151219_131739

Step 1: Format SD Card via SDFFormatter

Download SDFFormatter from https://www.sdcard.org/downloads/formatter4/

Step 2: Write NOOBS System to SD Card

Download NOOBS from https://www.raspberrypi.org/downloads/

Step 3: Connect Keyboard/Mouse/HDMI monitor/SD Card/Power to Raspberry Pi

Connect power and switch-on the device, then follow the screen display to install Raspbian O/S System.

Step 4: Install to local/keyboard/country/display Chinese Char

  1. raspi-config 先設定 locales, 如utf-8 等
  2. 安裝字型 sudo apt-get install ttf-wqy-microhei
  3. Select Midori font 選字型 文泉驛微米黑
  4. Select Raspberry Configuration
    • Select keyboard as US (internation)
    • Select your country
  5. Reboot the system

Step 5: Install program to update System Time via Internet

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get install ntpdate

$ sudo service ntp restart

Step 6: Install tightvncserver program

Reference Info –> https://www.raspberrypi.org/documentation/remote-access/vnc/README.md

  • On your Pi (using a monitor or via SSH), install the TightVNC package:

$ sudo apt-get install tightvncserver

  • Next, run TightVNC Server which will prompt you to enter a password and an optional view-only password:

$ sudo tightvncserver

  • Start a VNC server from the terminal. This example starts a session on VNC display zero (:0) with full HD resolution:

$ sudo vncserver :0 -geometry 1920×1080 -depth 24

Automation and run at boot

You can create a simple file with the command to run the VNC server on the Pi, to save having to remember it:

$ sudo vi /etc/init.d/vncboot

  • Create a file containing the following shell script:

#! /bin/sh
# /etc/init.d/vncboot

### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO

USER=pi
HOME=/home/pi

export USER HOME

case “$1” in
start)
echo “Starting VNC Server”
#Insert your favoured settings for a VNC session
su – pi -c “/usr/bin/vncserver :0 -geometry 1280×800 -depth 16 -pixelformat rgb565”
;;

stop)
echo “Stopping VNC Server”
/usr/bin/vncserver -kill :0
;;

*)
echo “Usage: /etc/init.d/vncboot {start|stop}”
exit 1
;;
esac

exit 0

 

  • Save this file as vncboot (for example)
  • Make this file executable:

$ sudo chmod 755 vncboot

  • Enable dependency-based boot sequencing:

$ sudo update-rc.d vncboot defaults

In your client computer, use vnc client to connect to   your ip address:5900     or     Ip address:1

Step 7: Install Samba program to setup share folder

$ sudo apt-get install samba samba-common-bin

$ sudo adduser powenko

$ sudo usermod –a -G sambashare powenko

$ sudo pdbedit –a –u powenko

$ sudo mkdir /home/allusers

$ sudo chown root:sambashare /home/allusers/

$ sudo chmod 770 /home/allusers/

$ sudo chmod g+s /home/allusers/

$ sudo nano /etc/samba/smb.conf

Edit with the following:

security = user
read only = no
[allusers]
comment=Shared Folder
path=/home/allusers
read only=no
guest ok=no
browseable=yes
create mask=0700

Start Samba Server Automatically

$sudo /etc/init.d/samba restart

Connect Folder via Client Computer

\raspberrypiallusers
\raspberrypipowenko

Step 8: Install Cloud/Apache/php to setup share folder

Step 01 Install software

You’ll want Apache software and PHP for this. Install everything you need with:

$ sudo apt-get install apache2 php5 php5-json php5-gd php5-sqlite curl libcurl3 libcurl4-openssl-dev php5- curl php5-gd php5-cgi php-pear php5-dev build-essential libpcre3-dev libapache2-mod-php5 php-apc

Step 02 Setup PHP accelerator   (optional: this step only works for php 5.4 or below)

Install your accelerator with $ sudo pecl install apc

But I’m getting this error:                       ^

make: *** [apc_cache.lo] Error 1
ERROR: `make’ failed

Remark:  apc is no longer supported on PHP 5.5 and above. A quick search brought me to this;
http://grokbase.com/t/php/php-internals-win/145fj1qj14/compiling-memcache-and-apc-for-php-5-6, Which seems to confirm that it won’t work.

Then edit an ini file, use $sudo nano/etc/php5/cgi/conf.d/apc.ini and then add this to the file:

extension=apc.so
apc.enabled=1
apc.shm_size=30

Step 03 Configure file limits

Go into the Apache config file with $ sudo nano /etc/php5/apache2/php.ini. It’s a big file, but there are two filesize options you need to find, and a third extension option you need to add as below:

upload_max_filesize = 2048M
post_max_size = 2200M
extension = apc.so           # optional

Step 04 Set up SSL

First of all, you need to enable SSL in Apache; do this by using sudo nano /etc/apache2/sites-enabled/000-default.conf and change ‘None’ to ‘All’ in the AllowOverride option. Follow this up with the following two commands:

$ sudo a2enmod rewrite

$ sudo a2enmod headers

Step 05 Finish up with Apache

You now need to do two sets of commands: a big one which requires some info and then a restart:

$ sudo openssl genrsa -des3 -out server.key 1024

$ sudo openssl rsa -in server.key -out server.key. insecure

$ sudo openssl req -new -key server.key -out server.csr

$ sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

$ sudo cp server.crt /etc/ssl/certs;sudo cp server.key /etc/ssl/private;sudo a2enmod ssl

$ sudo a2ensite default-ssl

$ sudo service apache2 restart

Step 06 Download and install ownCloud

Here you have a series of commands to run that will download, unzip and install ownCloud to the right place:

$ wget https://download.owncloud.org/community/owncloud-7.0.0.tar.bz2

(option: find the latest update from https://owncloud.org/install/#instructions-server)

$ sudo tar -xjf owncloud-7.0.0.tar.bz2

$ sudo cp -r owncloud /var/www/html/

Step 07 ownCloud permissions

Make sure your hard drive is connected and mounted as you want it. First, give webserver permission to use ownCloud:

$ sudo chown -R www-data:www-data /var/www/html/owncloud/

Next, use sudo nano /var/www/owncloud/.htaccess and make the same changes you did in the php.ini file above.

php_value_upload_max_filesize 2000Mphp_value_post_max_size 2000Mphp_value_memory_limit 2000M

Finally, give permissions to the location you mounted the hard drive to with:

$ sudo chown -R www-data:www-data [mount]

Step 08 Set up ownCloud

In your client computer web browsers,  navigate to https://[ipaddress]/owncloud to begin the ownCloud setup process, as below diagram. The first thing you’ll need to do is change the data location to the mount point of your external drive, which can be found in the advanced options.

owncloud-setup

 Order a RaspBerry Pi from Amazon as below link:

Odoo System Schedule Backup and Restore Database Setup

This module will be work internally as command line interface (for Linux only) through linux crontab to backup and restore database.

  1. Backup database
  2. Restore as database _TEST
  3. Update image (i.e., with test logo) to _TEST

Just install this module, and it should work. Setup schedule time as you need it. Note: Itself, can also be used as scheduler instead of normal scheduler in OpenERP (you will see this backup and restore as one example).

Features

  • Add, Modify, Delete schedule
  • Direct process through command line interface

Setup Procedure

Menu -> Setting/Technical/Scheduler/Crontab Configuration

Fields:

  1. Crontab Name – name of crontab

  2. Description – more information

  3. Scheduling – crontab scheduling

    3.1 Minute: 0-59

    3.2 Hour: 0-23

    3.3 Day: 1-31

    3.4 Month: 1-12

    3.5 Weekday: 0-6, where 0 = Sunday

  4. Execute Directory – OpenERP’s root path to be used for log file, Temp File, DB Backup File and etc (depends on type of program)

  5. Command – command to run the program in command line interface pattern, require full path.

  6. Active – when True, will create crontab scheduler in OS. When False will delete it.

  7. Status

    7.1 Draft

    7.2 Confirmed

    7.3 Cancelled

  8. Attach File – Additional files, to be used in process (optional)

Note: crontab scheduler will be created only when State = Confirmed and Active = True

Technical Detail

Backup Database Script:

Use script, db_backup.py (written in Python)

 db_backup.py -u -d -p

Example:

 ‘/home/buasri/workspace/ecosoft_official_addons/ecosoft-addons/crontab_config/db_backup.py’ -u openerp -d TT -p ‘/home/buasri/workspace/openerp_tt’>>’/home/buasri/workspace/openerp_tt/crontab_oe.log’

Process:

  1. Create backup database as _dbbackup-YYYY-MM-DD hh:mm:ss.dmp
  2. Create file oe_db_last_bkup.txt to be used for restoration

Restore Database Process:

Use script, db_restore.py (written in Python)

 db_restore.py -u -d -p

-i id of crontab in OpenERP, from table crontab_config -c id of Company in OpenERP, from table res_company

Example:

 ‘/home/buasri/workspace/ecosoft_official_addons/ecosoft-addons/crontab_config/db_restore.py’ -u openerp -d TT_TEST -p ‘/home/buasri/workspace/openerp_tt’>>’/home/buasri/workspace/openerp_tt/crontab_oe.log’

Process

  1. Disconnect database to be restored
  2. Delete database
  3. Create new database
  4. Restore it.
  5. Read attached logo file
  6. Resize logo file
  7. Update logo file

金蝶 K3 ERP系統之操作問題 – 重複打印領料單

问题1. 生产领料单存在同单号打印多次或打印单据领料后单据没有及时审核,此举导致系统库存数量不准。

方案 1) 限制普通PMC员工不能重复打印生产领料单,只准准许PMC主管级以上才能处理第二次的打印工作。

好处: 可以避免PMC员工重复打印生产领料单。

坏处:增加PMC主管的工作量,而且技术上亦难办到,需要外发给K3顾问来开发程式。

方案 2) 把打印次数也印在生产领料单上,PMC员工可查看此资料而得知此单据是否重复打印,若打印次数为一次,便绝对不会是重复的了,否则,便要小心检查。

好处: 可以提供资料给PMC员工查看打印生产领料单的次数,方便检查是否重复打印;另外,系统编程的技术上应该可以办到。

坏处:管控方面由PMC员工处理,可能仍然会有漏洞。

方案 3) 限制权限,把生产领料单的打印工作设定为PMC主管负责,由专人未检查和打印,可保证单据正确和没有重复。

好处: 标淮的K3功能已经可以设置权限,不需额外编程。

坏处:PMC主管的工作量增多,影响工作效率。

方案 4) 生产领料单的审批工作交由仓务员或仓务主管处理,若遇到重复的单据,他可以在收集物料和审批时检查出是否重复,若重复便不发料,以及通知PMC员工检查修正。

好处: 由仓务员或仓务主管处理审批,可有效避免重复发料;另外,标淮的K3功能已经可以设置权限,不需额外编程。

坏处:PMC员工的审批工作转移到仓务部,仓务部的工作量增多。

结论建議:其實,本人认为管控倉庫人員的工作, 已可解決問題,<<方案4>> 的效果會比较其它方案优胜;否則,亦可採用<<方案2>>,修改系統程式來改善問題。

 

Odoo 企业管理系统操作手册

我尝试这个Odoo企业系统,其功能相当齐全,我打算把其<<即时通讯>>、<<项目管理>>和<<论坛(Forum)>>功能介绍给大家尝试使用,Odoo 企业管理系统操作操作手册如下,供你们參考。

测试Odoo企业系统,请登陆 ..,先选 Database = Demo,然後输入账号 = Demo 和密码 = Demo,如有时间请尝试使用,给予意见。谢谢!

操作步骤:

1. 登入 http://54.169.174.119/,选 Database = test_odoo,然後输入账号和密码 = demo

odoo-oper0 odoo-oper01

2.  即时通讯功能

步骤1:按即时通讯图像

步骤2:选择通讯的对象

步骤3:输入及发送通讯内容

注: 虽然“绿色” 标示代表有效通讯,但是不表示对方一定会看到留言和回覆,因为对方可能把浏览器关闭,或是未有注意到电脑屏幕,所以若是紧急通讯,还是用电话比较好。

odoo-oper2

3.  发放群组讯息

步骤1:按“消息”图像

步骤2:选择“Whole Company (全公司)” 或 其它群组

步骤3:输入内容後按发放

odoo-oper3

注:在此输入群组发送讯息,用户将於其Foxmail电邮和群组讯息中看到,而不是在此系统的“收件箱”中收到电邮,敬请留意。


4.  项目管理

管理项目是组织活动、计划任务、跟踪问题,记录人力资源成本的组织形式。项目可以分为内部项目(研发活动,加快销售进度),私有项目或者客户参与的项目。 内部用户以项目成员的方式参与到项目中,分享项目的活动讯息。

odoo-oper4

项目活动预备以下阶段,用户也可按合式的运作需要来修改:

致於详细的项目管理运作,请參考以下Youtube的电影教材 (暂时只有英语版本):

国内网址:   https://infotechmanagefactory.com/odoo-project-management-training-video/

国外网址:   https://www.youtube.com/watch?v=Ij8IHJCdWkg

5.  Forum论坛管理

我们可用此功能张贴问题,然後等待同事支援,提出和记录解决方法,方便日後在这论坛(Forum) 内搜索。

5.1 选 “Website”

odoo-oper5

5.2 选 “Forum”

odoo-oper6

 

5.3 输入问题或回覆问题

odoo-oper7

总结

此Odoo为市场上新推出的公司管理软件,功能强大,希望大家共同合作去研究实施,为各人的工作带来便利。

谢谢!

How to Hidden “Manage Databases” Option on Odoo Logon Screen

Because of security control purpose, it is unsafe to publish the whole database management option to public. Hence, I would suggest to change the database management screen from original screen as below Diagram 1 to Diagram 2. To achieve it, you only need to edit the “base.xml” file under …/addons/web/static/src/xml directory as below steps.

Diagram 1manage-db1

Diagram 2manage-db2

 

Step 1:

#cd /usr/lib/python2.7/site-packages/openerp-8.0_c7d8e97-py2.7.egg/openerp/addons/web/static/src/xml

Step 2:

#vi base.xml

Step 3:

Find the section of <form id =”db_create” … until  … </form>  as below and delete those content:

<form id=”db_create” name=”create_db_form” style=”display: block;”>

<div class=”oe_view_manager oe_view_manager_current”>

…..

</form>

And then find the sections of  <form id =”db_drop”… </form>, <form id =”db_restore”… </form>, and <form id =”db_change_password”… </form>, and delete all of them.

Step 4:

Find the following and delete the crossed option:

<t t-name=”DatabaseManager.menu”>

<div class=”oe_secondary_menu_section”>Database Management</div>

<ul class=”oe_secondary_submenu nav nav-pills nav-stacked”>

<li><a href=”#db_create”>Create</a></li>

<li><a href=”#db_duplicate”>Duplicate</a></li>

 <li><a href=”#db_drop”>Drop</a></li>

<li><a href=”#db_backup”>Backup</a></li>

<li><a href=”#db_restore”>Restore</a></li>

<li><a href=”#db_change_password”>Password</a></li>

</ul>

 

Hope It is Useful to You.

Odoo Project Management Training Video

Odoo项目管理 (project management) 是组织活动、计划任务、跟踪问题,记录人力资源成本的组织形式。项目可以分为内部项目(研发活动,加快销售进度),私有项目或者客户参与的项目。 内部用户以项目成员的方式参与到项目中,分享项目的活动讯息。

项目活动预备以下阶段,用户也可按合式的运作需要来修改:

odoo-project-mgt

致於详细的项目管理运作,请參考以下英文版的的 Youtube 下载电影教材: