??xml version="1.0" encoding="utf-8" standalone="yes"?>波多野结衣一区二区,久久青青视频,国产一区二区三区免费视频http://www.aygfsteel.com/ideame/静而思之zh-cnTue, 17 Jun 2025 04:10:27 GMTTue, 17 Jun 2025 04:10:27 GMT60Docker Registry 安装和运?/title><link>http://www.aygfsteel.com/ideame/archive/2018/08/03/433314.html</link><dc:creator>ideame</dc:creator><author>ideame</author><pubDate>Fri, 03 Aug 2018 03:49:00 GMT</pubDate><guid>http://www.aygfsteel.com/ideame/archive/2018/08/03/433314.html</guid><wfw:comment>http://www.aygfsteel.com/ideame/comments/433314.html</wfw:comment><comments>http://www.aygfsteel.com/ideame/archive/2018/08/03/433314.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ideame/comments/commentRss/433314.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ideame/services/trackbacks/433314.html</trackback:ping><description><![CDATA[<h2 id="toc_0">使用场景</h2> <ul> <li>内部|络Q无法访?<a >Docker Hub</a></li> <li>控制 image 的存储方式和存储位置</li> <li>控制 image 的部|流E?/li> <li>内部开发流E需要集成控?image 的部|和存储</li> </ul> <p>应用逻辑C意图:</p> <p><img src="http://www.aygfsteel.com/images/blogjava_net/ideame/15332784526885.png" alt="" style="width:396px;"/>K?/p> <h2 id="toc_1">安装 Registry 服务</h2> <h3 id="toc_2">概要</h3> <p>Docker Registry ?docker hub 的名U是 <a >registry</a>。v1 版本的源码地址 <em>github.com/docker/docker-registry</em> 已经废弃Qv2 版本源码地址?<a >github.com/docker/<strong>distribution</strong></a>Q对应的 API ?<a >Docker Registry HTTP API V2</a>?/p> <p>以下安装没有使用 HTTPS 方式Q启?HTTPS 相关的证书配|参考这个文档:</p> <ul> <li><a >Docker Registry U有 Docker ?/a></li> </ul> <p>官方文档参考:</p> <ul> <li><a >Docker Hub 上的 registry 镜像介绍文档</a></li> <li><a >Docker 官方 Registry 部v文档</a></li> <li>Docker 相关命o行介l? <ul> <li><a >docker build</a></li> <li><a >docker tag</a></li> <li><a >docker push</a></li> </ul></li> </ul> <h3 id="toc_3">最安装Q启动)</h3> <pre><code>docker run -d -p 5000:5000 --name registry registry:2 </code></pre> <p>以上命o未用用户名密码d{略?/p> <h3 id="toc_4">启用d密码</h3> <h4 id="toc_5">生成密码</h4> <p>d密码可以通过 host 的文件传入,以下命o调用容器?<code>htpasswd</code> 命o生成密码文gQ?/p> <pre><code class="language-bash">mkdir auth docker run --entrypoint htpasswd registry:2 \ -Bbn <USER_NAME> <PASSWORD> > auth/auth.htpasswd </code></pre> <h4 id="toc_6">启用密码</h4> <p>通过 –volume 参数传入密码文gQ?/p> <pre><code class="language-bash">docker run -d -p 5000:5000 --restart=always --name registry \ --volume `PWD`/auth:/auth \ --env "REGISTRY_AUTH=htpasswd" \ --env "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \ --env REGISTRY_AUTH_HTPASSWD_PATH=/auth/auth.htpasswd \ registry:2 </code></pre> <h3 id="toc_7">修改镜像存储</h3> <p>默认镜像数据存储?Docker Volume 中,可以通过 bind mount q行修改Q参C息参?<a >Volume文档</a>。下面的例子本机目?<code>PWD</code>/images l定到容器的 /var/lib/registry</p> <pre><code>docker run -d -p 5000:5000 \ --name auth-registry \ -v `PWD`/images:/var/lib/registry \ -e SQLALCHEMY_INDEX_DATABASE=sqlite:////opt/docker-image/docker-registry.db \ -e STORAGE_PATH=/opt/docker-image \ --restart=always \ docker.onestch.com:5000/admin/registry:0.1 </code></pre> <p>默认的存储引擎ؓ本地文gpȝQ可以修Ҏ件的存储引擎?Amazon S3 bucket、Google Cloud Platform 或其他引擎,可以通过配置 config.yml 的方式修改存储配|,更多信息参?<a >Docker Registry 存储配置文档</a>?/p> <h3 id="toc_8">停止服务</h3> <p>停止 registry 容器q清理运行数?/p> <pre><code>docker stop registry && \ docker rm -v registry </code></pre> <h3 id="toc_9">验证</h3> <p>查看容器信息</p> <pre><code>docker ps --no-trunc </code></pre> <p>查看全部配置信息或部分信?/p> <pre><code>docker inspect <CONTAINER_ID> docker inspect <CONTAINER_ID> | grep -C3 -e "Volumes\":" docker inspect <CONTAINER_ID> | grep -C2 Binds docker inspect -f '{{ .Mounts }}' <CONTAINER_ID> </code></pre> <p>查看映射的详l信?/p> <pre><code>docker volume inspect 4496b0a257b966052ef8d0743014a4f63fc9924251c8de0df0e9c70fde4c45e6 </code></pre> <h2 id="toc_10">发布镜像</h2> <h3 id="toc_11">d服务</h3> <p>如果安装Q启动)?registry 服务需要登录访问时Q执行:</p> <pre><code>docker login <REGISTRY_HOST>:<REGISTRY_PORT> </code></pre> <p>输入安装时设定的用户名密码?/p> <h3 id="toc_12">目标地址</h3> <p>使用 docker tag 讑֮镜像的目标地址Q镜像的目标地址包括三部?/p> <pre><code><HOST_NAME>[:<HOST_PORT>]/<IMAGE_NAME>:<IMAGE_VERSION> </code></pre> <ul> <li><p>HOST_NAME : HOST_PORT </p> <p>目标 registry 服务地址Q缺省时使用官方 docker hub 的地址 registry-1.docker.ioQ且不允许包含下划线</p></li> <li><p>IMAGE_NAME 发布目标镜像名称</p></li> <li><p>IMAGE_VERSION 发布目标镜像版本</p></li> </ul> <p>例如Q?code>repo.company.com:3456/myapp:0.1</code></p> <h3 id="toc_13">发布镜像</h3> <p>发布的镜像文件可以从 docker hub ?Pull 或者本C?Dockerfile build 获得</p> <p><strong>Pull</strong></p> <pre><code>docker pull registry </code></pre> <p><strong>Build</strong></p> <pre><code>docker build -t docker.onestch.com:5000/admin/registry:0.1 . </code></pre> <p>首先需要对镜像 tag 讑֮目标仓库Q如?build 的时候已l设|了目标地址Q可以不用进?tag 操作</p> <pre><code>docker tag registry:latest docker.onestch.com:5000/admin/registry:0.1 </code></pre> <p>然后 Push</p> <pre><code>docker push docker.onestch.com:5000/admin/registry:0.1 </code></pre> <h3 id="toc_14">验证</h3> <p>重新从私有仓库中获取镜像</p> <pre><code>docker pull localhost:5000/admin/registry:0.1 0.1: Pulling from admin/registry Digest: sha256:d738e358b6910d3a53c9c7ff7bbb5eac490ab7a9b12ffb4c1c27f2c53aae9275 Status: Image is up to date for localhost:5000/admin/registry:0.1 </code></pre> <h2 id="toc_15">安装 Registry UI</h2> <p>选择 registry uiQ可选的?<a >atcol/docker-registry-ui</a>?a >hyper/docker-registry-web</a>?a >konradkleine/docker-registry-frontend</a>{?/p> <h3 id="toc_16">安装q行</h3> <p>针对 hyper/docker-registry-webQ?BASIC 认证Q未使用 HTTPS的情?/p> <pre><code>docker run -it -p 8080:8080 \ --rm \ --name registry-web \ --link auth-registry \ -e REGISTRY_URL=http://auth-registry:5000/v2 \ -e REGISTRY_AUTH_ENABLED=false \ -e REGISTRY_BASIC_AUTH=YWRtaW46MTIzNDU2 \ -e REGISTRY_NAME=docker.onestch.com:5000 hyper/docker-registry-web </code></pre> <p>命o?<code>auth-registry</code> 是自定的 registry 镜像?/p> <blockquote> <p>使用 HTTPS 旉要传?/config/auth.key 文gQ或自定?config.xml 配置Q例如:<br/> docker run -it -p 8080:8080 –name registry-web \<br/> –link auth-registry \<br/> -v $(pwd)/config.yml:/conf/config.yml:ro \<br/> hyper/docker-registry-web</p> </blockquote> <h3 id="toc_17">理界面</h3> <p>建立?registry 服务后,?registry 的管理界面在本机的访问地址?a href="http://localhost:8080%EF%BC%8C%E4%B8%80%E8%88%AC">http://localhost:8080Q一?/a> ui 服务会和 registry 服务同样q行在私有网l,所以我们可以发?registry ui ?registry 服务器再q行?/p> <pre><code>docker tag docker.io/hyper/docker-registry-web docker.onestch.com:5000/admin/docker-registry-web docker push docker.onestch.com:5000/admin/docker-registry-web </code></pre> <p>查看 UI 界面如下?/p> <p><img src="http://www.aygfsteel.com/images/blogjava_net/ideame/15332851482630.jpg" alt="" style="width:783px;"/>K?/p> <img src ="http://www.aygfsteel.com/ideame/aggbug/433314.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ideame/" target="_blank">ideame</a> 2018-08-03 11:49 <a href="http://www.aygfsteel.com/ideame/archive/2018/08/03/433314.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Zookeeper Cli 常用命ohttp://www.aygfsteel.com/ideame/archive/2016/10/10/431878.htmlideameideameMon, 10 Oct 2016 09:54:00 GMThttp://www.aygfsteel.com/ideame/archive/2016/10/10/431878.htmlhttp://www.aygfsteel.com/ideame/comments/431878.htmlhttp://www.aygfsteel.com/ideame/archive/2016/10/10/431878.html#Feedback0http://www.aygfsteel.com/ideame/comments/commentRss/431878.htmlhttp://www.aygfsteel.com/ideame/services/trackbacks/431878.html服务理
  • 启动ZK服务: zkServer.sh start
  • 查看ZK状? zkServer.sh status
  • 停止ZK服务: zkServer.sh stop
  • 重启ZK服务: zkServer.sh restart

