Skip to content

Instantly share code, notes, and snippets.

@jonhuber
jonhuber / celery_janitor.py
Created February 4, 2013 10:21
This is a script to clean up deadlocked Celery workers. I typically run it on servers every 15 minutes via cron.
from celery.app.control import Control
import datetime
import psutil
import socket
def main():
control = Control()
inspect = control.inspect()
hostname = socket.gethostname()
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.11 (GNU/Linux)
owGbwMvMwMT42EXOge3k+ybG0wdeJTEEa6VUVisl5adUKllVK2Wngqm0zLz01KKC
osy8EiUrpSTTVHOj1BSzJCOL5ORUQyNzC0MzE/Pk1FRjExPDVBMDA7Nky9Q0CyMl
HaWM/GKQDqAxSYnFqXqZ+UAxICc+MwUo6gpS7wpS72zp6gZWXwqWME8yNEw2NzU0
sjCwSDFMNjM2TTI3SzZJMjCxNLAwNzAAKSxOLcpLzE0Fqs7Kz8soTUotUqrVUQKK
lmUmp4LcDJVNzywByuLWUVJZABIqT02Kh2qOT8rMSwF6GKinLLWoODM/T8nKEKgy
uSQTpNvQ2NLUyMLc0MxQRym1oiCzKDU+E6TC1NzMwgAIdJQKilLLgEZaGqcYJqak
WpoZpgIVW6QZp6VaWiQmmhokGyWbGCYam6SaJKUYpBkkp1okJSYnG5tZWphZJlsY
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.11 (GNU/Linux)
owGbwMvMwMT42EXOge3k+ybG0wdeJTEEa222rlZKyk+pVLKqVspOBVNpmXnpqUUF
RZl5JUpWSkmmqeZGqSlmSUYWycmphkbmFoZmJubJqanGJiaGqSYGBmbJlqlpFkZK
OkoZ+cUgHUBjkhKLU/Uy84FiQE58ZgpQ1BWk3hWk3tnS1Q2svhQsYZ5kaJhsbmpo
ZGFgkWKYbGZsmmRulmySZGBiaWBhbmAAUlicWpSXmJsKVJ2Vn5dRmpRapFSrowQU
LctMTgW5GSqbnlkClMWto6SyACRUnpoUD9Ucn5SZlwL0MFBPWWpRcWZ+npKVIVBl
ckkmSLehsaWpsYG5sZGxjlJqRUFmUWp8JkiFqbmZhQEQ6CgVFKWWAY00TDM1SjUx
MzOyTEq2NLA0Sk00MDI3SEpNS000TkxLMk1KNTAB+tDSxMQy2SI5zdA8Mc0iyTjZ
@jonhuber
jonhuber / tmux.cheat
Created June 27, 2017 17:51 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &