1.在etc/yum.conf 添加
proxy=http://192.168.1.10:8088/
2.如果代理环境中有证书,回导致源更新失败,可以继续添加
sslverify=false
1.在etc/yum.conf 添加
proxy=http://192.168.1.10:8088/
2.如果代理环境中有证书,回导致源更新失败,可以继续添加
sslverify=false
参考链接
http://www.ronnutter.com/raspberry-pi-ntp-client-setup/
http://www.cnblogs.com/mybook/archive/2012/11/06/2757597.html
一.
Option 1 – sudo raspi-config, select change_timezone
Option 2 – sudo dpkg-reconfigure tzdata, Select the right country/timezone
使用上述方法可以设置时区
二.
pi@raspberrypi:~$ date
Sun Feb 24 14:38:41 CST 2013
使用上述方法查看当前时间
三.
pi@raspberrypi:~$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*192.168.1.20 LOCAL(0) 13 u 8 64 3 0.304 1.632 1.407
使用上述方法查看当前ntp连接状态
四.
/etc/ntp.conf
文件中设置了ntp服务器的地址
# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will
# pick a different set every time it starts up. Please consider joining the
# pool:
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
局域网添加IP地址
五.
windows安装ntp-4.2.8p8-win32-setup.exe https://www.meinbergglobal.com/english/sw/ntp.htm
六.
局域网使用LOCAL时间设置方法如下
七.
Edit NTP Configuration
# restrict default noquery nopeer nomodify notrap
restrict default limited kod nomodify notrap nopeer noquery
# restrict -6 default noquery nopeer nomodify notrap
restrict -6 default limited kod nomodify notrap nopeer noquery
后重启ntp
符:
NTP:ntpq -p参数解释
remote:NTP主机的IP或者是主机名(ntp.conf文件中配置的server和peer主机)
如果有『 * 』代表目前正在作用当中的上层 NTP
如果是『 + 』代表也有连上线,而且可作为下一个提供时间更新的候选者。
refid:参考的上一层 NTP 主机的地址
st:st的值表示的是远程主机的层级(NTP采用分层同步方式,一般第n+1级与第n级时钟源进行同步。NTP最多支持16层同步,即0-15层。多于16层将无法同步。
如果远程主机是当前主机的NTP Server的话,一般情况下本级主机的层级是st+1)。
t:The type of the peer (local, unicast, multicast or broadcast) when the last packet was received
l local (such as a GPS clock)
u unicast (this is the common type) (单播,即NTP client向NTP server发送NTP请求,NTP server回复的模式)
m multicast (多播,可跨子网。)
b broadcast (广播,不可跨子网。NTP server定时向广播地址发送NTP包,NTP client通过广播地址获取NTP包,同步本地时钟)
– netaddr (usually 0) when:自上次时钟同步以来经过了多少秒(当when=poll时,进行一次时钟同步,同时when被清零,从头开始计时。通过when可以知道上一次同步时间
(当前时间- when)和下一次同步时间(当前时间+poll-when))
pool:时钟同步间隔(ntp服务刚启动时,缺省的最小同步间隔是64(minpoll=6)秒,然后依次增加,128, 256, ……, 1024。缺省的最大值是1024(maxpoll=10)秒。
这两个值分别可以通过minpoll和maxpoll参数修改。)
reach:八进制数,表示最近8次时钟同步包接收情况(1表示接收成功,0表示接收失败。每接收一个包左移一位。对于一个运行较长时间的NTP client而言,
这个值应该是377->11,111,111,即最近8次包接收均成功;否则表示有丢包情况发生)
NTP刚启动后Reach变化:
如果最近的一次包接受失败:
delay:表示NTP client从发出NTP请求到接收到NTP服务器回复所经过的时间(毫秒)。
offset:即NTP client的本地时间与NTP服务器时间的差异。也就是NTP client需要调整的时间差异。
disp:表示两次时钟同步之间的offset的差值。
Jitter:Linux 系统时间与 BIOS 硬件时间的差异时间(毫秒)。
使用的工具
1.copSSH Copssh_4.1.0_Installer.zip
2.git Git-1.9.5-preview20141217.exe
服务器端配置
1.安装 Copssh
安装目录 C:\SSH
解压安装,注意如果重新安装,需要先删除系统用户SvcCOPSSH
2.配置 Copssh
配置Copssh,从开始菜单中打开COPSSH Control Panel
去掉密码认证 Allow password authentication
点击keys 生成公钥与私钥文件
3.安装 Git-1.9.5-preview20141217.exe
将git安装目录下的libexec\git-core文件夹下将git.exe, git-receive-pack.exe, git-upload-archive.exe, git-upload-pack.exe复制到C:\SSH\bin
(后期测试可能有找不到XX.DLL的错误,将缺少的DLL也考进去旧可以了)
4.建立仓库
例如C:\SSH\home\daimingzhuang\myapp
建立方法随意
客户端配置(socket5代理环境)
因为时代理环境,所以配置要负责一些
1.在安装 Git-1.9.5-preview20141217.exe
2.添加代理设置
打开 git bash
新建config文件
vi ~/.ssh/config
添加内容
ProxyCommand connect -S 192.168.1.10:8089 %h %p
Host gitproxy
User Administrator
Port 22
Hostname 109.120.57.25
IdentityFile ~/.ssh/id_rsa
PubkeyAuthentication yes
注:可能git/bin里面没有connect.exe 文件 可以到github里找一下,下载考进去就可以了
https://github.com/msysgit/msysgit/raw/master/mingw/bin/connect.exe
3.添加公钥
将客户端里 ~/.ssh/id_rsa文件中的内容,加入到服务器中~/.ssh/authorized_keysz 中
4.连接测试即可
编辑/新建 ~/.vimrc
添加
set autoindent set smartindent set tabstop=4 set shiftwidth=4 set expandtab set softtabstop=4
重新启动后OK!
1.更新
$ sudo apt-get update
$ sudo apt-get upgrade
2.安装开发工具
$ sudo apt-get install build-essential cmake pkg-config
3.安装Image I/O
$ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
4.安装video I/O
$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
$ sudo apt-get install libxvidcore-dev libx264-dev
5.安装GTK
$ sudo apt-get install libgtk2.0-dev
6.安装gfortran 一个新的矩阵运算框架
$ sudo apt-get install libatlas-base-dev gfortran
7.安装python开发框架
$ sudo apt-get install python2.7-dev python3-dev
二。下载opencv
$ cd ~
$ wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.1.0.zip
$ unzip opencv.zip
$ wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.1.0.zip
$ unzip opencv_contrib.zip
三。安装python
1.安装pip
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py
2.安装虚拟环境
$ sudo pip install virtualenv virtualenvwrapper
$ sudo rm -rf ~/.cache/pip
3.配置虚拟环境
# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
$ echo -e “\n# virtualenv and virtualenvwrapper” >> ~/.profile
$ echo “export WORKON_HOME=$HOME/.virtualenvs” >> ~/.profile
$ echo “source /usr/local/bin/virtualenvwrapper.sh” >> ~/.profile
source ~/.profile
4.建立虚拟环境
mkvirtualenv cv -p python2
python2
或
mkvirtualenv cv -p python3
python3
以下操作都在虚拟环境中进行
5安装NumPy
pip install numpy
6.编译安装opencv
$ cd ~/opencv-3.1.0/
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules \
-D BUILD_EXAMPLES=ON ..
$ make -j4
$ sudo make install
$ sudo ldconfig
for Python 2.7
$ cd ~/.virtualenvs/cv/lib/python2.7/site-packages/
$ ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so
for Python 3.4
$ cd /usr/local/lib/python3.4/site-packages/
$ sudo mv cv2.cpython-34m.so cv2.so
$ cd ~/.virtualenvs/cv/lib/python3.4/site-packages/
$ ln -s /usr/local/lib/python3.4/site-packages/cv2.so cv2.so
7.测试
$ source ~/.profile
$ workon cv
$ python
>>> import cv2
>>> cv2.__version__
‘3.1.0’
>>>
8.删除源码,节省空间
$ rm -rf opencv-3.1.0 opencv_contrib-3.1.0
修改/etc/profile或者 /etc/environment
添加如下内容
export http_proxy=”http://<proxyipaddress>:<proxyport>”
export https_proxy=”http://<proxyipaddress>:<proxyport>”
export no_proxy=”localhost,127.0.0.1,192.168.0.0/16″
如果需要时 sudo来运行命令 例如 sudo apt-get update
使用 sudo -E apt-get update
修改源
编辑 /etc/apt/sources.list
修改其中的网址为你需要的网址
具体的镜像网站可以在http://www.raspbian.org/RaspbianMirrors中查找
备份
pi@raspberry: sudo cp /etc/network/interfaces /etc/network/interfaces.sav
修改
pi@raspberry: sudo vi /etc/network/interfaces
iface eth0 inet dhcp -> #iface eth0 inet dhcp
添加
# The loopback interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
#your static IP
address 192.168.1.118
#your gateway IP
gateway 192.168.1.1
netmask 255.255.255.0
#your network address “family”
network 192.168.1.0
broadcast 192.168.1.255
重启网络
pi@raspberry:sudo /etc/init.d/networking restart
或者
pi@raspberry:sudo /etc/init.d/networking reload
添加用户
useradd –g aft –s /sbin/nologin -d /home/pi/aft ftpuser
修改密码
passwd ftpuser
一。安装
sudo apt-get install transmission-daemon
二。修改配置
sudo service transmission-daemon stop
sudo vi /etc/transmission-daemon/settings.json
添加一下代码到文件中
"download-dir": "/mnt/usbel/Torrents/Completed",
"incomplete-dir": "/mnt/usbel/Torrents/Incomplete",
"incomplete-dir-enabled": true,
"rpc-whitelist": "*.*.*.*",
"rpc-whitelist-enabled": false,
设置目录/设置WEB远程连接
三。修改目录权限
sudo usermod -a -G debian-transmission pi
chgrp debian-transmission /mnt/usbel/Torrents/Incomplete
chgrp debian-transmission /mnt/usbel/Torrents/Completed
chmod 770 /mnt/usbel/Torrents/Incomplete
chmod 770 /mnt/usbel/Torrents/Incomplete
四。web远程连接
浏览器输入 http://RASPI.IP.ADDRESS:9091/
默认用户名:密码
transmission:transmission
1.首页安装Webtatic EL6 YUM源
rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
2.停止web服务器
service nginx stop
3.删除当前的 php 安装 php5.4
yum remove php*
yum install php54w
yum install php54w-fpm php54w-mysql php54w-gd php54w-imap php54w-ldap php54w-odbc php54w-pear php54w-xml php54w-xmlrpc php54w-mbstring php54w-mcrypt php54w-bcmath php54w-mhash
4.配置php-fpm
vi /etc/php-fpm.d/www.conf #编辑
user = nginx #修改用户为需要的
group = nginx #修改组为需要的
:wq #保存退出
5.重启web服务器
service php-fpm restart
service nginx start
6.查看php版本
php -v
PHP 5.4.33 (cli) (built: Sep 19 2014 19:58:27)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
官方给出了新的开启wordpress固定链接的方法,也简单的多。这里假设,我在nginx的conf文件夹下创建个wordpress.conf ,将下面的代码粘贴进去:
location / {
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
搞定