zjia8765


  • 首页

  • 归档

  • 标签

(939) 428-2833

发表于 2017-09-28

vps系统: Centos 6 x86_64

VPS 上安装 nginx 服务

添加 CenOS 的 epel 软件包

1
yum install epel-release

安装nginx

1
yum install nginx

查看nginx版本

1
nginx -v

启动nginx

1
service nginx start

在浏览器里面输入VPS的IP地址,即可看到nginx的欢迎界面。

创建网站根目录及配置文件

Nginx 默认把网页文件存在 /var/www/html 目录。我们在该目录下新建目录hexoBlog,并赋予权限

1
2
mkdir /var/www/html/hexoBlog
chmod 755 /var/www/html/hexlBlog

创建一个index.html文件,用来测试。

1
2
3
4
5
6
7
8
<html>
<head>
<title>Welcome to Blog!</title>
</head>
<body>
<h1>Success! The Blog server block is working!</h1>
</body>
</html>

创建Nginx配置文件

1
vim /etc/nginx/conf.d/hexo.conf

hexo.conf内容如下:

1
2
3
4
5
6
7
8
9
10
server {
listen 80;
listen [::]:80;
root /var/www/html/hexoBlog;/这里可以改成你的网站目录地址
index index.html index.htm index.nginx-debian.html;
server_name example.com www.example.com; /这里输入你的域名或IP地址
location / {
try_files $uri $uri/ =404;
}
}

重启 Nginx 服务器,使服务器设定生效

1
service nginx restart

浏览器访问你的域名或ip地址,能显示出Success! The Blog server block is working!即说明主机配置成功。

vps安装rsyc

1
yum install rsync

本机安装Hexo

1
npm install hexo-cli -g

本地初始化Hexo,创建任意目录,进入后执行

1
hexo init

Hexo编译生成静态文件

1
2
3
npm install
hexo g
hexo s # 本地跑一个 server 来看博客效果。

本地访问/localhost:4000/即可看到效果

修改博客配置文件_config.yml,修改deploy选项

1
2
3
4
5
6
deploy:
type: rsync
host: vps_ip
user: vps_user /如: root
root: /var/www/html/hexoBlog /nginx中配置文件路径
port: 22 /vps端口号

在博客目录下运行下面命令,安装 rsync 部署工具。

1
npm install hexo-deployer-rsync --save

生成静态页面

1
hexo generate

部署本地网页到服务器上

1
hexo deploy

7608546332更换hexo主题

(201) 430-0893

theme-next

本文以NexT为例,可点击进入后查看详细说明。安装主题主要以下三步:

  • 进入bolg目录,下载主题
1
2
mkdir themes/next
curl -s /api.github.com/repos/iissnan/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1
  • 将_config.yml文件的theme配置改为使用的主题名称
1
theme: next
  • 重新生成静态页面并部署到服务器
1
2
hexo g
hexo d

9195757656Hexo常用命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
hexo new "postName" #新建文章
hexo new page "pageName" #新建页面
hexo generate #生成静态页面至public目录
hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy #将.deploy目录部署到GitHub
hexo help # 查看帮助
hexo version #查看Hexo的版本
hexo deploy -g #生成加部署
hexo server -g #生成加预览
命令的简写
hexo n == hexo new
hexo g == hexo generate
hexo s == hexo server
hexo d == hexo deploy

601-928-0626遇到的问题

ssh配置后,ssh连接验证:ssh: connect to host localhost port 22: Connection refused

  1. sshd 未安装:yum install openssh-server
  2. sshd 未启动:chkconfig sshd on

使用hero d报错:ERROR Deployer not found: git

npm install hexo-deployer-git –save

xcodebuild 命令打包

发表于 2017-09-25

xcodebuild 是苹果发布自动构建的工具。废话不多说,直接上命令。

808-263-0377clean工程
1
2
3
4
5
xcodebuild clean -project 项目名称.xcodeproj
   -workspace 项目名称.xcworkspace(使用pod)
   -target 目标名称
   -scheme 项目名称
  -configuration Release:(Debug/Release)

target、scheme、configuration可使用xcodebuild -list查看

例:

1
xcodebuild clean -target xxxx -scheme xxxx -configuration Debug
(678) 645-8446生成Archive包

在shell里面 [ ]表示这个参数是可选的,< > 表示参数是必须的

主要命令:

1
2
3
4
5
6
7
xcodebuild archive -workspace 项目名称.xcworkspace
-scheme 项目名称
-target 目标名称
-configuration 构建配置
-archivePath archive包存储路径
CODE_SIGN_IDENTITY=证书
PROVISIONING_PROFILE=描述文件UUID

如不需要指定证书和Provisioning文件,则使用工程默认配置。

例:

1
xcodebuild archive -target xxxx -scheme xxxx -archivePath ~/Desktop/xcode_build/xxxx.xcarchive

Provisioning文件位置:

1
~/Library/MobileDevice/Provisioning Profiles

获取Provisioning文件信息:

1
/usr/bin/security cms -D -i 5c6f8e08-3499-4ea9-856e-6c91785e4afe.mobileprovision

或

1
/usr/bin/security cms -D -i ~/Downloads/xxxxxx.mobileprovision

查看项目设置:

