Skip to content

Commit

Permalink
First public release
Browse files Browse the repository at this point in the history
  • Loading branch information
Tero Karvinen committed Nov 5, 2022
1 parent d2c140d commit 868a228
Show file tree
Hide file tree
Showing 44 changed files with 9,783 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Tero Karvinen
Copyright (c) 2022 Tero Karvinen https://TeroKarvinen.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
35 changes: 33 additions & 2 deletions README.md
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.

11 changes: 11 additions & 0 deletions cheatsheets/Dockerfile
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
102 changes: 102 additions & 0 deletions cheatsheets/ansible.md
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
Loading

0 comments on commit 868a228

Please sign in to comment.