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
from subprocess import Popen, PIPE, STDOUT | |
from sys import stdout | |
p = Popen(['echo', 'test'], stdout=PIPE, stderr=STDOUT) | |
q = Popen('(while read line; do echo "\033[31m$line\033[0m"; done)', shell=True, stdin=p.stdout) |
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
from subprocess import Popen | |
from sys import stdout | |
class Log(file): | |
def set_color(self, color): | |
self.color = color | |
def write(self, msg): | |
stdout.write(self.color) | |
stdout.write(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
from requests import post | |
api_key = '' | |
headers = {'Authorization': 'Basic {}'.format(api_key)} | |
r = post('https://api.cloudpassage.com/oauth/access_token?grant_type=client_credentials', headers=headers) | |
print r.json() |
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
Example Database: | |
table: users | |
username email_address password | |
ksoviero ksoviero@gmail.com Pa$$w0rd | |
jdoe jdoe@onelogin.com JD0esPa$$wd | |
Customer's API request to us: | |
(Return all users with an email address that ends with @onelogin.com) |
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
/etc/postfix/main.cf: | |
file: | |
- comment: | |
- regex: ^alias_maps = hash:/etc/aliases$ | |
- append: | |
- text: | |
- "alias_maps = hash:/etc/aliases, regexp:/etc/aliases.regexp" |