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)
ctrl-z | |
bg | |
touch /tmp/stdout | |
touch /tmp/stderr | |
gdb -p $! | |
# In GDB | |
p dup2(open("/tmp/stdout", 1), 1) | |
p dup2(open("/tmp/stderr", 1), 2) |
This article is now published on my website: Prefer Subshells for Context.
import sys, threading, Queue, weakref | |
try: | |
import Tkinter | |
_has_tk = True | |
_debug_win = None | |
except ImportError: | |
# quietly disable ourselves | |
_has_tk = False |
Add this to Info.plist
in /System/Library/Spotlight/RichText.mdimporter/Contents/
and Spotlight will search for source code files.
<string>public.c-header</string>
<string>public.c-plus-plus-header</string>
<string>public.c-source</string>
<string>public.objective-c-source</string>
public.c-plus-plus-source
from jinja2 import Template | |
template = ''' | |
.container{{ full_width }} { | |
margin-right: auto; | |
margin-left: auto; | |
*zoom: 1; | |
} | |
.container{{ full_width }}:before, | |
.container{{ full_width }}:after { |
#!/bin/bash | |
curl -XDELETE http://localhost:9200/_template/logstash?pretty=true | |
echo | |
echo "Deleted current logstash template..." | |
echo "Creating new logstash template..." | |
sleep 2 |
# Ivaylo Kuzev <[email protected]>, 2014 | |
# Zenburn like colorscheme for https://github.com/hut/ranger . | |
# default colorscheme. | |
# Copyright (C) 2009-2013 Roman Zimbelmann <[email protected]> | |
# This software is distributed under the terms of the GNU GPL version 3. | |
from ranger.gui.colorscheme import ColorScheme | |
from ranger.gui.color import * |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
TLDR: I now add the following snippet to all my Dockerfiles:
# If host is running squid-deb-proxy on port 8000, populate /etc/apt/apt.conf.d/30proxy
# By default, squid-deb-proxy 403s unknown sources, so apt shouldn't proxy ppa.launchpad.net
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
&& (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
&& (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
|| echo "No squid-deb-proxy detected on docker host"