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
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 |
#!/bin/bash | |
server='hastebin.com'; | |
usage="$0 pastes into $server | |
usage: $0 something | |
example: '$0 pie' or 'ps aufx |$0'" | |
if [ -z $1 ]; then | |
str=`cat /dev/stdin`; |
# aptitude install qemu-kvm libvirt-bin | |
# create a bridge with your current interface | |
auto eth1 | |
iface eth1 inet manual | |
auto br0 | |
iface br0 inet dhcp | |
bridge_ports eth1 |
Why do compilers even bother with exploiting undefinedness signed overflow? And what are those | |
mysterious cases where it helps? | |
A lot of people (myself included) are against transforms that aggressively exploit undefined behavior, but | |
I think it's useful to know what compiler writers are accomplishing by this. | |
TL;DR: C doesn't work very well if int!=register width, but (for backwards compat) int is 32-bit on all | |
major 64-bit targets, and this causes quite hairy problems for code generation and optimization in some | |
fairly common cases. The signed overflow UB exploitation is an attempt to work around this. |