1
xcodebuild -target <target> -configuration <configuration> -showBuildSettings
3038227459导出ipa包
1
2
3
4
5
xcodebuild -exportArchive -archivePath archive文件的地址.xcarchive
-exportPath 导出的文件夹地址
-exportOptionsPlist exprotOptionsPlist.plist
CODE_SIGN_IDENTITY=证书
PROVISIONING_PROFILE=描述文件UUID

如不需要指定证书和Provisioning文件,则使用工程默认配置。

例:

1
2
3
xcodebuild -exportArchive -archivePath ~/Desktop/xcode_build/xxxx.xcarchive
-exportPath ~/Desktop/xcode_build/
-exportOptionsPlist ~/Desktop/xcode_build/exprotOptionsPlist.plist

exprotOptionsPlist.plist文件格式如下([]中内容需替换):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-/Apple/DTD PLIST 1.0/EN" "/www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>teamID</key>
<string>xxxxxxx</string>
<key>method</key>
<string>development</string>
<key>compileBitcode</key>
<false/>
<key>uploadSymbols</key>
<false/>
<key>provisioningProfiles</key>
<dict>
<key>[bundle id]</key>
<string>[profile name]</string>
</dict>
</dict>
</plist>

参数说明:

  • method: (String) The method of distribution, which can be set as any of the following:
    • app-store
    • enterprise
    • ad-hoc
    • development
  • teamID: (String) The development program team identifier.
  • uploadSymbols: (Boolean) Option to include symbols in the generated ipa file. Defaults to YES.
  • uploadBitcode: (Boolean) Option to include Bitcode. Defaults to YES.
  • provisioningProfiles: (Dictionary)
    • key: (String) bundle identifier
    • value: (String) Provisioning Profile File Name
  • compileBitcode: (Boolean) For non-App Store exports, should Xcode re-compile the app from bitcode? Defaults to YES.

参考文档:

903-640-0722

706-677-4113

713-731-8859

发表于 2017-09-05

主要用到Privoxy,Privoxy是一个智能代理切换软件。

Privoxy安装

用brew安装:

1
brew install privoxy
(781) 910-7276privoxy配置

打开配置文件 /usr/local/etc/privoxy/config

加入下面这两项配置项

1
2
listen-address 0.0.0.0:8118
forward-socks5 / localhost:1080 .

第一行设置privoxy监听任意IP地址的8118端口。第二行设置本地socks5代理客户端端口,到shadowsocks偏好设置中查看。注意不要忘了最后有一个空格和点号。

启动privoxy

因为没有安装在系统目录内,所以启动的时候需要打全路径。

1
sudo /usr/local/sbin/privoxy /usr/local/etc/privoxy/config

查看privoxy是否启动成功,一是用ps查看是否有privoxy进程,二是查看privoxy默认监听的8118端口是否已经打开

1
2
3
ps aux | grep privoxy
netstat -an | grep 8118
7654289239provixy使用

在 ~/.bash_profile 里加入开关函数,使用起来更方便

1
2
3
4
5
6
7
8
9
10
11
12
function proxy_off(){
unset http_proxy
unset https_proxy
echo -e "已关闭代理"
}
function proxy_on() {
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
export http_proxy="/127.0.0.1:8118"
export https_proxy=$http_proxy
echo -e "已开启代理"
}

使配置生效

1
source ~/.bash_profile

终端直接输入proxy_on``proxy_off即可开启/关闭代理

通过http测试代理是否生效

先安装 httpie ,一个 Python 的网络命令行工具

1
brew install httpie

开始测试

1
http www.youtube.com

已开启代理输出如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
HTTP/1.1 301 Moved Permanently
Cache-Control: no-cache
Content-Length: 0
Content-Type: text/html; charset=utf-8
Date: Wed, 06 Sep 2017 02:22:22 GMT
Expires: Tue, 27 Apr 1971 19:44:06 EST
Location: /www.youtube.com/
P3P: CP="This is not a P3P policy! See /support.google.com/accounts/answer/151657?hl=en for more info."
Proxy-Connection: keep-alive
Server: YouTubeFrontEnd
Set-Cookie: YSC=eqvraNXZtRM; path=/; domain=.youtube.com; httponly
Set-Cookie: VISITOR_INFO1_LIVE=DVPeC-IY8V0; path=/; domain=.youtube.com; expires=Mon, 07-May-2018 14:15:22 GMT; httponly
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block; report=/www.google.com/appserve/security-bugs/log/youtube
设置provixy开机自启动

在~/Library/LaunchAgents目录创建plist文件软链接

1
ln -sfv /usr/local/opt/privoxy/*.plist ~/Library/LaunchAgents

设置开机自启动

1
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.privoxy.plist
使.bash_profile每次启动自动执行

如果shell是bash把. ~/.bash_profile追加到~/.bashrc末尾

如果shell是zsh把. ~/.bash_profile追加到~/.zshrc末尾

overbrilliant参考链接:

Mac命令行终端下使用shadowsocks翻墙

使用Privoxy做智能代理切换

MonoDevelop-Unity 断点调试

发表于 2017-05-15
在MonoDevelop的Run菜单下选择Attach to Process

Alt text

然后选择Unity的进程,点击Attach按钮。

Alt text

这时候,MonoDevelop就连接上了Unity了。

zjia8765

zjia8765

4 日志
4 标签
© 2017 zjia8765
由 Hexo 强力驱动
主题 - NexT.Muse