Skip to content

Instantly share code, notes, and snippets.

@superdaigo
superdaigo / gunicorn_error.log
Created August 15, 2012 13:32
gunicorn の起動エラー
Traceback (most recent call last):
File "/home/oreore/app/env/bin/gunicorn_django", line 8, in <module>
load_entry_point('gunicorn==0.14.6', 'console_scripts', 'gunicorn_django')()
File "/home/oreore/app/env/lib/python2.6/site-packages/gunicorn/app/djangoapp.py", line 132, in run
DjangoApplication("%prog [OPTIONS] [SETTINGS_PATH]").run()
File "/home/oreore/app/env/lib/python2.6/site-packages/gunicorn/app/base.py", line 124, in run
Arbiter(self).run()
File "/home/oreore/app/env/lib/python2.6/site-packages/gunicorn/arbiter.py", line 72, in __init__
cwd = os.getcwd()
OSError: [Errno 2] No such file or directory
@superdaigo
superdaigo / app.log
Created August 16, 2012 10:30
gunicorn_django syncworker socket error
Traceback (most recent call last):
File "/home/oreore/app/env/lib/python2.6/site-packages/gunicorn/workers/sync.py", line 33, in run
client, addr = self.socket.accept()
File "/usr/lib64/python2.6/socket.py", line 197, in accept
sock, addr = self._sock.accept()
error: [Errno 11] Resource temporarily unavailable
@superdaigo
superdaigo / gist:3719990
Created September 14, 2012 05:34
Homebrew OpenVPN
$ brew install openvpn
==> Installing openvpn dependency: lzo
==> Downloading http://www.oberhumer.com/opensource/lzo/download/lzo-2.06.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/lzo/2.06 --enable-shared
==> make
==> make check
==> make install
/usr/local/Cellar/lzo/2.06: 27 files, 552K, built in 27 seconds
==> Installing openvpn
@superdaigo
superdaigo / zabbix-alert-smtp.sh
Created September 20, 2012 04:58
Zabbix SMTP Alert script for gmail
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
@superdaigo
superdaigo / init.el
Created October 5, 2012 22:55
Klipper copy & paste for emacs terminal (KDE)
;; linux
(when (eq 'gnu/linux system-type)
;; terminal
(unless window-system
;; I don't know how to detect the system was KDE or not. :(
(defun copy-from-kde()
(let ((output (shell-command-to-string "qdbus org.kde.klipper /klipper getClipboardContents")))
(unless (string= (car kill-ring) output)
output )))
(defun paste-to-kde (text &optional push)
#!/bin/bash
find . -name ".git" -type d -prune -print -execdir git pull \;
@superdaigo
superdaigo / insert-date.el
Last active December 14, 2015 14:59
The sample function to insert current date in emacs. The format is "yyyy-mm-dd (aaa)" in this snippet.
;; insert-date
(defun insert-date ()
"Insert current date yyyy-mm-dd (aaa)"
(interactive)
;; Print weekday in English
(setq tmp-locale woman-locale)
(set-locale-environment "en_US.UTF-8")
(insert (format-time-string "%Y-%m-%d (%a)"))
(set-locale-environment tmp-locale)
)
In [1]: for i in range(1,100):
...: if pow(i, 17) % 3569 == 915:
...: print i
...:
2012
5581
9150
@superdaigo
superdaigo / check_pip_download_time.sh
Created August 15, 2013 10:21
Check pip download time (sec) for each pypi mirror servers.
#!/bin/bash
# System Requirements
# pip ... python package install command
# requirements.txt ... package list to install via pip
TMP_DIR="${HOME}/tmp"
REQUIREMENTS_TXT="requirements.txt"
@superdaigo
superdaigo / radiko_player_air.log
Created November 19, 2013 22:47
Log of radiko_player_air (Version 3.1.0) Display was slept around 7:10. Hope fixed latest version.
2013/11/20 6:40:04.725 radiko_player_air[58661] CoreText performance note: Client called CTFontCreateWithName() using name "Times Roman" and got font with PostScript name "Times-Roman". For best performance, only use PostScript names when calling this API.
2013/11/20 6:40:04.725 radiko_player_air[58661] CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug.
2013/11/20 6:40:08.184 radiko_player_air[58661] The function `CGFontSetShouldUseMulticache' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.
2013/11/20 7:10:14.354 radiko_player_air[58661] HIToolbox: received notification of WindowServer event port death.
2013/11/20 7:10:14.357 radiko_player_air[58661] port matched the WindowServer port created in BindCGSToRunLoop
2013/11/20 7:10:14.559 radiko_player_air[58661] CGError CGSGetDisplaySystemState(uint64_t, CGSDis