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
[MASTER] | |
#load-plugins = plugin1, plugin2 | |
[REPORTS] | |
reports = no | |
output-format = colorized | |
[FORMAT] | |
#indent-string = \t |
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
% git init | |
Initialized empty Git repository in /home/andreas/tmp/gittest2/.git/ | |
% echo 'test' > test | |
% git add test | |
% git commit -m 'test commit' | |
[master (root-commit) 8d25641] test commit | |
1 file changed, 1 insertion(+) |
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
#!/bin/sh | |
git clone https://github.com/saltstack/salt | |
cd salt | |
git checkout 2015.8 | |
virtualenv -p python2 . | |
. ./bin/activate | |
pip install -e . | |
# if $HOME/bin is in your $PATH | |
ln -sf $(readlink -f bin/salt-ssh) $HOME/bin/salt-ssh |
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
#!/bin/sh | |
date -R | |
echo "Updating letsencrypt certificate for $1" | |
if [ "$(id -u)" = "0" ]; then | |
echo "This script cannot be run as root" 1>&2 | |
exit 1 | |
fi |
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
# in a /srv/salt .sls file | |
my_state: <- State ID | |
file.managed: <- State function | |
- name: /tmp/foo | |
- contents: hello world | |
^ state function arguments | |
{% if salt['file.directory_exists']('/tmp/bar') %} | |
^ module function ^ module function arguments |
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
{# allow outgoing traffic #} | |
{% macro outgoing(name, protocol, port, family, enable=true) %} | |
{{ name }}-{{ family }}-{{ protocol }}-{{ port }}-outgoing: | |
family: {{ family }} | |
chain: OUTPUT | |
jump: ACCEPT | |
protocol: {{ protocol }} | |
dport: {{ port }} | |
state: 'NEW,ESTABLISHED' | |
enable: {{ enable }} |
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
>>> l = [] | |
>>> l = l + 'foo' | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: can only concatenate list (not "str") to list | |
>>> l += 'foo' | |
>>> l | |
['f', 'o', 'o'] |
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
[ERROR ] Nested output failed: | |
Traceback (most recent call last): | |
File "/home/andreas/dev/python/salt/salt/output/__init__.py", line 43, in try_printout | |
return get_printout('nested', opts)(data).rstrip() | |
AttributeError: 'NoneType' object has no attribute 'rstrip' | |
[ERROR ] An un-handled exception was caught by salt's global exception handler: | |
AttributeError: 'NoneType' object has no attribute 'rstrip' | |
Traceback (most recent call last): | |
File "/usr/local/bin/salt-ssh", line 6, in <module> | |
exec(compile(open(__file__).read(), __file__, 'exec')) |
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
#!/usr/bin/env sh | |
# where to put the executable - make sure you have write | |
# permissions to $prefix/bin ! | |
prefix=$HOME # or /usr/local or whatever | |
# create a random tmp directory to work in | |
src=$(mktemp -d) && cd $src | |
git clone https://github.com/sass/libsass && cd libsass |
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
<VirtualHost *:80> | |
# Client AngularJS application | |
DocumentRoot /var/www/example/client/public | |
# Server Laravel 4 API application | |
Alias /api /var/www/example/server/public | |
# Rewrite all requests in /api to server index.php | |
<Location /api> |
NewerOlder