Skip to content

Instantly share code, notes, and snippets.

View pstch's full-sized avatar
🔥
/dev/null

pistache pstch

🔥
/dev/null
View GitHub Profile
@pstch
pstch / protectedviews.py
Created November 9, 2012 09:59
Django View that requires login when using site-wide login forms
class ProtectedTemplateView(TemplateView):
def dispatch(self, request, *args, **kwargs):
if not request.user.is_authenticated():
print 'Potatoes !'
return render(request, 'syncoor/auth/login_required.html', {'next' : request.get_full_path(), 'login_form_present' : True})
return super(ProtectedTemplateView, self).dispatch(request,*args, **kwargs)
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@pstch
pstch / switch.py
Last active August 29, 2015 14:10 — forked from Lucretiel/switch.py
from contextlib import contextmanager
class SwitchError(RuntimeError):
pass
@contextmanager
def switch(switch_value, *, ignore_nomatch=True):
blocks = {}
blocks.default = None

Keybase proof

I hereby claim:

  • I am pstch on github.
  • I am pstch (https://keybase.io/pstch) on keybase.
  • I have a public key ASAhkRb5Vlrv-iT2PtXW0A-nqu8vvkK7HtnzWrD_VBEHggo

To claim this, I am signing this object:

[ 1144.858819] SPL: Loaded module v0.7.0-rc2_4_gf200b83
[ 1144.859083] icp: module license 'CDDL' taints kernel.
[ 1144.859086] Disabling lock debugging due to kernel taint
[ 1146.561672] ZFS: Loaded module v0.7.0-rc2, ZFS pool version 5000, ZFS filesystem version 5
[ 1320.524829] sdc: sdc1 sdc9
[ 1320.633921] sdc: sdc1 sdc9
[ 1320.734422] sdc: sdc1 sdc9
[ 1320.865495] sdb: sdb1 sdb9
[ 1320.967222] sdb: sdb1 sdb9
[ 1321.067579] sdb: sdb1 sdb9
[117234.342190] VERIFY3(c < (1ULL << 24) >> 9) failed (36028797018963967 < 32768)
[117234.342324] PANIC at zio.c:267:zio_buf_alloc()
[117234.342414] Showing stack for process 27253
[117234.342419] CPU: 2 PID: 27253 Comm: z_wr_iss Tainted: P C O 3.16.0-4-amd64 #1 Debian 3.16.36-1+deb8u1
[117234.342421] Hardware name: Dell Inc. PowerEdge 1950/0UR033, BIOS 2.7.0 10/30/2010
[117234.342424] 0000000000000000 ffffffff81512391 ffffffffa096ebd5 ffff880323417ca0
[117234.342428] ffffffffa073438f 0000000000000000 0000000000000030 ffff880323417cb0
[117234.342431] ffff880323417c50 2833594649524556 4c553128203c2063 293432203c3c204c
[117234.342435] Call Trace:
[117234.342444] [<ffffffff81512391>] ? dump_stack+0x5d/0x78
user@gramsci:/tmp/zfsonlinux-build-debug/zfs$ ./configure --enable-debug --with-linux=/lib/modules/3.16.0-4-amd64/source --with-linux-obj=/lib/modules/3.16.0-4-amd64/build
checking for gawk... gawk
checking metadata... META file
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
[ 1400.707052] SPL: Loaded module v0.7.0-rc2_4_gf200b83 (DEBUG mode)
[ 1404.921460] ZFS: Loaded module v0.7.0-rc2 (DEBUG mode), ZFS pool version 5000, ZFS filesystem version 5
[ 1453.651377] SPL: using hostid 0x00000000
[ 1525.732667] VERIFY3(psize > 0) failed (0 > 0)
[ 1525.733499] VERIFY3(psize > 0) failed (0 > 0)
[ 1525.733501] PANIC at arc.c:6226:arc_write_ready()
[ 1525.733502] Showing stack for process 25567
[ 1525.733506] CPU: 3 PID: 25567 Comm: z_wr_iss Tainted: P C O 3.16.0-4-amd64 #1 Debian 3.16.36-1+deb8u1
[ 1525.733507] Hardware name: Dell Inc. PowerEdge 1950/0UR033, BIOS 2.7.0 10/30/2010
[ 1525.733510] 0000000000000000 ffffffff81512391 ffffffffa0930b65 ffff8800c8dd3d48
[139741.315562] VERIFY3(0 == hdr->b_l1hdr.b_bufcnt) failed (0 == 1)
[139741.316428] VERIFY3(0 == hdr->b_l1hdr.b_bufcnt) failed (0 == 1)
[139741.316429] PANIC at arc.c:5347:arc_read_done()
[139741.316430] Showing stack for process 270
[139741.316433] CPU: 0 PID: 270 Comm: z_rd_int_7 Tainted: P O 3.16.0-4-amd64 #1 Debian 3.16.36-1+deb8u1
[139741.316434] Hardware name: Dell Inc. PowerEdge 1950/0UR033, BIOS 2.7.0 10/30/2010
[139741.316438] 0000000000000000 ffffffff81512391 ffffffffa0467b65 ffff88039abd3d30
[139741.316440] ffffffffa019b9ff ffffffffa02744e3 ffff880300000030 ffff88039abd3d40
[139741.316441] ffff88039abd3ce0 2833594649524556 726468203d3d2030 6468316c5f623e2d
[139741.316442] Call Trace:
@pstch
pstch / zfs_pooldiff.py
Last active December 23, 2016 03:04
ZFS pool comparison
# Copyright (C) 2016 Hugo Geoffroy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the