This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ps aux # get the pid | |
| netstat -tulpn | grep PID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ps aux --sort -pmem | head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| s3cmd ls s3://S3_BUCKET | grep PATTERN | tr -s ' ' | cut -d' ' -f4- | xargs s3cmd get |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ python -m timeit -s 'from collections import namedtuple; NT = namedtuple("NT", "a"); nt = NT(1)' 'nt.a' | |
| 10000000 loops, best of 3: 0.138 usec per loop | |
| /U/d/chartbeat(dev)(master)$ python -m timeit -s 'd = (1, )' 'd[0]' | |
| 10000000 loops, best of 3: 0.0409 usec per loop | |
| /U/d/chartbeat(dev)(master)$ python -m timeit -s 'd = {"a": 1}' 'd["a"]' | |
| 10000000 loops, best of 3: 0.0358 usec per loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ps aux | grep FOOBARBAZ | tr -s ' ' | cut -d' ' -f2 | xargs kill -9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db.getCollectionNames().filter(function(col){return db[col].getIndexes().filter(function(idx){return idx.unique}).length}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns test-kafka.core | |
| (:gen-class) | |
| (:require [clj-kafka.consumer.zk :refer :all] | |
| [clj-kafka.core :refer :all] | |
| [msgpack.core :refer :all])) | |
| (def config {"zookeeper.connect" "zk04/cb/kafka/pingqueue" | |
| "group.id" "clj-kafka.consumer" | |
| "auto.offset.reset" "smallest" | |
| "auto.commit.enable" "false"}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ExceptionCatcher(): | |
| def __enter__(self): | |
| self.msg = None | |
| def __exit__(self, type, value, traceback): | |
| if type is Exception: | |
| self.msg = value | |
| return True # if you return a truthy value then the exception isn't raised |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jq -c '[.["@timestamp"], .levelname, .path, .message]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (require '[clojure.test :refer [run-tests]]) | |
| (do (require 'cb-riak.cb-riak-test :reload-all) (run-tests 'cb-riak.cb-riak-test)) |