l端操作

使用 zkCli 可以单的?ZooKeeper q行讉KQ数据创建,数据修改{操? q接命o行如下:

zkCli.sh -server 127.0.0.1:2181

命o行工具常用操作:

  • 昄根目录下文g

    ls /              //查看当前节点数据
    ls2 /             //查看当前节点数据q能看到更新ơ数{数?
  • 创徏文g, q设|初始内容:

    create /config "test" //创徏一个新的节点ƈ讄兌?create /config “?    //创徏一个新的空节点
    
  • 获取文g内容

    get /brokers      //获取节点内容
    
  • 修改文g内容

    set /zk "zkbak"   //?zk 所兌的字W串q行讄
    
  • 删除文g

    delete /brokers  //删除节点
    rmr    /brokers  //删除节点及子节点
    

四字命o

ZooKeeper 支持某些特定的四字命令字母与其的交互Q用来获取服务的当前状态及相关信息。在客户端可以通过 telnet ?nc ?ZooKeeper 提交相应的命令。命令行如下Q?/p>

echo conf | nc 132.37.3.26 26181

ZooKeeper 常用四字命oQ?/p>

  • conf

    输出相关服务配置的详l信?/p>

  • cons

    列出所有连接到服务器的客户端的完全的连?/ 会话的详l信息。包括“接?/ 发送”的包数量、会?id 、操作gq、最后的操作执行{等信息

  • dump

    列出未经处理的会话和临时节点?/p>

  • envi

    输出关于服务环境的详l信息(区别?conf 命oQ?/p>

  • reqs

    列出未经处理的请?/p>

  • ruok

    试服务是否处于正确状态。如果确实如此,那么服务q回?imok ”,否则不做M相应

  • stat

    输出关于性能和连接的客户端的列表?/p>

  • wchs

    列出服务?watch 的详l信?/p>

  • wchc

    通过 session 列出服务?watch 的详l信息,它的输出是一个与 watch 相关的会话的列表

  • wchp

    通过路径列出服务?watch 的详l信息。它输出一个与 session 相关的\?/p>



ideame 2016-10-10 17:54 发表评论
]]>
JMH(Java Micro Benchmark) ?/title><link>http://www.aygfsteel.com/ideame/archive/2016/08/01/431411.html</link><dc:creator>ideame</dc:creator><author>ideame</author><pubDate>Mon, 01 Aug 2016 09:12:00 GMT</pubDate><guid>http://www.aygfsteel.com/ideame/archive/2016/08/01/431411.html</guid><wfw:comment>http://www.aygfsteel.com/ideame/comments/431411.html</wfw:comment><comments>http://www.aygfsteel.com/ideame/archive/2016/08/01/431411.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ideame/comments/commentRss/431411.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ideame/services/trackbacks/431411.html</trackback:ping><description><![CDATA[     摘要: JMH介本文由 ImportNew - hejiani 译?java-performance。JMH是新的microbenchmarkQ微基准试Q框Ӟ2013q首ơ发布)。与其他众多框架相比它的特色优势在于Q它是由Oracle实现JIT的相同h员开发的。特别是我想提一下Aleksey Shipilev和他优秀的博客文章。JMH可能与最新的Oracle JRE同步Q其l果可信度很高。JMH...  <a href='http://www.aygfsteel.com/ideame/archive/2016/08/01/431411.html'>阅读全文</a><img src ="http://www.aygfsteel.com/ideame/aggbug/431411.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ideame/" target="_blank">ideame</a> 2016-08-01 17:12 <a href="http://www.aygfsteel.com/ideame/archive/2016/08/01/431411.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何?SVN 源码库{换ؓ Mercurialhttp://www.aygfsteel.com/ideame/archive/2014/02/28/410445.htmlideameideameFri, 28 Feb 2014 03:25:00 GMThttp://www.aygfsteel.com/ideame/archive/2014/02/28/410445.htmlhttp://www.aygfsteel.com/ideame/comments/410445.htmlhttp://www.aygfsteel.com/ideame/archive/2014/02/28/410445.html#Feedback0http://www.aygfsteel.com/ideame/comments/commentRss/410445.htmlhttp://www.aygfsteel.com/ideame/services/trackbacks/410445.html如何?SVN 源码库{换ؓ Mercurial [1]

首先得安?Subversion 库函?/p>

				    wget http://mirrors.hust.edu.cn/apache/subversion/subversion-1.8.8.tar.gz

    tar xzf subversion-1.8.8.tar.bz2 

    cd subversion-1.8.8

    subversion-1.8.8 aliang$ ./autogen.sh 
        buildcheck: checking installation...
        buildcheck: autoconf not found.
                    You need autoconf version 2.59 or newer installed.

    brew install autoconf
        ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/autoconf-2.69.mavericks.bottle.tar.gz
        #################################################### 100.0%
        ==> Pouring autoconf-2.69.mavericks.bottle.tar.gz
        🍺 /usr/local/Cellar/autoconf/2.69: 69 files, 2.0M

    ./autogen.sh 
        buildcheck: checking installation...
        buildcheck: autoconf version 2.69 (ok)
        buildcheck: autoheader version 2.69 (ok)
        buildcheck: libtool not found.
        You need libtool version 1.4 or newer installed

    brew install libtool
        Warning: A newer Command Line Tools release is available
        Update them from Software Update in the App Store.
        ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libtool-2.4.2.mavericks.bottle.2.tar.gz
        ##################################################### 100.0%
        ==> Pouring libtool-2.4.2.mavericks.bottle.2.tar.gz
        ==> Caveats
        In order to prevent conflicts with Apple''s own libtool we have prepended a "g"
        so, you have instead: glibtool and glibtoolize.
        ==> Summary
        🍺  /usr/local/Cellar/libtool/2.4.2: 66 files, 2.2M

    ./autogen.sh 
        buildcheck: checking installation...
        buildcheck: autoconf version 2.69 (ok)
        buildcheck: autoheader version 2.69 (ok)
        buildcheck: libtool version 2.4.2 (ok)
        Copying libtool helper: /usr/local/share/aclocal/libtool.m4
        Copying libtool helper: /usr/local/share/aclocal/ltoptions.m4
        Copying libtool helper: /usr/local/share/aclocal/ltsugar.m4
        Copying libtool helper: /usr/local/share/aclocal/ltversion.m4
        Copying libtool helper: /usr/local/share/aclocal/lt~obsolete.m4
        Creating build-outputs.mk...
        Creating svn_private_config.h.in...
        Creating configure...

        You can run ./configure now.

        Running autogen.sh implies you are a maintainer.  You may prefer
        to run configure in one of the following ways:

        ./configure --enable-maintainer-mode
        ./configure --disable-shared
        ./configure --enable-maintainer-mode --disable-shared
        ./configure --disable-optimize --enable-debug
        ./configure CUSERFLAGS='--flags-for-C' CXXUSERFLAGS='--flags-for-C++'

        Note:  If you wish to run a Subversion HTTP server, you will need
        Apache 2.x.  See the INSTALL file for details.

    brew install swig
        ==> Downloading http://downloads.sourceforge.net/project/swig/swig/swig-2.0.11/swig-2.0.11.tar.gz
        ######################################################################## 100.0%
        ==> ./configure --prefix=/usr/local/Cellar/swig/2.0.11
        ==> make
        ==> make install
        🍺  /usr/local/Cellar/swig/2.0.11: 597 files, 6.2M, built in 10.1 minutes 

    ./configure --with-swig=/usr/local/bin/swig
        configure: Configuring Subversion 1.8.8
        ... ...
        ==================================================================
        WARNING: You have chosen to compile Subversion with a different
                 compiler than the one used to compile Apache.

            Current compiler:  gcc
           Apache's compiler:  /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc

        This could cause some problems.
        ==================================================================
        ... ...

    make swig-py
    make install
    make check-swig-py        
    sudo make install-swig-py

    sudo cp -r /usr/local/lib/svn-python/ /Library/Python/2.7/site-packages/

		

执行转换命o

				    mkdir hgpath

    cd hgpath

    hg init

    hg convert -s svn -d hg ${local_path} ./hgpath

		

注意Q这里{换的 SVN 目录只能是仓库目录而不是工作目?/p>



ideame 2014-02-28 11:25 发表评论
]]>
ditaahttp://www.aygfsteel.com/ideame/archive/2013/11/03/405942.htmlideameideameSun, 03 Nov 2013 07:21:00 GMThttp://www.aygfsteel.com/ideame/archive/2013/11/03/405942.htmlhttp://www.aygfsteel.com/ideame/comments/405942.htmlhttp://www.aygfsteel.com/ideame/archive/2013/11/03/405942.html#Feedback0http://www.aygfsteel.com/ideame/comments/commentRss/405942.htmlhttp://www.aygfsteel.com/ideame/services/trackbacks/405942.html 

