Skip to content

Instantly share code, notes, and snippets.

@borntyping
borntyping / rm
Last active August 29, 2015 13:59
❯ mkdir test
❯ touch test/{a,b,c}
❯ touch test/.{a,b,c}
❯ ls -la test/.*
-rw-r--r-- 1 sam sam 0 Apr 13 17:10 test/.a
-rw-r--r-- 1 sam sam 0 Apr 13 17:10 test/.b
-rw-r--r-- 1 sam sam 0 Apr 13 17:10 test/.c
❯ rm -v test/.*
removed `test/.a'
removed `test/.b'
bot = igor.Igor()
bot.register_plugin(igor.plugins.commands)
bot.connect('irc.aberwiki.org')
bot.start()
@borntyping
borntyping / 0-install.sh
Last active August 29, 2015 14:00
Installing storyplayer
cat > composer.json <<INPUT
{
"require": {
"datasift/storyplayer": "1.5.0"
}
}
INPUT
sudo aptitude install php5-cli php5-curl
curl -sS https://getcomposer.org/installer | php
@borntyping
borntyping / metatest.md
Last active August 29, 2015 14:00
Metatest

Metatest

A command line tool to manage and execute multiple test runners and development tools in an automated way. It would potentially be able to:

  • Run metatests in parallel
  • Allow for metatests to be repeated with multiple inputs. This should include configuration such as python versions to test against, or a generated list of components a test should be run against.
  • Prioritisation of metatests - metatests can be assigned a priority, and be filtered by it
  • Provide a scriptable, automatable interface
  • Test tagging as a single interface to priority, environments and categorisation
#!/usr/bin/env python3
import argparse
import getpass
import logging
import subprocess
import colorlog
@borntyping
borntyping / python-riemann-client_example.py
Last active August 29, 2015 14:01
Example usage for python-riemann-client
import riemann_client.transport
import riemann_client.client
# Create a transport and client
transport = riemann_client.transport.TCPTransport(host, port)
client = riemann_client.client.QueuedClient(transport)
# Add events to the queue
client.event(service='one', metric_f=1)
client.event(service='two', metric_f=2)
WARN [2014-05-16 15:32:48,506] riemann task 2 - riemann.streams - riemann.config$update_index$update__18502@7ae2fec8 threw
java.lang.IllegalArgumentException: No implementation of method: :update of protocol: #'riemann.index/Index found for class: nil
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:541)
at riemann.index$fn__8454$G__8402__8461.invoke(index.clj:18)
at riemann.core$update_index.invoke(core.clj:179)
at riemann.config$update_index$update__18502.invoke(config.clj:140)
at riemann.streams$default$stream__9829$fn__9840.invoke(streams.clj:1180)
at riemann.streams$default$stream__9829.invoke(streams.clj:1180)
at riemann.streams$rate$tick__9319$fn__9330.invoke(streams.clj:769)
at riemann.streams$rate$tick__9319.invoke(streams.clj:769)
# https://enterprise.github.com/help/articles/using-self-signed-ssl-certificates
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -days 365 -out rootCA.crt
openssl genrsa -out host.key 2048
openssl req -new -key host.key -out host.csr
openssl x509 -req -in host.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out host.crt -days 365
openssl rsa -in host.key -out host.nocrypt.key
openssl pkcs8 -topk8 -in host.nocrypt.key -out host.pkcs8.key -nocrypt
[sam@el6:~]$ yum install centos-release-SCL
[sam@el6:~]$ repoquery --requires python27
python27-python
python27-python-jinja2
python27-python-nose
python27-python-setuptools
python27-python-simplejson
python27-python-sphinx
python27-python-sqlalchemy
python27-python-virtualenv
@borntyping
borntyping / run_sleep.sh
Created June 26, 2014 15:45
exec + ulimit example
❯ ./set_ulimit.sh
14569 unlimit: 1024
14569 unlimit: 69
14569 unlimit: 69 (exec)