Skip to content

Instantly share code, notes, and snippets.

> invoke --debug build_image --clean build --clean
invoke.program._parse: No default namespace provided, trying to load one from disk
invoke.loader.find: FilesystemLoader find starting at '/src/kth'
invoke.loader.find: Found module: '/src/kth/tasks.py'
invoke.parser.__init__: Adding <parser/Context 'build_image': {'clean': <Argument: clean (c) [bool]>}>
invoke.parser.__init__: Adding <parser/Context 'build': {'clean': <Argument: clean (c) [bool]>}>
invoke.program.parse_tasks: Parsing tasks against <Collection 'tasks': build, build_image>
invoke.parser.__init__: Initialized with context: <parser/Context: {'complete': <Argument: complete [bool]>, 'debug': <Argument: debug (d) [bool]>, 'write-pyc': <Argument: write-pyc [bool]>, 'echo': <Argument: echo (e) [bool]>, 'config': <Argument: config (f)>, 'help': <Argument: help (h) ?>, 'hide': <Argument: hide>, 'list': <Argument: list (l) [bool]>, 'pty': <Argument: pty (p) [bool]>, 'version': <Argument: version (V) [bool]>, 'warn-only': <Argument: warn-only (w) [bool]>
@jeamland
jeamland / bot_ips.csv
Last active February 28, 2017 23:36
Addresses of the bot herd that's been lurking on my IRC channel
timestamp hostname ip
1482994205.3429942 58.65.240.98 58.65.240.98
1482994916.135309 183.88.114.86 183.88.114.86
1482997224.2518485 node-wlx.pool-125-24.dynamic.totbb.net 125.24.165.21
1483000350.4510095 223.206.68.87 223.206.68.87
1483185632.0538342 190.131.223.210 190.131.223.210
1483186654.5194867 178.62.196.230 178.62.196.230
1483186708.4797575 64-199-12-222.ip.mcleodusa.net 64.199.12.222
1483186841.3642223 181.211.145.226 181.211.145.226
1483187355.7932973 181.211.145.226 181.211.145.226
package main
import "database/sql"
import "flag"
import "fmt"
import "log"
import _ "github.com/jbarham/gopgsqldriver"
func main() {
import itertools
def is_odd(val):
print "Checking", str(val)
return bool(val % 2)
print "Using map..."
print any(map(is_odd, range(0, 10)))
print "\nUsing itertools.imap..."
print any(itertools.imap(is_odd, range(0, 10)))
> python -m timeit 'str("wombles are small") + ";"'
1000000 loops, best of 3: 0.309 usec per loop
> python -m timeit '"%s;" % "wombles are small"'
10000000 loops, best of 3: 0.0344 usec per loop
> python -m timeit '"{};".format("wombles are small")'
1000000 loops, best of 3: 0.374 usec per loop
import os
import urlparse
from django.core.handlers.wsgi import WSGIHandler
from django.core import management
from wsgi_intercept import add_wsgi_intercept, httplib_intercept, \
mechanize_intercept, wsgi_fake_socket
from pycon import settings
@jeamland
jeamland / gist:3943691
Created October 24, 2012 04:06
gdalinfo dtm20m.tif
gdalinfo dtm20m.tif
Driver: GTiff/GeoTIFF
Files: dtm20m.tif
dtm20m.tif.aux.xml
Size is 43500, 29200
Coordinate System is:
PROJCS["unnamed",
GEOGCS["GDA94",
DATUM["Geocentric_Datum_of_Australia_1994",
SPHEROID["GRS 1980",6378137,298.2572221010002,
@jeamland
jeamland / gist:3943009
Created October 24, 2012 00:36
gdalinfo dtm20m
Driver: AIG/Arc/Info Binary Grid
Files: dtm20m
dtm20m.aux
dtm20m.rrd
dtm20m/w001001x.adf
dtm20m/dblbnd.adf
dtm20m/prj.adf
dtm20m/z001001x.adf
dtm20m/hdr.adf
dtm20m/metadata.xml
@jeamland
jeamland / gist:3942961
Created October 24, 2012 00:26
valgrind raster2pgsql dtm20m
==10786== Memcheck, a memory error detector
==10786== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==10786== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==10786== Command: raster2pgsql dtm20m
==10786==
Processing 1/1: dtm20m
==10786== Warning: set address range perms: large range [0x395a5040, 0x68312b40) (undefined)
==10786== Invalid write of size 4
==10786== at 0x40D3C3: ??? (in /usr/bin/raster2pgsql)
==10786== by 0x4108F5: ??? (in /usr/bin/raster2pgsql)
@jeamland
jeamland / gist:3838125
Created October 5, 2012 04:36
Django admin vs readonly
<freakboy3742> Holocaine: I'm here...
<Holocaine> freakboy3742: It's cool. He was having a sad over there not being
a "view" permission in django-admin and I suggested that if he wanted to find
out why that got bounced he could talk to you (for example) and find out what
other alternatives might exist.
<freakboy3742> Holocaine: Yeah - that's an interesting discussions with lots
of history
<Holocaine> freakboy3742: It looked like one which is why I figured it'd be
worth him getting some background on it before trying to head in any particular
direction.