<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[St0p's Blog]]></title>
  <link href="http://www.st0p.org/atom.xml" rel="self"/>
  <link href="http://www.st0p.org/"/>
  <updated>2021-03-01T15:34:56+08:00</updated>
  <id>http://www.st0p.org/</id>
  <author>
    <name><![CDATA[]]></name>
    
  </author>
  <generator uri="http://www.mweb.im/">MWeb</generator>
  
  <entry>
    <title type="html"><![CDATA[Centos 7 安装XFCE桌面]]></title>
    <link href="http://www.st0p.org/16139694249140.html"/>
    <updated>2021-02-22T12:50:24+08:00</updated>
    <id>http://www.st0p.org/16139694249140.html</id>
    <content type="html"><![CDATA[
<h2 id="toc_0">安装epel库</h2>

<pre><code class="language-text">sudo yum -y install epel-release
sudo yum update
</code></pre>

<h2 id="toc_1">安装XFCE桌面</h2>

<pre><code class="language-text">sudo yum -y groupinstall X11
sudo yum --enablerepo=epel -y groups install &quot;Xfce&quot;
</code></pre>

<h2 id="toc_2">开机进入XFCE桌面</h2>

<pre><code class="language-text">systemctl isolate graphical.target
</code></pre>

<h2 id="toc_3">安装中文字体设置系统语言为中文</h2>

<pre><code class="language-text"># 安装字体库
sudo yum -y install fontconfig

# 查看系统中的字体：
fc-list
# 如果没有中文字体则继续往下走

# 安装字体
sudo yum -y install wqy*
sudo yum -y install cjkuni*
sudo yum -y install google-noto-sans-simplified-chinese-fonts
sudo yum -y install cjkuni-ukai-fonts

# 然后刷新字体缓存
fc-cache

# 查看当前语言
echo $LANG

# 如果不是中文则手动设置为中文
# 临时设置：LANG=zh_CN.UTF-8
# 永久设置：
nano /etc/locale.conf
LANG=zh_CN.UTF-8

# 安装输入法
yum install fcitx*
yum install im-chooser
imsettings-switch fcitx
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[centos 安装xrdp远程连接桌面]]></title>
    <link href="http://www.st0p.org/16104236884962.html"/>
    <updated>2021-01-12T11:54:48+08:00</updated>
    <id>http://www.st0p.org/16104236884962.html</id>
    <content type="html"><![CDATA[
<h2 id="toc_0">安装epel库，否则无法安装xrdp</h2>

<pre><code class="language-text">yum install epel-release
</code></pre>

<h2 id="toc_1">安装 xrdp</h2>

<pre><code class="language-text">yum -y install xrdp
</code></pre>

<h2 id="toc_2">安装tigervnc-server</h2>

<pre><code class="language-text">yum -y  install tigervnc tigervnc-server
</code></pre>

<h2 id="toc_3">开启桌面远程连接服务</h2>

<pre><code class="language-text"># 编辑远程桌面配置文件(用户主目录有这个文件远程连接才不会黑屏闪退)
nano ~/.Xclients

#!/bin/bash
XFCE=&quot;$(which xfce4-session 2&gt;/dev/null)&quot;
exec &quot;$XFCE&quot;

chmod +x ~/.Xclients
</code></pre>

<h2 id="toc_4">配置xrdp.ini文件</h2>

<pre><code class="language-text">nano /etc/xrdp/xrdp.ini
# 把max_bpp=32 改成24
</code></pre>

<h2 id="toc_5">设置xrdp服务，开机自动启动</h2>

<pre><code class="language-text">systemctl start xrdp
systemctl enable xrdp
</code></pre>

<h2 id="toc_6">打开防火墙</h2>

<pre><code class="language-text">firewall-cmd  --permanent --zone=public --add-port=3389/tcp
firewall-cmd --reload
</code></pre>

<h2 id="toc_7">查看xrdp是否启动</h2>

<pre><code class="language-text">systemctl status xrdp.service
ss -antup|grep xrdp
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[MAC下BREW安装PHP 5.6]]></title>
    <link href="http://www.st0p.org/16081716581886.html"/>
    <updated>2020-12-17T10:20:58+08:00</updated>
    <id>http://www.st0p.org/16081716581886.html</id>
    <content type="html"><![CDATA[
<h2 id="toc_0">首先tap一下，然后就可以看到PHP 5.6了</h2>

<pre><code class="language-text">brew tap exolnet/homebrew-deprecated
</code></pre>

<h2 id="toc_1">通过search一下可以看到 然后安装</h2>

<pre><code class="language-text">brew search php
brew install php@5.6
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Vim 十六进制模式修改文件]]></title>
    <link href="http://www.st0p.org/15757003033457.html"/>
    <updated>2019-12-07T14:31:43+08:00</updated>
    <id>http://www.st0p.org/15757003033457.html</id>
    <content type="html"><![CDATA[
<h2 id="toc_0">打开文件</h2>

<pre><code class="language-text">vim -b 文件名称
</code></pre>

<h2 id="toc_1">切换至十六进制显示模式 输入命令</h2>

<pre><code class="language-text">%!xxd -g 1
</code></pre>

<h2 id="toc_2">切换至二进制显示模式 输入命令</h2>

<pre><code class="language-text">%!xxd -r
</code></pre>

<h2 id="toc_3">退出保存 输入命令</h2>

<pre><code class="language-text">wq!
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[MAC OSX VPN自动添加静态路由]]></title>
    <link href="http://www.st0p.org/15542696705653.html"/>
    <updated>2019-04-03T13:34:30+08:00</updated>
    <id>http://www.st0p.org/15542696705653.html</id>
    <content type="html"><![CDATA[
<pre><code class="language-text">sudo tee /etc/ppp/ip-up &lt;&lt;-&#39;EOF&#39;
#!/bin/sh
/sbin/route add 10.10.100.0/24 -iface ppp0
EOF

sudo chmod 755 /etc/ppp/ip-up
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Centos 7 安装KDE桌面 VNC SERVER CHROME]]></title>
    <link href="http://www.st0p.org/15420161055935.html"/>
    <updated>2018-11-12T17:48:25+08:00</updated>
    <id>http://www.st0p.org/15420161055935.html</id>
    <content type="html"><![CDATA[
<h2 id="toc_0">安装KDE桌面</h2>

<pre><code class="language-text">yum groupinstall &quot;KDE Plasma Workspaces&quot;
yum install ibus-table-chinese.noarch kde-l10n-Chinese.noarch
yum install ibus-libpinyin
</code></pre>

<h3 id="toc_1">设置启动进入KDE</h3>

<pre><code class="language-text"># 查询默认终端命令 multi-user.target 相当于以前的 level 3，也就是命令行终端；而 graphical.target 相当于以前的 level 5，也就是图形界面
systemctl get-defaul

# 设置默认启动图型界面
systemctl set-default graphical.target
</code></pre>

<h2 id="toc_2">安装VNC</h2>

<pre><code class="language-text">yum install tigervnc
yum install tigervnc-server
</code></pre>

<h3 id="toc_3">配置VNC SERVER</h3>

<pre><code class="language-text"># 配置窗口一
tee /usr/lib/systemd/system/vncserver@:1.service &lt;&lt;-&#39;EOF&#39;
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c &#39;/usr/bin/vncserver -kill %i &gt; /dev/null 2&gt;&amp;1 || :&#39;
ExecStart=/sbin/runuser -l root -c &quot;/usr/bin/vncserver %i&quot;
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c &#39;/usr/bin/vncserver -kill %i &gt; /dev/null 2&gt;&amp;1 || :&#39;
[Install]
WantedBy=multi-user.target
EOF

# 加载配置
systemctl daemon-reload
</code></pre>

<h3 id="toc_4">启用配置文件</h3>

<pre><code class="language-text"># 设置密码
vncpasswd

# 启动服务
systemctl start vncserver@:1.service

# 查看服务状态
systemctl status vncserver@:1.service

# 开机自启动
systemctl enable vncserver@:1.service
</code></pre>

<h4 id="toc_5">如Type=forking报错 上面配置文件改为Type=simple</h4>

<pre><code class="language-text">[Service]
Type=simple
</code></pre>

<h4 id="toc_6">vnc viewer客户端连接黑屏</h4>

<pre><code class="language-text">chmod 777 /root/.vnc/xstartup
</code></pre>

<h4 id="toc_7">加入防火墙</h4>

<pre><code class="language-text"># 开启防火墙
systemctl start firewalld
# 自启动防火墙
systemctl enable firewalld
# 添加窗口一用的5901端口
firewall-cmd --add-port=5901/tcp --permanent
# 重载防火墙
sudo firewall-cmd --reload
</code></pre>

<h2 id="toc_8">安装CHROME</h2>

<p>CentOS/RedHat 7以上安装google-chrome可以完全参考<a href="https://intoli.com/blog/installing-google-chrome-on-centos/">https://intoli.com/blog/installing-google-chrome-on-centos/</a></p>

<pre><code class="language-text"># This installs Chrome on any RHEL/CentOS/Amazon Linux variant.
curl https://intoli.com/install-google-chrome.sh | bash
</code></pre>

<p>安装完成会显示 Successfully installed Google Chrome!</p>

<h3 id="toc_9">检查是否还缺乏依赖</h3>

<pre><code class="language-text">ldd /opt/google/chrome/chrome | grep &quot;not found&quot;
</code></pre>

<p>返回为空，说明CentOS下chrome依赖问题基本解决。</p>

<h3 id="toc_10">不允许ROOT权限启动</h3>

<p>修改/usr/bin/google-chrome文件 最下面</p>

<pre><code class="language-text"># Note: exec -a below is a bashism.
exec -a &quot;$0&quot; &quot;$HERE/chrome&quot;  &quot;$@&quot; 
</code></pre>

<pre><code class="language-text"># Note: exec -a below is a bashism.
exec -a &quot;$0&quot; &quot;$HERE/chrome&quot; &quot;$@&quot; --no-sandbox --user-data-dir
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[批量提取不规则文件中帐号密码不在同一行的数据进行合并]]></title>
    <link href="http://www.st0p.org/15350324030193.html"/>
    <updated>2018-08-23T21:53:23+08:00</updated>
    <id>http://www.st0p.org/15350324030193.html</id>
    <content type="html"><![CDATA[
<pre><code class="language-text">#!/bin/bash
filename=&quot;./input.txt&quot;
num=0
cat $filename | while read line
do
    if [[ `echo $line | grep &#39;帐号&#39;` != &quot;&quot; ]]; then
        user=`echo $line | awk &#39;{print $2}&#39;`
        num=$(expr $num + 1)
    elif [[ `echo $line | grep &#39;密码&#39;` != &quot;&quot; ]]; then
        pass=`echo $line | awk &#39;{print $2}&#39;`
        num=$(expr $num + 1)
    fi

    if [[  $num == 2 ]]; then
        echo &quot;匹配到: $user, $pass&quot;
        echo &quot;$user,$pass&quot; &gt;&gt; ./output.txt
        num=0
    fi
done
</code></pre>

<h2 id="toc_0">例</h2>

<pre><code class="language-text">----------------------------
afdkjakdsjfkja
adsfkdasjfk
网址  http://www.a.com
帐号  userA
密码  passA
afdkjakdsjfkja
adsfkdasjfk
网址  http://www.b.com
帐号  userB
密码  passB
----------------------------
http://www.test.com
网址  http://www.c.com
帐号  userC
密码  passC
http://www.test.com
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[OSX 10.11重置Launchpad icon]]></title>
    <link href="http://www.st0p.org/15317090928564.html"/>
    <updated>2018-07-16T10:44:52+08:00</updated>
    <id>http://www.st0p.org/15317090928564.html</id>
    <content type="html"><![CDATA[
<pre><code class="language-text">defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[安装oh-my-zsh]]></title>
    <link href="http://www.st0p.org/15316333350253.html"/>
    <updated>2018-07-15T13:42:15+08:00</updated>
    <id>http://www.st0p.org/15316333350253.html</id>
    <content type="html"><![CDATA[
<pre><code class="language-text">sh -c &quot;$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)&quot;
</code></pre>

<h2 id="toc_0">自动提示命令</h2>

<pre><code class="language-text">git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

# 开启插件
nano ~/.zshrc
# 修改添加zsh-autosuggestions
plugins=(
  zsh-autosuggestions
  git
)
</code></pre>

<h2 id="toc_1">语法高亮</h2>

<pre><code class="language-text">brew install zsh-syntax-highlighting

echo &quot;source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh&quot; &gt;&gt; ~/.zshrc

source ~/.zshrc
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[MAC下BREW安装NGINX+PHP+MYSQL环境]]></title>
    <link href="http://www.st0p.org/15316208486803.html"/>
    <updated>2018-07-15T10:14:08+08:00</updated>
    <id>http://www.st0p.org/15316208486803.html</id>
    <content type="html"><![CDATA[
<h2 id="toc_0">安装BREW 先安装XCODE</h2>

<pre><code class="language-text">/usr/bin/ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;
xcode-select --install
</code></pre>

<h2 id="toc_1">安装NGINX (因官方库更新不支持插件 使用<a href="https://github.com/denji/homebrew-nginx">https://github.com/denji/homebrew-nginx</a>)</h2>

<pre><code class="language-text">brew tap denji/nginx
brew install nginx-full --with-geoip2-module --with-headers-more-module --with-lua-module --with-redis2-module --with-subs-filter-module
</code></pre>

<h3 id="toc_2">NGINX 移动配置信息保存到目录（~/Documents/nginx） 更改80端口及运行权限</h3>

<pre><code class="language-text"># 转移配置文件
mv /usr/local/etc/nginx/ ~/Documents/WebSite/nginx/
ln -s ~/Documents/WebSite/nginx /usr/local/etc/nginx

# 创建目录
mkdir -p ~/Documents/WebSite/nginx/vhosts/
mkdir -p ~/Documents/WebSite/default/wwwroot/
mkdir -p ~/Documents/WebSite/default/logs/
mkdir -p ~/Documents/WebSite/logs/

# 创建配置文件
tee ~/Documents/WebSite/nginx/nginx.conf  &lt;&lt;-&#39;EOF&#39;
user  nobody;
worker_processes  1;

pid        /Users/用户名/Documents/WebSite/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  &#39;$remote_addr - $remote_user [$time_local] &quot;$request&quot; &#39;
                      &#39;$status $body_bytes_sent &quot;$http_referer&quot; &#39;
                      &#39;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&#39;;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        access_log  /Users/用户名/Documents/WebSite/default/logs/access.log  main;
        error_log  /Users/用户名/Documents/WebSite/default/logs/error.log;

        location / {
            root   /Users/用户名/Documents/WebSite/default/wwwroot/;
            index  index.html index.htm;
        }
    }

    include vhosts/*;
}
EOF

# 更改80端口权限
sudo chown root:wheel /usr/local/opt/nginx-full/bin/nginx
sudo chmod u+s /usr/local/opt/nginx-full/bin/nginx

</code></pre>

<h3 id="toc_3">NGINX开机启动</h3>

<pre><code class="language-text">ln -sfv /usr/local/opt/nginx-full/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx-full.plist
</code></pre>

<h2 id="toc_4">安装MYSQL</h2>

<pre><code class="language-text">brew install mysql@5.7

# 添加环境到/etc/profile
export PATH=&quot;$(brew --prefix mysql@5.7)/bin:$PATH&quot;
srouce /etc/profile
</code></pre>

<h3 id="toc_5">修改配置</h3>

<pre><code class="language-text"># 创建目录
mkdir -p ~/Documents/MySql/
mkdir -p ~/Documents/MySql/data/

# 创建配置文件
tee ~/Documents/MySql/my.cnf  &lt;&lt;-&#39;EOF&#39;
[client]
socket = /Users/用户名/Documents/MySql/mysqld.sock
port = 3306
[mysqld]
socket = /Users/用户名/Documents/MySql/mysqld.sock
port = 3306
datadir = /Users/用户名/Documents/MySql/data
skip-external-locking
bind-address = 0.0.0.0
log_error = /Users/用户名/Documents/MySql/mysql-error.log
slow_query_log = on
slow-query-log-file = /Users/用户名/Documents/MySql/mysql-slow.log
EOF

ln -s ~/Documents/MySql/my.cnf /usr/local/etc/my.cnf
</code></pre>

<h3 id="toc_6">初使化MYSQL</h3>

<pre><code class="language-text">mysqld --initialize
</code></pre>

<h3 id="toc_7">MySQL开机启动</h3>

<pre><code class="language-text">ln -sfv /usr/local/opt/mysql@5.7/*.plist ~/Library/LaunchAgents

# 更改数据目录为/Users/用户名/Documents/MySql/data
nano ~/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist
</code></pre>

<h3 id="toc_8">安装完成之后更改密码</h3>

<pre><code class="language-text"># 查看密码
grep &quot;generated for root@localhost&quot; ~/Documents/MySql/mysql-error.log
# 用密码登陆
mysql -u root -p
</code></pre>

<pre><code class="language-text"># 修改密码
SET PASSWORD = PASSWORD(&#39;密码&#39;);
ALTER USER &#39;root&#39;@&#39;localhost&#39; PASSWORD EXPIRE NEVER;
flush privileges;
quit
</code></pre>

<h2 id="toc_9">更新CURL</h2>

<pre><code class="language-text">brew install curl
brew link curl --force
</code></pre>

<h2 id="toc_10">安装PHP</h2>

<pre><code class="language-text">brew update
brew install php@5.6
</code></pre>

<pre><code class="language-text"># 添加PHP到环境(/etc/profile)
export PATH=&quot;$(brew --prefix php56)/bin:$PATH&quot;
export PATH=&quot;$(brew --prefix php56)/sbin:$PATH&quot;
source /etc/profile
</code></pre>

<pre><code class="language-text">mv /usr/local/etc/php/ ~/Documents/WebSite/php/
ln -s ~/Documents/WebSite/php /usr/local/etc/php

nano ~/Documents/WebSite/php/5.6/php-fpm.conf

#修改内容去掉注释
pid = /Users/用户名/Documents/WebSite/php/php-fpm.pid
</code></pre>

<h3 id="toc_11">PHP-FPM开机启动</h3>

<pre><code class="language-text">ln -sfv /usr/local/opt/php@5.6/*.plist ~/Library/LaunchAgents
# 更改数据目录为/Users/用户名/Documents/WebSite/php/5.6/
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php@5.6.plist
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[MAC下GO 安装环境配置]]></title>
    <link href="http://www.st0p.org/15316173580282.html"/>
    <updated>2018-07-15T09:15:58+08:00</updated>
    <id>http://www.st0p.org/15316173580282.html</id>
    <content type="html"><![CDATA[
<h2 id="toc_0">下载并安装GO安装包</h2>

<p>打开<a href="http://golang.org">http://golang.org</a> 下载对应的二进制安装包</p>

<h2 id="toc_1">配置工作环境</h2>

<pre><code class="language-text">mkdir -p ~/Documents/go

#把以下内容加入/etc/profile 中

export GOROOT=/usr/local/go
export GOPATH=/Users/用户名/Documents/go
export GOBIN=$GOPATH/bin
export PATH=&quot;$PATH:$GOROOT/bin:$GOPATH/bin&quot;

#保存内容并执行以下更新环境信息

srouce /etc/profile
</code></pre>

<h2 id="toc_2">安装常用工具</h2>

<h3 id="toc_3">官方</h3>

<pre><code class="language-text">go get -u golang.org/x/tools/cmd/...
go get -u golang.org/x/tools/cmd/godoc
go get -u github.com/golang/dep/cmd/dep

mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/tools.git
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/crypto.git
git clone https://github.com/golang/net.git
git clone https://github.com/golang/text.git

</code></pre>

<h3 id="toc_4">第三方</h3>

<pre><code class="language-text">go get -u github.com/Masterminds/glide
go install github.com/Masterminds/glide
go get -u github.com/BurntSushi/toml
go get -u gopkg.in/yaml.v2
go get -u github.com/valyala/fasthttp
go get -u github.com/valyala/tcplisten
go get -u github.com/buaazp/fasthttprouter
go get -u github.com/ccpaging/nxlog4go
go get -u github.com/go-xorm/xorm
go get -u github.com/go-sql-driver/mysql
go get -u github.com/golang-plus/uuid
go get -u github.com/json-iterator/go
go get -u github.com/olivere/elastic
go get -u github.com/oschwald/geoip2-golang
go get -u github.com/pkg/errors
go get -u github.com/robfig/cron
go get -u github.com/seefan/gossdb
go get -u github.com/go-redis/redis
go get -u github.com/tinylib/msgp
go get -u github.com/PuerkitoBio/goquery
go get -u github.com/robertkrimen/otto
go get -u github.com/henrylee2cn/surfer
go get github.com/yanyiwu/gojieba
go get -u github.com/huichen/sego
go get -u github.com/gorilla/mux
go get -u github.com/urfave/cli
go get -u gopkg.in/cheggaaa/pb.v2
go get -u github.com/smallnest/goreq
go get -u github.com/EDDYCJY/fake-useragent
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[VsCode 环境配置]]></title>
    <link href="http://www.st0p.org/15301684740354.html"/>
    <updated>2018-06-28T14:47:54+08:00</updated>
    <id>http://www.st0p.org/15301684740354.html</id>
    <content type="html"><![CDATA[
<h2 id="toc_0">GO</h2>

<p>先安装GO插件 Ctrl+P输入ext install Go 然后安装所需插件</p>

<pre><code class="language-text">go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
go get -v -u github.com/peterh/liner
go get -v -u github.com/derekparker/delve/cmd/dlv
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Centos 7 安装Docker]]></title>
    <link href="http://www.st0p.org/15264761866295.html"/>
    <updated>2018-05-16T21:09:46+08:00</updated>
    <id>http://www.st0p.org/15264761866295.html</id>
    <content type="html"><![CDATA[
<pre><code class="language-shell"># 初使化安装环境
yum -y install yum-utils gcc g++ kernel-devel

# 添加yum 仓库并更新
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast


# 安装并以服务方式启动docker
sudo yum -y install docker-ce
sudo systemctl enable docker
sudo systemctl start docker
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Docker Swarm常用命令集合]]></title>
    <link href="http://www.st0p.org/15264756876811.html"/>
    <updated>2018-05-16T21:01:27+08:00</updated>
    <id>http://www.st0p.org/15264756876811.html</id>
    <content type="html"><![CDATA[
<pre><code class="language-shell"># 初使化Swarm 192.168.1.1为对外IP
docker swarm init --listen-addr 192.168.1.1:2377 --advertise-addr 192.168.1.1

# 查看Worker Token
docker swarm join-token worker

# Worker加入集群 替换对应token值
docker swarm join --token \
SWMTKN-1-5eukghd8e9wby5aw8t8y4rdz425euoo8m9qgmgitpxg63ax2ol-94dvz9vrx5oai22jc3vl2eh56 \
192.168.1.1:2377

# 查看Manager Token
docker swarm join-token manager

# Manager加入集群 替换对应token值
docker swarm join --token \
SWMTKN-1-5eukghd8e9wby5aw8t8y4rdz425euoo8m9qgmgitpxg63ax2ol-94dvz9vrx5oai22jc3vl2ehed2 \
192.168.1.1:2377

# 查看集群中的节点 在Manager机器人执行
docker node ls

# 创建虚拟网络
docker network create --driver overlay --subnet 10.0.10.0/24 \
  --opt encrypted test_network
  
# Centos 7 防火墙开放端口
firewall-cmd --add-port=2376/tcp --permanent
firewall-cmd --add-port=2377/tcp --permanent
firewall-cmd --add-port=7946/tcp --permanent
firewall-cmd --add-port=7946/udp --permanent
firewall-cmd --add-port=4789/udp --permanent
sudo firewall-cmd --reload
</code></pre>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[MAC 软件提示已损坏，需要移到废纸篓的解决方法]]></title>
    <link href="http://www.st0p.org/15258762622328.html"/>
    <updated>2018-05-09T22:31:02+08:00</updated>
    <id>http://www.st0p.org/15258762622328.html</id>
    <content type="html"><![CDATA[
<p>移除这个应用的安全隔离属性，操作如下：<br/>
打开终端<code>Terminal</code>，输入以下命令后回车，如需要，请输入密码</p>

<pre><code class="language-shell">xattr -r -d com.apple.quarantine &lt;path&gt;
</code></pre>

<p><code>&lt;path&gt;</code>是你下载的应用程序的路径，一般在<code>/Applications/应用程序名字</code><br/>
新运行下载的应用程序。</p>

]]></content>
  </entry>
  
</feed>
