最近一直在进行在谷歌云的标准环境(Google App Engine
简称 GAE
)上的 OpenSAML
的相关开发,去年 OpenSAML
发布了V3版本,进行了大量的更新,所以我也希望使用最新的OpenSAML
来进行开发。但是在 GAE
上运行会报一个错误,实际上是两个错误,一个错误轻松解决了,另外一个有点曲折,目前不完美解决。 下面简要介绍下这两个问题:
X509证书从理论到实践之数字签名理论基础
由于最近在开发单点登录SSO
相关系统,所以对证书系统,数字签名以及SAML
协议进行了深入的研究,阅读了大量的官方标准文档。希望通过一些列文章把自己学习的知识进行总结并记录,一方面留作备忘,另一方面也能进一步巩固加深记忆。
Atlassian授权研究备忘录
基于Jackson实现Restful API框架的i18n国际化
Run Docker without sudo on Linux
see the ref: http://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo/477554
Giving non-root access
The docker daemon always runs as the root user, and since Docker version 0.5.2, the docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root, and so, by default, you can access it with sudo.
Starting in version 0.5.3, if you (or your Docker installer) create a Unix group called docker and add users to it, then the docker daemon will make the ownership of the Unix socket read/writable by the docker group when the daemon starts. The docker daemon must always run as the root user, but if you run the docker client as a user in the docker group then you don’t need to add sudo to all the client commands. As of 0.9.0, you can specify that a group other than docker should own the Unix socket with the -G option.
Typescript Index Signature
我们讨论接口中的 index signature。
该特性主要作用是能够让接口包含动态的属性(Properties),比如我们定义一个 person
接口,当然我们之前已经知道一些必要的字段,比如名字性别等等,但是随着时代的变迁,对于person
可能还会有一些其他的字段,比如twitter
,微博等等。我们不可能在设计 person interface
的时候就包含了所有属性,但是我们可以定一个 index signature
, 这样如果我们想加入 twitter
, 那么就可以用 ['twiter']
来添加。
Hexo个人博客完全指南 (2017最新零基础手册)
概述
折腾了不少博客系统,但是发现到现在位置还是一直再用 Evernote
记笔记,偶尔总结一下再转发到博客上,总是觉得发博客的过程比较繁琐,所以一直没有坚持记录。
想一想折腾过 WordPress
免费服务器超慢,需要花钱买服务器,所以逐渐放弃了。之后开始使用 Jekyll
在Github上构建了一组网站,网站免费而且稳定,但是总是想不起来更新(实际上懒..)。前一段时间弄过一个 HubPress,这个的好处是可以在线后台更新,略微方便了很多,但是有一个问题,速度很慢,通过抓包分析,每次提交做了好多事情,所以更新的很少,而且只是点滴内容。最近发现了 Hexo, 虽然这个已经不是什么新东西了,但是使用 Travis CI 自动构建好像也是近一段时间才流行起来,而且随着CI的加强,构建也更加方便简单。下面我就从头开始介绍如何完全免费构建一个Hexo博客,并且支持自动构建。
- 网站结构设计
- 获取
tk
免费域名 - 获取
cloudflare
免费DNS解析及简单的CDN - 本机环境配置 (如果不需要本机调试查看,该步骤可以省略)
- Hexo 获取及主题安装配置 (如果需要可以提供一份基本纯净的配置好的系统)
- Gihub Repository 部署策略
- Travis CI 配置
Google-Cloud-Next观后感
五月四日参加了Google Cloud Next
展会的第二天活动,感觉受益匪浅。首先感受到作为互联网公司的头把交椅,Google
造势的能力相当强劲。会场布置的科技感十足,除了5大会场外,中间还有很多合作伙伴以及Google
的产品体验,比如Google VR
,Google Cloud
的各项产品等等。另外全会场随处是零食饮料,还有人工调制咖啡,不亚于星巴克和Costa。早餐和午餐十分丰富,甜点沙拉水果应有尽有,而且供应充足。
本次参会,我主要参加了如下几个Speak:
- Key Note
- Globally scalable microservices with Google Container Engine and Cloud Load Balancing
- Cloud Spanner 101: Google’s mission-critical relational database
- Using Google’s Identity as a Service (IDaaS) for GCP and G Suite
- Google Infrastructure Security Design
- Google Cloud Storage: best practices for selecting the right storage class, reliability, performance and scalability
Linux使用命令行控制显示器
在使用 Chrome 进行屏幕分享的时候有一个问题一直困扰着我,因为可以能因为屏幕分享的 Javascript 代码的功能问题,如果选择整个桌面分享,那么如果你有两个屏幕就必须分享两个屏幕,从而导致分享的屏幕变小,使用体验非常不好。如果分享单个窗口,又不能随意切换应用。试了很多方法,最后想到一个方案目前来讲是最快捷的:使用命令快速关闭第二块显示器,然后分享结束后再快速打开!
这样就研究了一下xrandr
命令的使用方法。
xrandr 命令
xrandr
如果不加任何参数,将会显示当前所有的显示器设备,并且显示器当前的模式,其中在推荐模式后面有+
,当前模式后面是
。举个例子:
比如我左边是一个 HDMI 的大显示器,右边是一个VGA的小显示器。
1 | *HDMI1 connected primary…, |
其中 HDMI1
和 VGA1
是显示器的标示名称,后面会用到。
关闭指定显示器
关闭 VGA1
的输出。
1 | xrandr --output VGA1 --off |
开启指定显示器
这个指令很直观,让 VGA1
显示器在 HDMI1
显示器右边输出。
1 | xrandr --output VGA1 --auto --right-of HDMI1 |
First Article From StackEdit
Hey! I’m your first Markdown document in StackEditstackedit. Don’t delete me, I’m very helpful! I can be recovered anyway in the Utils tab of the Settings dialog.
Documents
StackEdit stores your documents in your browser, which means all your documents are automatically saved locally and are accessible offline!
Note:
- StackEdit is accessible offline after the application has been loaded for the first time.
- Your local documents are not shared between different browsers or computers.
- Clearing your browser’s data may delete all your local documents! Make sure your documents are synchronized with Google Drive or Dropbox (check out the Synchronization section).
Create a document
The document panel is accessible using the </i> button in the navigation bar. You can create a new document by clicking New document in the document panel.
Switch to another document
All your local documents are listed in the document panel. You can switch from one to another by clicking a document in the list or you can toggle documents using Ctrl+[ and Ctrl+].
Rename a document
You can rename the current document by clicking the document title in the navigation bar.
Delete a document
You can delete the current document by clicking Delete document in the document panel.
Export a document
You can save the current document to a file by clicking </i> Export to disk from the menu panel.
Tip: Check out the Publish a document section for a description of the different output formats.
Synchronization
StackEdit can be combined with </i> Google Drive and Dropbox to have your documents saved in the Cloud. The synchronization mechanism takes care of uploading your modifications or downloading the latest version of your documents.
Note:
- Full access to Google Drive or Dropbox is required to be able to import any document in StackEdit. Permission restrictions can be configured in the settings.
- Imported documents are downloaded in your browser and are not transmitted to a server.
- If you experience problems saving your documents on Google Drive, check and optionally disable browser extensions, such as Disconnect.
Open a document
You can open a document from </i> Google Drive or the Dropbox by opening the Synchronize sub-menu and by clicking Open from…. Once opened, any modification in your document will be automatically synchronized with the file in your Google Drive / Dropbox account.
Save a document
You can save any document by opening the Synchronize sub-menu and by clicking Save on…. Even if your document is already synchronized with Google Drive or Dropbox, you can export it to a another location. StackEdit can synchronize one document with multiple locations and accounts.
Synchronize a document
Once your document is linked to a </i> Google Drive or a Dropbox file, StackEdit will periodically (every 3 minutes) synchronize it by downloading/uploading any modification. A merge will be performed if necessary and conflicts will be detected.
If you just have modified your document and you want to force the synchronization, click the button in the navigation bar.
Note: The button is disabled when you have no document to synchronize.
Manage document synchronization
Since one document can be synchronized with multiple locations, you can list and manage synchronized locations by clicking </i> Manage synchronization in the Synchronize sub-menu. This will let you remove synchronization locations that are associated to your document.
Note: If you delete the file from Google Drive or from Dropbox, the document will no longer be synchronized with that location.
Publication
Once you are happy with your document, you can publish it on different websites directly from StackEdit. As for now, StackEdit can publish on Blogger, Dropbox, Gist, GitHub, Google Drive, Tumblr, WordPress and on any SSH server.
Publish a document
You can publish your document by opening the Publish sub-menu and by choosing a website. In the dialog box, you can choose the publication format:
- Markdown, to publish the Markdown text on a website that can interpret it (GitHub for instance),
- HTML, to publish the document converted into HTML (on a blog for example),
- Template, to have a full control of the output.
Note: The default template is a simple webpage wrapping your document in HTML format. You can customize it in the Advanced tab of the Settings dialog.
Update a publication
After publishing, StackEdit will keep your document linked to that publication which makes it easy for you to update it. Once you have modified your document and you want to update your publication, click on the button in the navigation bar.
Note: The button is disabled when your document has not been published yet.
Manage document publication
Since one document can be published on multiple locations, you can list and manage publish locations by clicking </i> Manage publication in the menu panel. This will let you remove publication locations that are associated to your document.
Note: If the file has been removed from the website or the blog, the document will no longer be published on that location.
Markdown Extra
StackEdit supports Markdown Extra, which extends Markdown syntax with some nice features.
Tip: You can disable any Markdown Extra feature in the Extensions tab of the Settings dialog.
Note: You can find more information about Markdown syntax here and Markdown Extra extension here.
Tables
Markdown Extra has a special syntax for tables:
Item | Value |
---|---|
Computer | $1600 |
Phone | $12 |
Pipe | $1 |
You can specify column alignment with one or two colons:
Item | Value | Qty |
---|---|---|
Computer | $1600 | 5 |
Phone | $12 | 12 |
Pipe | $1 | 234 |
Definition Lists
Markdown Extra has a special syntax for definition lists too:
Term 1
Term 2
: Definition A
: Definition B
Term 3
: Definition C
: Definition D
> part of definition D
Fenced code blocks
GitHub’s fenced code blocks are also supported with Highlight.js syntax highlighting:
1 | // Foo |
Tip: To use Prettify instead of Highlight.js, just configure the Markdown Extra extension in the Settings dialog.
Note: You can find more information:
Footnotes
You can create footnotes like thisfootnote.
footnote: Here is the text of the footnote.
SmartyPants
SmartyPants converts ASCII punctuation characters into “smart” typographic punctuation HTML entities. For example:
ASCII | HTML | |||
---|---|---|---|---|
Single backticks | 'Isn't this fun?' |
‘Isn’t this fun?’ | ||
Quotes | "Isn't this fun?" |
“Isn’t this fun?” | ||
Dashes | -- is en-dash, --- is em-dash |
— is en-dash, —- is em-dash |
Table of contents
You can insert a table of contents using the marker [TOC]
:
[TOC]
MathJax
You can render LaTeX mathematical expressions using MathJax, as on math.stackexchange.com:
The Gamma function satisfying $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$ is via the Euler integral
Tip: To make sure mathematical expressions are rendered properly on your website, include MathJax into your template:
1 | <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> |
Note: You can find more information about LaTeX mathematical expressions here.
UML diagrams
You can also render sequence diagrams like this:
1 | Alice->Bob: Hello Bob, how are you? |
And flow charts like this:
1 | st=>start: Start |
Note: You can find more information:
Support StackEdit
stackedit: StackEdit is a full-featured, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.