Browse Source

changes & new post

master
sipp11 10 years ago
parent
commit
be3aa495d9
  1. 2
      _config.yml
  2. 18
      _layouts/default.html
  3. 10
      _layouts/page.html
  4. 10
      _layouts/post.html
  5. 44
      _posts/2014-02-12-ssl-nginx.markdown
  6. 14
      _posts/2014-12-08-migrate-to-jekyll.md
  7. 15
      index.html
  8. 11
      sync_to_prod.sh

2
_config.yml

@ -9,7 +9,7 @@ url: "http://blog.10ninox.com/" # the base hostname & protocol for your site
twitter_username: sipp11
github_username: sipp11
permalink: /:year/:month/:day/:title/
permalink: /:year/:month/:title/
paginate: 8
paginate_path: "post/page/:num/"

18
_layouts/default.html

@ -17,17 +17,13 @@
{% include footer.html %}
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '10ninox'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3189083-1', 'auto');
ga('send', 'pageview');
</script>
</body>

10
_layouts/page.html

@ -11,4 +11,14 @@ layout: default
{{ content }}
</article>
<div id="disqus_thread"></div>
<script>
var disqus_shortname = '10ninox';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</div>

10
_layouts/post.html

@ -12,4 +12,14 @@ layout: default
{{ content }}
</article>
<div id="disqus_thread"></div>
<script>
var disqus_shortname = '10ninox';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</div>

44
_posts/2014-02-12-ssl-nginx.markdown

@ -24,20 +24,20 @@ tags:
Depending on where you purchase SSL certificate, I pick namecheap. I don't have any reason for it, but they are as reliable as it could be. GoDaddy, to me, is okay--they tend to have lower renewal cost for domain too. Back to SSL certificate, you need to generate a CSR (Certificate Signing Request) to ask for SSL. I'm using openSSL.
# openssl req -nodes -newkey rsa:2048 -keyout mywhatever.key -out whatever.csr
# openssl req -nodes -newkey rsa:2048 -keyout mywhatever.key -out whatever.csr
A series of question will be asked:
Country Name (2 letter code) [AU]: US
State or Province Name (full name) [Some-State]: NH
Locality Name (eg, city) []: Atkinson
Organization Name (eg, company) [Internet Widgits Pty Ltd]: 10ninox Ltd
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []: 10ninox.com
Email Address []:
Country Name (2 letter code) [AU]: US
State or Province Name (full name) [Some-State]: NH
Locality Name (eg, city) []: Atkinson
Organization Name (eg, company) [Internet Widgits Pty Ltd]: 10ninox Ltd
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []: 10ninox.com
Email Address []:
A challenge password []:
An optional company name []:
A challenge password []:
An optional company name []:
Some fields can be left blank, but you pretty much like to answer all for your own credential. The thing is you <strong>should leave challenge password empty</strong>, otherwise, you will have to type that every time your Nginx reload or restart. Then you get 2 file <code>mywhatever.key</code> and <code>whatever.csr</code>
@ -52,23 +52,23 @@ Now you have to extract <code>your_site.zip</code> which contains several files
Merge those files into one, <code>10ninox-ssl-bundle.csr</code> or whatever name you want.
$ cat 10ninox_com.crt PositiveSSLCA2.crt AddTrustExternalCARoot.crt > 10ninox-ssl-bundle.csr
$ cat 10ninox_com.crt PositiveSSLCA2.crt AddTrustExternalCARoot.crt > 10ninox-ssl-bundle.csr
Then copy the bundle file and <code>mywhatever.key</code> we got earlier to a directory in your server; location is up to you. There is no restricted whatsoever. The last process is to setup Nginx to know where SSL certificate is in Nginx virtualhost file (likely to be <code>/etc/nginx/sites-available/10ninox.com</code> for Debian)
This is an example how to configure one:
server {
listen 443;
server {
listen 443;
ssl on;
ssl_certificate /opt/projects/10ninox/ssl/10ninox-ssl-bundle.csr;
ssl_certificate_key /opt/projects/10ninox/ssl/mywhatever.key;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM;
ssl on;
ssl_certificate /opt/projects/10ninox/ssl/10ninox-ssl-bundle.csr;
ssl_certificate_key /opt/projects/10ninox/ssl/mywhatever.key;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM;
server_name 10ninox.com;
}
server_name 10ninox.com;
}
optional lines:
@ -77,11 +77,11 @@ optional lines:
It's better to test it first with
# service nginx configtest
# service nginx configtest
If pass,
# service nginx restart
# service nginx restart
=)

14
_posts/2014-12-08-migrate-to-jekyll.md

@ -0,0 +1,14 @@
---
layout: post
title: Jekyll it is
created: 1417988938
author:
display_name: sipp11
categories:
- talk
---
The change arrived. __10ninox blog__ now has turned into pretty minimal web pages. It is a bit harder on user's side since there is nothing such as tag link, month page, search, and so on, but posts remain the same: URL, content.
10ninox's blog was started by using WordPress, but over the past years, I haven't been actively blogging and I'm doing a lot more on coding side. Consequently, I figured out that I should have just turned the blog into an easier and cheaper process on my part. Nowadays, I prefered doing anything in text file; working in terminal; pushing stuffs from there to logging in to WordPress--previewing and publishing from there. [Jekyll](http://jekyllrb.com/) was one of the obvious choices as far as Google's results are concerned. Don't ask me why I pick Jekyll over anything since I do not know if there is anything better. I did try to find Jekyll alternative in Python, but have yet to find anything better. Jekyll is okay with markdown and I'm comfortable with it. Since I do not code in Ruby, I am seemingly blind to configure in any way, but basic. Hopefully, one day, I get around to work on that, but so far, this works with only nginx and cheap VM. I couldn't be happier.
Thanks to [Jekyll](http://jekyllrb.com/), [Disqus](http://disqus.com), [git](http://www.git-scm.com/), and [nginx](http://nginx.org/) to make this possible.

15
index.html

@ -11,7 +11,7 @@ layout: default
<ul class="post-list">
{% for post in paginator.posts %}
<li>
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }} • <small>{{ post.categories | array_to_sentence_string }}</small></span>
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }} • <small>{{ post.categories | array_to_sentence_string }}<a href="{{ post.url | prepend: site.baseurl }}#disqus_thread">comments</a></small></span>
<h2><a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
</li>
{% endfor %}
@ -19,3 +19,16 @@ layout: default
{% include paginator.html %}
</div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '10ninox'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>

11
sync_to_prod.sh

@ -0,0 +1,11 @@
#!/bin/sh
RUSER=sipp11
RHOST=do3
PORT=22
RPATH=/opt/www/10ninox_blog
LPATH=./_site/
rsync -avu -e "ssh -p $PORT" $LPATH $RUSER@$RHOST:$RPATH \
--exclude=.DS_Store --exclude=sync_ec2.sh --exclude=*.pyc \
--exclude=migrations --exclude=scripts
Loading…
Cancel
Save