Skip to content

Instantly share code, notes, and snippets.

@necaris
necaris / ipython_config.py
Created Feb 7, 2012
IPython config snippet that makes it work with virtualenv
View ipython_config.py
# Configuration snippet to let system-wide IPython work with virtualenvs
# Code taken from Ahmed Soliman's post at:
# (http://www.ahmedsoliman.com/2011/09/27/use-virtualenv-with-ipython-0-11/)
# Tweaked by Rami Chowdhury
from os import environ
from os.path import join, sep
from sys import version_info
if version_info[0] > 2:
# Python 3.x doesn't define this, so for convenience, we do.
@necaris
necaris / pycheckers
Created Feb 7, 2012
My collection of Python correctness-checkers
View pycheckers
#!/bin/bash
pyflakes "$1"
pep8 --repeat "$1"
true
View maven-output.txt
Downloading: http://download.java.net/maven/2/net/java/jvnet-parent/1/jvnet-parent-1.pom
[INFO] Unable to find resource 'net.java:jvnet-parent:pom:1' in repository m2.java.net (http://download.java.net/maven/2)
Downloading: http://repository.jboss.org/nexus/content/groups/public//net/java/jvnet-parent/1/jvnet-parent-1.pom
[INFO] Unable to find resource 'net.java:jvnet-parent:pom:1' in repository repository.jboss.org (http://repository.jboss.org/nexus/content/groups/public/)
Downloading: http://maven.glassfish.org/content/groups/glassfish/net/java/jvnet-parent/1/jvnet-parent-1.pom
185b downloaded (jvnet-parent-1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '6c9fd3d150b8a5f0ca676f49b8ed603793cabebb'; remote = '<html>
<head><title>301' - RETRYING
Downloading: http://maven.glassfish.org/content/groups/glassfish/net/java/jvnet-parent/1/jvnet-parent-1.pom
185b downloaded (jvnet-parent-1.pom)
@necaris
necaris / latency.txt
Created May 31, 2012 — forked from jboner/latency.txt
Latency numbers every programmer should know
View latency.txt
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
View ping_results.txt
$ ping www.google.com.bd
PING www.google.com.bd (74.125.135.94): 56 data bytes
64 bytes from 74.125.135.94: icmp_seq=0 ttl=45 time=359.124 ms
64 bytes from 74.125.135.94: icmp_seq=1 ttl=45 time=904.636 ms
Request timeout for icmp_seq 2
64 bytes from 74.125.135.94: icmp_seq=3 ttl=45 time=674.531 ms
Request timeout for icmp_seq 4
64 bytes from 74.125.135.94: icmp_seq=5 ttl=45 time=623.437 ms
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
@necaris
necaris / couchdb2cb.py
Last active Dec 2, 2017
Simple script to transfer data from CouchDB to Couchbase
View couchdb2cb.py
#-*-coding: utf-8-*-
"""
Simple script to dump documents out of a CouchDB database and straight into
a Couchbase instance.
"""
import time
import sys
import argparse
View couchdb2cb_replicator.py
#!/usr/bin/env python
#-*-coding: utf-8-*-
"""
Fake CouchDB replication endpoint that copies documents into Couchbase.
"""
# Copyright (c) 2013, Rami Chowdhury
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
View couchdb2cb_direct.py
#!/usr/bin/env python
#-*-coding: utf-8-*-
"""
Simple script to dump documents out of a CouchDB database and straight into
a Couchbase instance.
"""
# Copyright (c) 2013, Rami Chowdhury
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
View gist:10613453
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/local/lib/python2.7/site-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/local/lib/python2.7/site-packages/pip/req.py", line 901, in move_wheel_files
View keybase.md

Keybase proof

I hereby claim:

  • I am necaris on github.
  • I am necaris (https://keybase.io/necaris) on keybase.
  • I have a public key whose fingerprint is 3BF7 81AD 3BD9 B5EF 67C8 E0DE EA69 CB29 A08D 8FD1

To claim this, I am signing this object:

You can’t perform that action at this time.