ditaa is a small command-line utility written in Java, that can
convert diagrams drawn using ascii art ('drawings' that contain
characters that resemble lines like | / - ), into proper
bitmap graphics. This is best illustrated by the following
example -- which also illustrates the benefits of using ditaa in
comparison to other methods :)

    +--------+   +-------+    +-------+
    |        | --+ ditaa +--> |       |
    |  Text  |   +-------+    |diagram|
    |Document|   |!magic!|    |       |
    |     wmqeeuq|   |       |    |       |
    +---+----+   +-------+    +-------+
        :                         ^
        |       Lots of work      |
        +-------------------------+
After conversion using ditaa, the above
file becomes:
round 		corner demo

ditaa interprets ascci art as a series of open and closed
shapes, but it also uses special markup syntax to increase the
possibilities of shapes and symbols that can be rendered.

ditaa is open source and free software (free as in free
speech), since it is released under the GPL license.

BUT WHY? Does this thing have any real use?

There are several reasons why I did this:

  1. Simply for hack value. I wanted to know if/how it could be
    done and how easily.
  2. Aesthetic reasons and legacy formats: there are
    several old FAQs with ascii diagrams lying out there. At this
    time and age ascii diagrams make my eyes hurt due to their
    ugliness. ditaa can be used to convert them to something
    nicer. Although ditaa would not be able to convert all of them
    (due to differences in drawing 'style' in each case), it could
    prove useful in the effort of modernising some of those
    documents without too much effort. I also know a lot of people
    that can make an ascii diagram easily, but when it gets to using
    a diagram program, they don't do very well. Maybe this utility
    could help them make good-looking diagrams easily/quickly.
  3. Embedding diagrams to text-only formats: There is a
    number of formats that are text-based (html, docbook, LaTeX,
    programming language comments), but when rendered by other
    software (browsers, interpreters, the javadoc tool etc), they
    can contain images as part of their content. If ditaa was
    intergrated with those tools (and I'm planning to do the javadoc
    bit myself soon), then you would have readable/editable diagrams
    within the text format itself, something that would make things
    much easier. ditaa syntax can currently be embedded to HTML.
  4. Reusability of "code": Suppose you make a diagram in
    ascii art and you render it with version 0.6b of ditaa. You keep
    the ascii diagram, and then version 0.8 comes out, which
    features some new cool effects. You re-render your old diagram
    with the new version of ditaa, and it looks better, with zero
    effort! In that sense ditaa is a diagram markup language, with
    very loose syntax.


