-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tero Karvinen
committed
Nov 5, 2022
1 parent
d2c140d
commit 868a228
Showing
44 changed files
with
9,783 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
# micro-cheat | ||
F1 Show cheatsheet for the language you're editing: Lua, Go, Python... | ||
# micro-cheat - F1 cheatsheet for the language you're editing | ||
|
||
**F1** Show cheatsheet for the language you're editing: Lua, Go, Python... | ||
|
||
A plugin for Micro editor. | ||
|
||
## Usage | ||
|
||
Edit a source code file with micro. Press F1. | ||
|
||
A cheatsheet for the language opens. If you're editing Python, it's a Python cheatsheet. If Go, then Go cheatsheet. | ||
|
||
Press Ctrl-Q to close the cheatsheet tab and return to editing. | ||
|
||
For your convenience, micro-cheat also provides a command 'cheat' that you can bind to any key or run with ctrl-E. | ||
|
||
## Installation | ||
|
||
In the future, you will be able to install micro-cheat by | ||
|
||
$ micro --plugin install micro-cheat | ||
|
||
Currently, there is just development install | ||
|
||
$ cd $HOME/.config/micro/plug/ | ||
$ git clone https://github.com/terokarvinen/micro-cheat | ||
|
||
## Adminstrivia | ||
|
||
Cheatsheets are from https://devhints.io project, copyright (c) 2021 Rico Sta. Cruz and contributors, received under MIT license. | ||
|
||
Micro-cheat plugin is Copyright 2022 Tero Karvinen https://TeroKarvinen.com, MIT license. | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ruby:2.7.1 | ||
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \ | ||
nodejs \ | ||
yarn \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN mkdir -p /app | ||
WORKDIR /app |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
--- | ||
title: Ansible | ||
category: Ansible | ||
--- | ||
|
||
{% raw %} | ||
|
||
## Getting started | ||
|
||
### Hosts | ||
|
||
$ sudo mkdir /etc/ansible | ||
$ sudo vim /etc/ansible/hosts | ||
|
||
[example] | ||
192.0.2.101 | ||
192.0.2.102 | ||
|
||
### Running a playbook | ||
|
||
$ ansible-playbook playbook.yml | ||
|
||
## Tasks | ||
|
||
- hosts: all | ||
user: root | ||
sudo: no | ||
vars: | ||
aaa: bbb | ||
tasks: | ||
- ... | ||
handlers: | ||
- ... | ||
|
||
### Includes | ||
|
||
tasks: | ||
- include: db.yml | ||
handlers: | ||
- include: db.yml user=timmy | ||
|
||
## Handlers | ||
|
||
handlers: | ||
- name: start apache2 | ||
action: service name=apache2 state=started | ||
|
||
tasks: | ||
- name: install apache | ||
action: apt pkg=apache2 state=latest | ||
notify: | ||
- start apache2 | ||
|
||
## Vars | ||
|
||
- host: lol | ||
vars_files: | ||
- vars.yml | ||
vars: | ||
project_root: /etc/xyz | ||
tasks: | ||
- name: Create the SSH directory. | ||
file: state=directory path=${project_root}/home/.ssh/ | ||
only_if: "$vm == 0" | ||
|
||
## Roles | ||
|
||
- host: xxx | ||
roles: | ||
- db | ||
- { role:ruby, sudo_user:$user } | ||
- web | ||
|
||
# Uses: | ||
# roles/db/tasks/*.yml | ||
# roles/db/handlers/*.yml | ||
|
||
### Task: Failures | ||
|
||
- name: my task | ||
command: ... | ||
register: result | ||
failed_when: "'FAILED' in result.stderr" | ||
|
||
ignore_errors: yes | ||
|
||
changed_when: "result.rc != 2" | ||
|
||
### Env vars | ||
|
||
vars: | ||
local_home: "{{ lookup('env','HOME') }}" | ||
|
||
## References | ||
|
||
* [Intro](http://www.ansibleworks.com/docs/intro_configuration.html) | ||
* [Modules](http://www.ansibleworks.com/docs/modules.html) | ||
|
||
{% endraw %} | ||
|
||
https://devhints.io/ cheatsheets - Copyright (c) 2021 Rico Sta. Cruz and contributors - MIT license | ||
micro-cheat plugin Copyright 2022 Tero Karvinen https://TeroKarvinen.com/micro - MIT license |
Oops, something went wrong.