>>> YieldNull
  • /blog
  • /archives
  • /github
  • /about

Entries from 2015 all / by tag / 2016»

  • Git Push-to-Deploy Configuration

    2015-12-17 17:27:47 / Git Linux /5325 hits

    本文介绍通过搭建git服务器实现提交代码到master分支时完成网站应用代码的部署。

    创建SSH-Public-Key

    本地计算机需要创建SSH公钥与服务器通信。使用ssh-keygen生产公钥以及私钥。

    $ ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/finalize/.ssh/id_rsa): demo 
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in demo.
    Your public key has been saved in demo.pub.
    The key fingerprint is:
    6d:07:2c:56:48:aa:0d:08:ad:c1:db:ce:0f:bf:4e:6b finalize@junjie
    The key's randomart image is:
    +--[ RSA 2048]----+
    |o.     ....      |
    |.o..   ..o       |
    | o+ . . o o      |
    |.. . + . o .     |
    |  o . . S o .    |
    |   +     . .     |
    |    +.           |
    |    .E.          |
    |    o+.          |
    +-----------------+
    

    然后在ssh的配置文件中加入demo.pub的配置

    $ vi ~/.ssh/config
    $ chmod 600 ~/.ssh/config
    

    Read more...


  • CMM语法分析

    2015-11-24 21:16:11 / CMM Parser /5984 hits

    语法分析其实就是按照事先定义好的语法,对词法分析器返回的Token与语法元素进行匹配,若是发现不匹配则报错。本程序采用递归下降语法分析器进行分析。

    那么该如何与预定义的语法进行匹配呢?这就要用到FIRST集合与FOLLOW集合了。其实也并没有辣么理论化,只需要根据当前读取到的Token判断应该进入哪个处理函数就行了。比如读到while就知道要进入while的处理函数;读到if就知道要处理if了。

    进入处理函数之后,我们定义一个expect(Token)函数来期待接下来的Token。传入期待的Token,要是与接下来读取到的Token匹配,就继续往下分析,要是不匹配,就抛出异常,停止分析。

    Read more...


  • 备份QQ空间说说

    2015-11-17 23:24:50 / Python /5497 hits

    先将Cookie及用户写入config.json中,格式如下

    {
        "shuoshuo":"<shuoshuo_cookie>",
        "friends":"<friends_cookie>",
        "user":"<your_qq_number>",
        "host_user":"<the_owner_qq>"
    }
    

    然后

    python shuoshuo.py config.json
    

    示例

    Read more...


  • About this site

    2015-11-13 16:38:27 / Blog /13117 hits

    Email

    [email protected]

    Github

    https://github.com/YieldNull/

    Gists

    https://gist.github.com/YieldNull

    Read more...


  • Decoding Lab: Understanding a Secret Message

    2015-11-08 23:29:19 / CS /5635 hits

    遇到一个有趣的C语言习题,题目很好地考察了数据在内存中的存储方式以及函数调用时的stack管理。题目如下:

    Read more...


  • Auto Login in WHU Dormitory Network On Raspberry Pi

    2015-10-27 00:00:00 / RaspberryPi /5144 hits

    按照之前写的Build A Website With Python and Nginx一文中的方法,在树莓派中搞了一个website,通过ssh反向隧道的方法,将校园网内网中的树莓派与公网中的一台VPS建立ssh连接,并建立反向隧道。将公网80端口映射到树莓派的某端口,从而可以直接从外网访问内网中的树莓派。地址为raspi.hejunjie.net,23:30-6:30由于断电会无法访问。

    Read more...


  • « Previous
  • Next 2 / 4 »

About this site © YieldNull,