Download

(((-intro-))) (((-download-))) (((-usage and syntax-))) (((-friends-))) (((-contact-)))

The latest version of ditaa can be obtained from its SourceForge project page.

You can checkout the code using:

   svn co https://ditaa.svn.sourceforge.net/svnroot/ditaa ditaa

You can also browse the code online.


Usage and syntax

(((-intro-))) (((-download-))) (((-usage and syntax-))) (((-friends-))) (((-contact-)))

Command line

You need the latest Java runtimes (JRE) to use ditaa. The best
anti-aliasing can be achieved using Java 1.5 or higher.

To start from the command line, type (where XXX is the version number):

java -jar ditaaXXX.jar

You will be presented with the command-line options help:

 -A,--no-antialias          Turns anti-aliasing off.
 -d,--debug                 Renders the debug grid over the resulting
                            image.
 -E,--no-separation         Prevents the separation of common edges of
                            shapes. You can see the difference below:
+---------+
| cBLU    |
|         |
|    +----+
|    |cPNK|
|    |    |
+----+----+
			
Before processingCommon edge
separation (default)
No separation
(with the -E option)
 -e,--encoding <ENCODING>   The encoding of the input file.
 -h,--html                  In this case the input is an HTML file. The
                            contents of the <pre class="textdiagram"> tags
                            are rendered as diagrams and saved in the
                            images directory and a new HTML file is
                            produced with the appropriate <img> tags.
                            See the HTML section.
    --help                  Prints usage help.
 -o,--overwrite             If the filename of the destination image
                            already exists, an alternative name is chosen.
                            If the overwrite option is selected, the image
                            file is instead overwriten.
 -r,--round-corners         Causes all corners to be rendered as round
                            corners.
 -s,--scale <SCALE>         A natural number that determines the size of
                            the rendered image. The units are fractions of
                            the default size (2.5 renders 1.5 times bigger
                            than the default).
 -S,--no-shadows            Turns off the drop-shadow effect.
 -t,--tabs <TABS>           Tabs are normally interpreted as 8 spaces but
                            it is possible to change that using this
                            option. It is not advisable to use tabs in
                            your diagrams.
 -v,--verbose               Makes ditaa more verbose.

