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
git checkout -b my-custom | |
git add . | |
git commit -m "fix mackup" | |
git checkout master | |
upgrade_oh_my_zsh | |
git merge my-custom |
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
rename -n 's/^[0-9]+ - //' * |
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: mygroup | |
gather_facts: false | |
tasks: | |
- shell: date | |
register: date_res | |
changed_when: false | |
- debug: | |
msg: "{{ ansible_play_hosts | map('extract', hostvars, 'date_res') | map(attribute='stdout') | list }}" | |
run_once: yes |
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
if [[ -z "$TMUX" ]]; then | |
if tmux has-session 2>/dev/null; then | |
exec tmux attach | |
else | |
exec tmux | |
fi | |
fi |
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: all | |
vars: | |
uuids: | | |
{%- set o=[] %} | |
{%- for i in play_hosts %} | |
{%- if o.append(hostvars[i].uuid) %} | |
{%- endif %} | |
{%- endfor %} | |
{{ o }} |
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
ansible-playbook -i 'localhost,' plays/get_all_cronjobs.yml --connection=local --ask-become-pass |
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
- name: Write to local disk | |
local_action: "copy content='{{ result.stdout_lines }}' dest='../files/list_cronjobs/list_cronjobs.txt'" | |
- name: Write to local disk | |
lineinfile: dest=../files/list_cronjobs/list_cronjobs.txt create=yes line="{{ result.stdout_lines }}" | |
delegate_to: 127.0.0.1 |
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
class objdict(dict): | |
def __getattr__(self, name): | |
if name in self: | |
return self[name] | |
else: | |
raise AttributeError("No such attribute: " + name) | |
def __setattr__(self, name, value): | |
self[name] = value |
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
"Function Docstring": { | |
"prefix": "docf", | |
"body": [ | |
"\"\"\"${1:Short description of what function does}.", | |
"${2:Long description here}.\n", | |
"Args:", | |
"\t${3:arg1} (${4:type}): ${5:Description of $3}\n", | |
"Returns:", | |
"\t${6:type}: ${7:Description of return value}", | |
"\"\"\"", |
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
"Default Header": { | |
"prefix": "header", | |
"body": [ | |
"#!/usr/bin/env python", | |
"# -*- coding: utf-8 -*-", | |
"\"\"\"${1:Custom module name or brief description}.\n", | |
"${2:Enter description of this module}", | |
"", | |
"__author__ = ${3:[authors]}", | |
"__copyright__ = Copyright 2018", |