Install the line_profiler
module:
[driti@ubuntu ]$ pip install line_profiler
Add the @profile
decorator and run:
[driti@ubuntu ]$ kernprof.py -l -v example.py
"""Open fixture json files and remove lines which contain '>>>', '|||', '<<<', | |
and check that `.field.permissions` are unique""" | |
for fname in files: | |
fp = open(fname) | |
perms = json.loads(fixit(fname)) | |
fp.close() | |
for perm in perms: | |
item = perm['fields']['permissions'] | |
res = uniq(item) |
week | |
date range | |
project name | |
description | |
============ | |
2 | |
08/01 - 14/01 | |
------------- | |
toy-deploy | |
Aim of the project is not in solving any problem but in project design itself. |
import os | |
import time | |
import sys | |
from subprocess import call | |
def check_pid(pid): | |
""" Check For the existence of a unix pid. """ | |
while True: | |
try: | |
os.kill(pid, 0) |
Install the line_profiler
module:
[driti@ubuntu ]$ pip install line_profiler
Add the @profile
decorator and run:
[driti@ubuntu ]$ kernprof.py -l -v example.py
It's a common confusion about terminal colours... Actually we have this:
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" | |
#!/usr/bin/env python3 | |
import os | |
import sys | |
_b = sys.version_info[0] < 3 and (lambda x:x) or (lambda x:x.encode('utf-8')) | |
def ssh_exec_pass(password, args, capture_output=False): | |
''' | |
Wrapper around openssh that allows you to send a password to |
#Introduction to Devops Resources:
##Chapter 1
2015 State of DevOps Report https://puppet.com/resources/white-paper/2015-state-of-devops-report
Knight Capital https://en.wikipedia.org/wiki/Knight_Capital_Group
#!/bin/bash | |
# | |
# Shell scripts for get image manifest from v2 registry | |
# | |
# Tested on Debian 8, curl 7.38.0, jq-1.5 | |
# | |
set -e -u | |
# Default tag is latest |