You can use strace on a specific pid to figure out what a specific process is doing, e.g.:
strace -fp <pid>
You might see something like:
select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)
FROM ubuntu | |
MAINTAINER Mike Clarke <mike@standardtreasury.com> | |
RUN apt-get update | |
RUN apt-get upgrade -y | |
RUN apt-get install -y language-pack-en | |
ENV LANGUAGE en_US.UTF-8 | |
ENV LANG en_US.UTF-8 | |
ENV LC_ALL en_US.UTF-8 |
#!/usr/bin/env python | |
"""Run all processes in parallel. | |
Group output by process groups and order within groups | |
""" | |
import shlex | |
import subprocess | |
import sys | |
import threading |
#!/usr/bin/env python | |
"""Show that a daemonic child process may have multiple threads.""" | |
import multiprocessing | |
import threading | |
def child_process(): | |
# start a thread | |
threading.Thread(target=child_thread).start() | |
# show that we can't have grandchildren processes |
#!/usr/bin/env python | |
"""Translate text_to_translate using microsoft translator service.""" | |
import json | |
import xml.etree.ElementTree as etree | |
try: | |
from urllib import urlencode | |
from urllib2 import urlopen, Request | |
except ImportError: # Python 3 | |
from urllib.parse import urlencode | |
from urllib.request import urlopen, Request |
#!/usr/bin/env python | |
"""Try to cause MemoryError by sending large data via multiprocessing.Pipe. | |
Context: http://stackoverflow.com/q/22150703 | |
""" | |
from multiprocessing import Process, Pipe | |
def send_big_data(conn): | |
data = b"a" * (1 << 30) # 1GB | |
conn.send(data) |
#!/usr/bin/env python | |
""" | |
- read subprocess output without threads using Tkinter | |
- show the output in the GUI | |
- stop subprocess on a button press | |
""" | |
import logging | |
import os | |
import sys | |
from subprocess import Popen, PIPE, STDOUT |
#!/usr/bin/env bash | |
# call like this on the target server: | |
# NODENAME='foo' CHEF_ENV='production' RUNLIST='["role[foo]","recipe[bar]"]' CHEFREPO='git@example.com:repo.git' bash <( curl -L https://raw.github.com/gist/1026628 ) | |
# You will need to ensure that the ssh key is already set up on the server. | |
set -e | |
export CHEF_DIR="${HOME}/chef" | |
sudo rm -rf $CHEF_DIR | |
mkdir -p "$CHEF_DIR" |
while /bin/true; do dd if=/dev/urandom of=/tmp/100 bs=1024 count=100000; for i in {1..10}; do cp /tmp/100 /tmp/tmp_$i_$RANDOM; done; rm -f /tmp/tmp_* /tmp/100; done & /usr/sbin/corosync-keygen |