Git 多远端问题

2016年03月14日  in tool using tags git

如果需要在同一套代码中控制多个远程版本 查看当前的远端 $ git remote -v 增加远端 $ git remote add 远端名 远端git地址 这样推送和拉取的之后只要在后面加上远端名和分支名就可以 拉取远端 $ git pull inter master 推送远端 $ git push inter master
Read more

这个博客是怎么搭建起来的

2016年03月13日  in tool using tags hugo

大概原理 首先hugo,用来生成博客的静态文件 hugo是用go语言写的,效率比较高 把生成好的静态页面通过github pages 上传到github上 就做好了 安装 可以直接下载可执行文件 linux windows都有 官网地址 https://gohugo.io/ 创建新的站点 $ hugo new site blog 会生成一个文件夹,里面的config.toml是配置文件 这是一个TOML文件,全称是Tom’s Obvious, Minimal Language,这是它的作者GitHub联合创始人Tom Preston-Werner 觉得YAML不够优雅,捣鼓出来的一个新格式。如果你不喜欢这种格式,你可以将config.toml替换为YAML格式的config.yaml,或者json格式的config.json。hugo都支持。 创建新页面 cd 到 blog下 $ hugo new about.md 这样会把文件生成在contents目录下 也可以放在文件夹下 $ hugo new post/first.md md就是markdown格式,很方便 默认是没有模板的,可以去下载模板 地址是 这里 找好模板之后 创建themes文件夹 $ mkdir themes $ git clone https://github.com/spf13/模板名.git 启动本地服务器 $ hugo server --theme=base16 --buildDrafts --watch watch 是监控文章更新 buildDrafts是生成content里面的页面 生成静态站点 在blog目录下 $ hugo --theme=base16 --buildDrafts 生成好以后把public里面的文件上传到github上就可以了
Read more

Git的常用么命令

2016年02月01日  in tool using tags git

生成密钥 ssh-keygen 检测是否成功 $ ssh -T git@github.com 本地配置用户名和邮箱 $ git config --global user.name 'ed' $ git config --global user.email 'erickdotphp@gmail.com' 初始化 $ git init 添加README $ git add README.md 自动提交所有变化文件 $ git commit -a -m "comment" 不自动提交的话需要$ git add 文件名或者-A 忽略某个文件更新的命令 $ git update-index --assume-unchanged ####忽略权限修改 $ git config core.filemode false
Read more

Centos7 上 安装 Composer

2016年02月01日  in env using tags Composer

安装前请确保 环境中有PHP 可以用php -v查看 下载 $ curl -sS https://getcomposer.org/installer| php -- --install-dir=/home 移动到可执行目录 $ mv composer.phar /usr/local/bin/composer 配置环境变量 $ export PATH=$PATH:/usr/local/bin
Read more

Centos7 上 安装和配置 Sublime Text3

2016年02月01日  in tool using tags sublime

下载最新的包 http://www.sublimetext.com/3 下载tarball $ tar jxvf sublime_text_3_build_3083_x64.tar.bz2 -C /opt 移动到系统目录 $ mv sublime_text_3 /opt/ 创建连接 $ ln -s /opt/sublime_text_3/sublime_text /usr/bin/sublime 移动到系统目录下 $ cp /opt/sublime_text_3/sublime_text.desktop /usr/share/applications 修改配置文件 $ cd /usr/share/applications $ vim sublime_text.desktop [Desktop Entry] Version=1.0 Type=Application Name=Sublime Text GenericName=Text Editor Comment=Sophisticated text editor for code, markup and prose Exec=/opt/sublime_text_3/sublime_text %F Terminal=false MimeType=text/plain; Icon=/opt/sublime_text_3/Icon/48x48/sublime-text.png Categories=TextEditor;Development; StartupNotify=true Actions=Window;Document; [Desktop Action Window] Name=New Window Exec=/opt/sublime_text_3/sublime_text -n OnlyShowIn=Unity; [Desktop Action Document] Name=New File Exec=/opt/sublime_text_3/sublime_text
Read more

Centos7 上 安装 mariadb

2016年02月01日  in env using tags Mariadb , Mysql

