GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/sh | |
| # TODO: parse & pass-through sudo options from $@ | |
| sudo_options="-E" | |
| scls=$X_SCLS | |
| #available_scls="`scl --list | tr '\n' ' ' | sed 's/ $//'`" | |
| for arg in "$@" | |
| do | |
| case "$arg" in | |
| *\'*) |
Install Virtualbox, Vagrant and Ansible.
Create a new directory for your first Vagrant VM. In that directory, create a Vagrantfile using vagrant init, and enable the Ansible provisioner by adding the following.
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
end
Now you can create an Ansible playbook named playbook.yml file in the same directory as your Vagrantfile, and vagrant provision will run it. Here's an easy one to start with that will update NSS and add the EPEL and IUS repositories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # There was a day where I have too many color schemes in iTerm2 and I want to remove them all. | |
| # iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one. | |
| # iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format | |
| # What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files. | |
| $ cd /tmp/ | |
| $ cp ~/Library/Preferences/com.googlecode.iterm2.plist . | |
| $ plutil -convert xml1 com.googlecode.iterm2.plist | |
| $ vi com.googlecode.iterm2.plist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Vagrantfile for testing | |
| # | |
| Vagrant::configure("2") do |config| | |
| # the Chef version to use | |
| config.omnibus.chef_version = "11.4.4" | |
| def configure_vbox_provider(config, name, ip, memory = 384) | |
| config.vm.provider :virtualbox do |vbox, override| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - hosts: localhost | |
| remote_user: dirn | |
| vars: | |
| ansible: ~/.ansible | |
| dotfiles: "{{ ansible }}/dotfiles" | |
| rc_file: ~/.extra | |
| pyenv: /Users/{{ ansible_ssh_user }}/.pyenv | |
| python_version: 3.4.3 | |
| python_versions: [2.6.9, 2.7.9, 3.3.6, 3.4.3, pypy-2.5.0, pypy3-2.4.0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr'] | |
| def human_log(res): | |
| if type(res) == type(dict()): | |
| for field in FIELDS: | |
| if field in res.keys(): | |
| if isinstance(res[field], unicode): | |
| encoded_field = res[field].encode('utf-8') | |
| else: |