Skip to content

Instantly share code, notes, and snippets.

DEBUG dns_resolve_sync: foo.com[45298] recv/yield on event[0xdcf0d0]...
DEBUG dns_resolve_sync: bar.com[45299] waiting on event[0xdcf0d0] for response...
DEBUG dns_resolve_sync: quux.com[45300] waiting on event[0xdcf0d0] for response...
DEBUG dns_resolve_sync: asdf.com[45301] waiting on event[0xdcf0d0] for response...
DEBUG dns_resolve_sync: asdf.net[45302] waiting on event[0xdcf0d0] for response...
DEBUG dns_resolve_sync: foo.net[45303] waiting on event[0xdcf0d0] for response...
DEBUG dns_resolve_sync: foo.org[45304] waiting on event[0xdcf0d0] for response...
DEBUG dns_resolve_sync: bar.net[45305] waiting on event[0xdcf0d0] for response...
DEBUG dns_resolve_sync: bar.org[45306] waiting on event[0xdcf0d0] for response...
@SpComb
SpComb / gist:11167504
Created April 22, 2014 06:39
weirdness spam
From: "news@hc10.eu" <news@hc10.eu>
Subject: Derivation of fundamental constants of nature
Derivation of fundamental constants of nature - a world novelty
Dear Ladies and Gentlemen,
I would like to inform you about a new formula discovered by me.
@SpComb
SpComb / update-kernels.conf
Created June 29, 2014 11:05
/etc/ltsp/update-kernels.conf hack hack for localboot
# Default boot options
# Use a menu for booting
PXELINUX_DEFAULT=menu
# Set default timeout to 5 seconds (hundreths of a second)
TIMEOUT="50
label localboot
menu label Local disk (Windows)
@SpComb
SpComb / gist:c1bb74609827ff516212
Created July 26, 2014 18:10
openwrt:/etc/hotplug.d/iface/01-dhcp-hostname
log () {
logger -p user.info -t ifup "/etc/hotplug.d/iface/01-dhcp-hostname: $*"
}
if [ ifup = "$ACTION" -a dhcp = "$PROTO" ]; then
hostname=$(uci_get system '@system[0]' hostname '')
lease_hostname=$(uci_get_state network "$INTERFACE" lease_hostname '')
if [ -n "$lease_hostname" ]; then
log "hostname: $lease_hostname"
@SpComb
SpComb / __init__.py
Created September 18, 2014 10:13
fooproject/settings/__init__.py
## Import common settings
from fooproject.settings.base import *
from fooproject.settings.fooapp import *
### Load additional configuration
## Do we have explicit configuration?
ETC_PATH = os.path.join(DATA_PATH, 'etc/settings.d')
if os.path.exists(ETC_PATH) :
from glob import glob
@SpComb
SpComb / gist:b66b81c375e6a0587e6d
Created September 24, 2014 08:47
Lenovo X240 review in 1000 characters or less
The 1080p IPS display is a dream (including dreamlike short-term ghosting :P) and together with the awesome battery design makes this model bearable.
However, the keyboard/trackpoint/clickpad is in no way at all an improvement from previous models, but a major downgrade from my previous X200s.
The keyboard is bearable but definitely has more typos/mis-clicks than previous models. The placement of the PrtScr button is absolutely crazy, I take an accidential screenshot every day or two. Please don't "innovate" the home/end/del buttons any further like on the X1, I beg you.
The clickpad (with two-finger guestures) isn't a terrible idea, but trying to use it for the trackpoint softbuttons is. After half a year of use and tweaking the clickpad, I still continuously mis-click the wrong mouse button. If it wasn't for the display and battery design, I would have dropped this model.
The machine itself is well built, and no functionality issues under Ubuntu Linux (4k HDMI out etc works).
@SpComb
SpComb / test.py
Created September 24, 2014 10:38
class TCPStream:
...
def __iter__ (self):
"""
Read lines of input from the socket.
Yields strings without trailing newlines.
Returns on EOF.
@SpComb
SpComb / queue.py
Created September 29, 2014 12:40
threading -> asyncio queue
import asyncio
import queue
import socket
class Error (Exception):
pass
Full = queue.Full
class Queue:
@SpComb
SpComb / dmesg
Created October 10, 2014 20:26
bcache background writeback flush blocking
[ 2880.559577] INFO: task bcache_writebac:4708 blocked for more than 120 seconds.
[ 2880.559631] Not tainted 3.16-0.bpo.2-amd64 #1
[ 2880.559660] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 2880.559712] bcache_writebac D ffff88063fc341c0 0 4708 2 0x00000000
[ 2880.559716] ffff8803331cb3f0 0000000000000046 06f81c2907b5927f ffff880330f3b5f0
[ 2880.559719] 00000000000141c0 ffff8803325cffd8 00000000000141c0 ffff880330f3b5f0
[ 2880.559722] 0000000000000000 ffff880332d11280 ffff880330370000 ffffffffa048c6c0
[ 2880.559726] Call Trace:
[ 2880.559734] [<ffffffffa048c6c0>] ? write_dirty+0xc0/0xc0 [bcache]
[ 2880.559738] [<ffffffff8108e45a>] ? kthread+0x9a/0xe0
auto eth0
iface eth0 inet static
address 10.100.1.17/16
gateway 10.100.0.1
up ip addr add 10.100.245.17 dev eth0
up ip -4 route add default via 10.100.0.1 table default
down ip -4 route del default via 10.100.0.1 table default || true
up ip -4 rule add from 10.100.245.17 lookup default