全部删除MySQL/MariaDB MySQL 已经不再包含在 CentOS 7 的源中,而改用了 MariaDB; 使用rpm -qa | grep mariadb搜索 MariaDB 现有的包: 如果存在,使用rpm -e –nodeps mariadb-*全部删除: 使用rpm -qa | grep mariadb搜索 MariaDB 现有的包: 如果存在,使用yum remove mysql mysql-server mysql-libs compat-mysql51全部删除; 添加MariaDB的yum源 创建 /etc/yum.repos.d/MariaDB.repo: 添加yum源,该文件中添加如图所示内容: # MariaDB 10.1 CentOS repository list - created 2015-11-19 02:26 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 安装 MariaDB $ yum install MariaDB-server MariaDB-client 启动、配置MariaDB $ service mysql start $
Read more

Lumen 环境搭建

2016年02月01日  in env using tags Lumen

安装composer $ curl -sS https://getcomposer.org/installer | php -- --install-dir=lumen 全局使用 $ mv composer.phar /usr/local/bin/composer 配置PATH $ export PATH=~/.composer/vendor/bin:$PATH 安装lumen $ composer global require "laravel/lumen-installer" 设置nginx server { listen 80; server_name www.lumen.loc; set $root_path '/home/wwwroot/lumen/public'; root $root_path; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ (index|get|static|report|404|503)\.php$ { try_files $uri =404; fastcgi_pass fastcgi_backend; fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; fastcgi_param PHP_VALUE "memory_limit=256M \n max_execution_time=600"; fastcgi_read_timeout 600s; fastcgi_connect_timeout
Read more

Centos7 上 安装 ZendServer

2016年02月01日  in env using tags Zend Server , nginx , PHP

获取官方包 $ wget http://downloads.zend.com/zendserver/8.5.1/ZendServer-8.5.1-RepositoryInstaller-linux.tar.gz 关闭防火墙 $ vim /etc/selinux/config SELINUX=disabled $ setenforce 0 安装ZendServer ./install_zs.sh 5.6 nginx 远程访问不到zend server 需要关闭iptable $ service iptables status $ service iptables stop 配置文件的路径如下 nginx vim /etc/nginx/nginx.conf php /usr/local/zend/etc/php.ini fpm /usr/local/zend/etc/php-fpm.conf 虚拟机 /usr/local/zend/etc/sites.d 都配置好以后可以访问主机地址了 http://localhost:10081/ZendServer/ 另外破解方法 vim /usr/local/zend/gui/module/Configuration/src/Configuration/License/License.php 所有判断改成return true; FAQ Nginx 报错 no port in upstream “fastcgi_backend”,因为没有配置fastcgi 在/etc/nginx/nginx.conf在 access_log /var/log/nginx/access.log main; 后面加入 fastcgi_read_timeout 300; upstream fastcgi_backend { server unix:/usr/local/zend/tmp/php-fpm.sock; } 其中fastcgi_read_timeout 300;是为了防止ngxin 504超时错误
Read more

Linux常用命令

2016年02月01日  in env using tags Linux

Linux 文件传输 从服务器上下载文件 scp username@servername:/path/filename /var/www/local_dir(本地目录) 例如scp root@192.168.0.101:/var/www/test.txt 把192.168.0.101上的/var/www/test. txt 的文件下载到/var/www/local_dir(本地目录) 上传本地文件到服务器 scp /path/filename username@servername:/path 例如scp /var/www/test.php root@192.168.0.101:/var/www/ 把本机/var/www/目录下的test.php文件上传到192.168.0.101这台服务器上的/var/www/目录中 从服务器下载整个目录 scp -r username@servername:/var/www/remote_dir/(远程目录) /var/www/local_dir(本地目录) 例如:scp -r root@192.168.0.101:/var/www/test /var/www/ 上传目录到服务器 scp -r local_dir username@servername:remote_dir 例如:scp -r test root@192.168.0.101:/var/www/ 把当前目录下的test目录上传到服务器的/var/www/ 目录 通过rz 安装 $ yum install lrzsz rz上传 $ rz -y -y 覆盖 sz下载 $ sz filename
Read more