Skip to content

Instantly share code, notes, and snippets.

Avatar

karl zhoujiealex

View GitHub Profile
@zhoujiealex
zhoujiealex / pedantically_commented_playbook.yml
Created Oct 28, 2016 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
View pedantically_commented_playbook.yml
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@zhoujiealex
zhoujiealex / Ansible-Vault how-to.md
Created Oct 24, 2016 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.
View Ansible-Vault how-to.md

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

View BC4Key
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
q2Kw2pjoiDs5gIH-uw5U49JzOB6otS7kThBJE-H9A76u4uUvR8DKb+VcB
rWu5qSJGEnbsXNfJdq5L2D8QgRdV-sXHp2A-7j1X2n4WIISvU1V9koIyS
NisHFBTcWJS0sC5BTFwrtfLEE9lEwz2bxHQpWJiu12ZeKpi+7oUSqebX+
View package.json
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.2.0"
},
"dependencies": {
"hexo": "^3.1.1",
"hexo-deployer-git": "^0.1.0",
@zhoujiealex
zhoujiealex / gulpfile.js
Last active Apr 19, 2018
sample of gulpfile.js for hexo generate blog, compress public files
View gulpfile.js
/* Refrences:
1. http://notes.iissnan.com/2016/publishing-github-pages-with-travis-ci
2. https://github.com/chrisjlee/hexo-theme-zurb-foundation/blob/e82f45a82bbaaee063bcb1298cd9793575afb142/gulpfile.js
3. https://github.com/gulpjs/gulp/blob/master/docs/recipes/delete-files-folder.md
4. https://hexo.io/api/
5. https://github.com/iissnan/theme-next-docs/blob/master/.travis.yml
*/
var gulp = require('gulp');
var minifycss = require('gulp-clean-css');
@zhoujiealex
zhoujiealex / .travis.yml
Last active May 28, 2016
sample of ,travis.yml
View .travis.yml
# Refrecnes:
# http://www.think-diff.me/2016/05/28/travis-ci-deploy-blog/
# https://zespia.tw/blog/2015/01/21/continuous-deployment-to-github-with-travis/
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs
# https://github.com/iissnan/theme-next-docs/blob/master/.travis.yml
# http://changyuheng.me/2015/when-hexo-static-site-meets-github-pages-and-travis-ci/
language: node_js
node_js: stable
View alert.js
var render = hexo.render;
/**
* alert tag
*
* Syntax:
* {% alert caption [style] %}
* Alert string
* {% endalert %}
*/
View ludatui.py
#coding=utf8
##版本:1.0
##环境:python2.7
##作者:moxie
##日期:2013.08.23
##说明:文件生成目录为:D:/ludatui
import urllib2,urllib
import re