Syntax

Round corners

If you use / and \ to connect corners, they are rendered as
round corners:

/--+
|  |
+--/
		  
round corner demo
Before processingRendered

Color

Color codes can be used to add color to the diagrams. The
syntax of color codes is

cXXX

where XXX is a hex number. The first digit of the number
represents the red compoment of the color, the second digit
represents green and the third blue (good ol' RGB). See below for
an example of use of color codes:

/----\ /----\
|c33F| |cC02|
|    | |    |
\----/ \----/

/----\ /----\
|c1FF| |c1AB|
|    | |    |
\----/ \----/
		  
color demo
Before processingRendered

This can become a bit tedious after a while, so there are (only
some for now) human readable color codes provided:

Color codes
/-------------+-------------\
|cRED RED     |cBLU BLU     |
+-------------+-------------+
|cGRE GRE     |cPNK PNK     |
+-------------+-------------+
|cBLK BLK     |cYEL YEL     |
\-------------+-------------/
color code
Before processingRendered

As you can see above, if a colored shape contains any text, the
color of the text is adjusted according to the underlying
color. If the undelying color is dark, the text color is changed
to white (from the default black).

Note that color codes only apply if they are within closed
shapes, and they have no effect anywhere outside.

Tags

ditaa recognises some tags that change the way a rectangular
shape is rendered. All tags are between { and }. See the table below:

NameOriginalRenderedComment
Document
+-----+
|wmqeeuq  |
|     |
|     |
+-----+
		  
Symbol representing a document.
Storage
+-----+
|{s}  |
|     |
|     |
+-----+
		  
Symbol representing a form of storage,
like a
database or a hard disk.
Input/Output
+-----+
|{io} |
|     |
|     |
+-----+
		  
Symbol representing input/output.

Dashed lines

Any lines that contain either at least one = (for horizontal
lines) or at least one : (for vertical lines) are rendered as
dashed lines. Only one of those characters can make a whole line
dashed, so this feature "spreads". The rationale behind that is
that you only have to change one character to switch from normal
to dashed (and vice versa), rather than redrawing the whole
line/shape. Special symbols (like document or storage symbols) can
also be dashed. See below:

----+  /----\  +----+
    :  |    |  :    |
    |  |    |  |{s} |
    v  \-=--+  +----+
Before processingRendered

Point markers

If * is encountered on a line (but not at the end of the
line), it is rendered as a special marker, called the point
marker (this feature is still experimental). See below:

*----*
|    |      /--*
*    *      |
|    |  -*--+
*----*
point marker demo
Before processingRendered

Text handling

(This section is still being written)

If the pattern ' o XXXXX' is encountered, where XXXXX is any
text, the 'o' is interpreted and rendered as a bullet point. Note
that there must be a space before the 'o' as well as after it. See
below:

/-----------------\
| Things to do    |
| cGRE            |
| o Cut the grass |
| o Buy jam       |
| o Fix car       |
| o Make website  |
\-----------------/
bullet point demo
Before processingRendered

 

HTML mode

When ditaa is run using the --html option, the input
is an HTML file. The contents of the <pre
class="textdiagram">
tags are rendered as diagrams and
saved in the images directory and a new HTML file is
produced with the appropriate <img> tags.

If the id parameter is present in the
<pre> tag, its value is used as the filename of the
rendered png. Otherwise a filename of the form
ditaa_diagram_X.png is used, where X is a
number. Similarly, if there is no output filename specified, the
converted html file is named in the form of
xxxx_processed.html, where xxxx is the filename of the
original file.

In this mode, files that exist are not generated again, they
are just skipped. You can force overwrite of the files using the
--overwrite option.



ideame 2013-11-03 15:21 发表评论
]]>
How to install ZXing in Xcode 4http://www.aygfsteel.com/ideame/archive/2013/11/03/405939.htmlideameideameSun, 03 Nov 2013 06:45:00 GMThttp://www.aygfsteel.com/ideame/archive/2013/11/03/405939.htmlhttp://www.aygfsteel.com/ideame/comments/405939.htmlhttp://www.aygfsteel.com/ideame/archive/2013/11/03/405939.html#Feedback0http://www.aygfsteel.com/ideame/comments/commentRss/405939.htmlhttp://www.aygfsteel.com/ideame/services/trackbacks/405939.html
  • April 2011
  • Posted By Yannick Loriot
  • 81 Comments
  • After an upgrading to Xcode 4, I have been having trouble compiling my own ZXing iOS project. That’s why I decided to explain you how to install easily ZXing with Xcode 4.

    First of all (for those who don’t know), ZXing is an open-source library to read the 1D/2D barcodes. This library is available on many platforms such as the iOS, Android, Blackberry, ect. You can find it here: http://code.google.com/p/zxing/.

    Before to start, be sure that you have the latest version of ZXing on your computer. If you don’t, you must download it via a SVN client here: http://zxing.googlecode.com/svn/trunk/.

     

    To use ZXing into your project in Xcode 4 follow these steps:

    1. Firstly go to the ?strong>zxing/iphone/ZXingWidget/?and drag and drop the ZXingWidget.xcodeproj file onto your Xcode “Project navigator?sidebar. If a dialog appears uncheck the “Copy items?and verify that the “Reference Type?is “Relative to Project?before clicking “Add?

    2. Now we are going to add ZXingWidget as a dependency of your project to allow Xcode to compile it whenever you compile the main project:
      1. First select your project file in the “Project navigator?
      2. Then select the corresponding target.
      3. After choose the ?strong>Build Phases?tab and expand the ?strong>Target Dependencies?section.
      4. Click the ??(add) button to display a dialog.
      5. To finish add the ?strong>ZXingWidget?target as shown above.

    3. Now we are going to link the ZXingWidget static library (libZXingWidget.a) to the project:
      1. Firstly choose the ?strong>Build Phases?tab and expand the ?strong>Link Binary With Libraries?section.
      2. Then click the ??(add) button to display a dialog.
      3. To finish add the ?strong>libZXingWidget.a?which is located in the “Workspace?category as shown above.
      4. By the way add the following iOS frameworks too:
        • AddressBook
        • AddressBookUI
        • AudioToolbox
        • AVFoundation
        • CoreMedia
        • CoreVideo
        • libiconv.dylib

    4. Then you must configure the header search path of your project to allow Xcode to find the ZXingWidget headers. To do that:
      1. In the “Project navigator?select the main project (not the target).
      2. Go to the ?strong>Build Settings?tab and search the ?strong>Header Search Paths?
      3. Double-click on it and add:
        • The full path of the ?strong>zxing/iphone/ZXingWidget/Classes?directory. Check the ?strong>recursive path?
        • The full path of the ?strong>zxing/cpp/core/src/?directory. Uncheck the ?strong>recursive path?

    Now you just have to import the ?strong>ZXingWidgetController.h?and the ?strong>QRCodeReader.h?to your project and use them.
    Attention: Make sure that the files in which you are using the ZXing headers have the .mm extension because they use c++ library files.

    Voilà! Now all should be ok. I hope it’ll help you!

    1 Star 2 Stars 3 Stars 4 Stars 5 Stars (33 votes, average: 4.55 out of 5)

    http://yannickloriot.com/2011/04/how-to-install-zxing-in-xcode-4/



    ideame 2013-11-03 14:45 发表评论
    ]]>
    MySQL-python 安装的问?/title><link>http://www.aygfsteel.com/ideame/archive/2013/07/22/401813.html</link><dc:creator>ideame</dc:creator><author>ideame</author><pubDate>Sun, 21 Jul 2013 17:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/ideame/archive/2013/07/22/401813.html</guid><wfw:comment>http://www.aygfsteel.com/ideame/comments/401813.html</wfw:comment><comments>http://www.aygfsteel.com/ideame/archive/2013/07/22/401813.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/ideame/comments/commentRss/401813.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/ideame/services/trackbacks/401813.html</trackback:ping><description><![CDATA[在Mac下安装MySQL-python一直有问题Q不是用pipq是用setup.pyQ都是返回如下错误:<br /><br /><div style="background-color: rgb(0, 0, 0);"><font color="#F5F5DC" face="Courier New"><br />sudo python setup.py install<br /><br />running install<br />running bdist_egg<br />running egg_info<br />writing MySQL_python.egg-info/PKG-INFO<br />writing top-level names to MySQL_python.egg-info/top_level.txt<br />writing dependency_links to MySQL_python.egg-info/dependency_links.txt<br />reading manifest file 'MySQL_python.egg-info/SOURCES.txt'<br />reading manifest template 'MANIFEST.in'<br />writing manifest file 'MySQL_python.egg-info/SOURCES.txt'<br />installing library code to build/bdist.macosx-10.7-x86_64/egg<br />running install_lib<br />running build_py<br />copying MySQLdb/release.py -> build/lib.macosx-10.7-x86_64-2.7/MySQLdb<br />running build_ext<br />building '_mysql' extension<br />/ A p p l i c a t i o n s / X c o d e . a p p / C o n t e n t s / D e v e l o p e r / T o o l c h a i n s / X c o d e D e f a u l t . x c t o o l c h a i n / u s r / b i n / c l a n g   - f n o - s t r i c t - a l i a s i n g   - f n o - c o m m o n   - d y n a m i c   - I / u s r / l o c a l / i n c l u d e   - I / u s r / l o c a l / o p t / s q l i t e / i n c l u d e   - i s y s r o o t   / A p p l i c a t i o n s / X c o d e . a p p / C o n t e n t s / D e v e l o p e r / P l a t f o r m s / M a c O S X . p l a t f o r m / D e v e l o p e r / S D K s / M a c O S X 1 0 . 7 . s d k   - I / A p p l i c a t i o n s / X c o d e . a p p / C o n t e n t s / D e v e l o p e r / P l a t f o r m s / M a c O S X . p l a t f o r m / D e v e l o p e r / S D K s / M a c O S X 1 0 . 7 . s d k / S y s t e m / L i b r a r y / F r a m e w o r k s / T k . f r a m e w o r k / V e r s i o n s / 8 . 5 / H e a d e r s   - D N D E B U G   - g   - f w r a p v   - O 3   - W a l l   - W s t r i c t - p r o t o t y p e s   -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/local/Cellar/mysql/5.6.10/include -I/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.7-x86_64-2.7/_mysql.o -Os -g -fno-strict-aliasing<br />unable to execute /: Permission denied<br />error: command '/' failed with exit status 1</font></div><br /><br />l过GoogleQ发现原来是XCode没有安装Command line Tools的问题,参考:http://sourceforge.net/p/mysql-python/bugs/333/<br /><img src ="http://www.aygfsteel.com/ideame/aggbug/401813.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/ideame/" target="_blank">ideame</a> 2013-07-22 01:59 <a href="http://www.aygfsteel.com/ideame/archive/2013/07/22/401813.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>软gU负载均衡器(LVS/HAProxy/Nginx)的特点和Ҏhttp://www.aygfsteel.com/ideame/archive/2013/07/16/401636.htmlideameideameTue, 16 Jul 2013 07:52:00 GMThttp://www.aygfsteel.com/ideame/archive/2013/07/16/401636.htmlhttp://www.aygfsteel.com/ideame/comments/401636.htmlhttp://www.aygfsteel.com/ideame/archive/2013/07/16/401636.html#Feedback0http://www.aygfsteel.com/ideame/comments/commentRss/401636.htmlhttp://www.aygfsteel.com/ideame/services/trackbacks/401636.htmlLVS的特ҎQ?/h2>
    1. 抗负载能力强、是工作在网l?层之上仅作分发之用,没有量的生,q个特点也决定了它在负蝲均衡软g里的性能最强的Q?/li>
    2. 配置性比较低Q这是一个缺点也是一个优点,因ؓ没有可太多配|的东西Q所以ƈ不需要太多接触,大大减少了h为出错的几率Q?/li>
    3. 工作E_Q自w有完整的双机热备方案,如LVS+Keepalived和LVS+HeartbeatQ不q我们在目实施中用得最多的q是LVS/DR+KeepalivedQ?/li>
    4. 无流量,保证了均衡器IO的性能不会收到大流量的影响Q?/li>
    5. 应用范围比较q,可以Ҏ有应用做负蝲均衡Q?/li>
    6. 软g本n不支持正则处理,不能做动静分,q个比较遗憾了Q其实现在许多网站在q方面都有较强的需求,q个是Nginx/HAProxy+Keepalived的优势所在?/li>
    7. 如果是网站应用比较庞大的话,实施LVS/DR+Keepalivedh比较复杂了Q特别后面有Windows Server应用的机器的话,如果实施及配|还有维护过E就比较复杂了,相对而言QNginx/HAProxy+Keepalivedq单多了?/li>

    Nginx的特ҎQ?/h2>
    1. 工作在网l的7层之上,可以针对http应用做一些分的{略Q比如针对域名、目录结构,它的正则规则比HAProxy更ؓ强大和灵z,q也是许多朋友喜Ƣ它的原因之一Q?/li>
    2. Nginx对网l的依赖非常,理论上能ping通就pq行负蝲功能Q这个也是它的优势所在;
    3. Nginx安装和配|比较简单,试h比较方便Q?/li>
    4. 也可以承担高的负载压力且E_Q一般能支撑过几万ơ的q发量;
    5. Nginx可以通过端口到服务器内部的故障Q比如根据服务器处理|页q回的状态码、超时等{,q且会把q回错误的请求重新提交到另一个节点,不过其中~点是不支持url来检;
    6. N1.ginx仅能支持http和EmailQ这样就在适用范围上面很多,q个它的弱势Q?/li>
    7. N1.ginx不仅仅是一ƾ优U的负载均衡器/反向代理软gQ它同时也是功能强大的Web应用服务器。LNMP现在也是非常行的web架构Q大有和以前最行的LAMP架构分庭抗争之势Q在高流量的环境中也有很好的效果?/li>
    8. Nginx现在作ؓWeb反向加速缓存越来越成熟了,很多朋友都已在生产环境下投入生了,而且反映效果不错Q速度比传l的Squid服务器更快,有兴的朋友可以考虑用其作ؓ反向代理加速器?/li>

    HAProxy的特ҎQ?/h2>
    1. HAProxy是支持虚拟主机的Q以前有朋友说这个不支持虚拟LQ我q里Ҏ更正一下?/li>
    2. 能够补充Nginx的一些缺Ҏ如Session的保持,Cookie的引导等工作
    3. 支持url后端的服务器出问题的检会有很好的帮助?/li>
    4. 它跟LVS一P本n仅仅只是一ƾ负载均衡YӞ单纯从效率上来讲HAProxy更会比Nginx有更的负载均衡速度Q在q发处理上也是优于Nginx的?/li>
    5. HAProxy可以对Mysql读进行负载均衡,对后端的MySQL节点q行和负蝲均衡Q不q在后端的MySQL slaves数量过10台时性能不如LVSQ所以我向大家推荐LVS+Keepalived?/li>

    HAProxy的算法现在也来多了,具体有如?U:

    1. roundrobinQ表C简单的轮询Q这个不多说Q这个是负蝲均衡基本都具备的Q?/li>
    2. static-rrQ表C根据权重,xQ?/li>
    3. leastconnQ表C最连接者先处理Q徏议关注;
    4. sourceQ表C根据请求源IPQ这个跟Nginx的IP_hash机制cMQ我们用其作决session问题的一U方法,xQ?/li>
    5. riQ表C根据请求的URIQ?/li>
    6. rlparamQ表C根据请求的URl参数'balance urlparam' requires an URL parameter nameQ?/li>
    7. hdr(name)Q表C根据HTTPh头来锁定每一ơHTTPhQ?/li>
    8. rdp-cookie(name)Q表C根据据cookie(name)来锁定ƈ哈希每一ơTCPh?/li>


    ideame 2013-07-16 15:52 发表评论
    ]]>Git on Windowshttp://www.aygfsteel.com/ideame/archive/2011/11/12/363571.htmlideameideameSat, 12 Nov 2011 03:27:00 GMThttp://www.aygfsteel.com/ideame/archive/2011/11/12/363571.htmlhttp://www.aygfsteel.com/ideame/comments/363571.htmlhttp://www.aygfsteel.com/ideame/archive/2011/11/12/363571.html#Feedback0http://www.aygfsteel.com/ideame/comments/commentRss/363571.htmlhttp://www.aygfsteel.com/ideame/services/trackbacks/363571.html下蝲文g http://msysgit.googlecode.com/files/PortableGit-1.7.7.1-preview20111027.7z

    解压?D:\JavaSoft\git-1.7.7.1

    增加pȝ环境路径QD:\JavaSoft\git-1.7.7.1\bin;D:\JavaSoft\git-1.7.7.1\cmd;

    讄pȝ属性:
    git config --global user.name "your.name" git config --global user.email git.mail.name@gmail.com

    创徏密钥Q?/p>

    mkdir /.ssh

    ssh-keygen -f D:\JavaSoft\git-1.7.7.1\.ssh\id_rsa -t rsa -C 'git.mail.name@gmail.com' -t rsa

    复制 id_rsa.pub 的内容,到github.com增加公钥Q然后粘贴保存?/p>

    试Qgit -v -T git@github.com

    Hi your.name! You've successfully authenticated, but GitHub does not provide shell access.



    ideame 2011-11-12 11:27 发表评论
    ]]>
    yum 上v交通大?Repositoryhttp://www.aygfsteel.com/ideame/archive/2011/05/18/350516.htmlideameideameWed, 18 May 2011 09:36:00 GMThttp://www.aygfsteel.com/ideame/archive/2011/05/18/350516.htmlhttp://www.aygfsteel.com/ideame/comments/350516.htmlhttp://www.aygfsteel.com/ideame/archive/2011/05/18/350516.html#Feedback0http://www.aygfsteel.com/ideame/comments/commentRss/350516.htmlhttp://www.aygfsteel.com/ideame/services/trackbacks/350516.html
    [base]
    name
    =CentOS-5 - Base
    repo
    =os
    baseurl
    =http://ftp.sjtu.edu.cn/centos/5/os/$basearch/
    gpgcheck
    =1
    gpgkey
    =http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5

    #released updates
    [update]
    name
    =CentOS-5 - Updates
    baseurl
    =http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/
    gpgcheck
    =1
    gpgkey
    =http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5

    #packages used/produced in the build but not released
    [addons]
    name
    =CentOS-5 - Addons
    baseurl
    =http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/
    gpgcheck
    =1
    gpgkey
    =http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5

    #additional packages that may be useful
    [extras]
    name
    =CentOS-5 - Extras
    baseurl
    =http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/
    gpgcheck
    =1
    gpgkey
    =http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5

    #additional packages that extend functionality of existing packages
    [centosplus]
    name
    =CentOS-5 - Plus
    baseurl
    =http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/
    gpgcheck
    =1
    enabled
    =0
    gpgkey
    =http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5

    #contrib - packages by Centos Users
    [contrib]
    name
    =CentOS-5 - Contrib
    baseurl
    =http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/
    gpgcheck
    =1
    enabled
    =0
    gpgkey
    =http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5



    ideame 2011-05-18 17:36 发表评论
    ]]>
    վ֩ģ壺 | Ϻӿ| ɽ| | ʯɽ| ؼ| ʦ| ǰ| | | | | | ˹| ϲ| | մ| | Ȫ| | ̩| ɽ| ˳| | | ξ| ˱| | | | ԰| | | | ȫ| | | ƽ| | | ï|